dss-python 0.15.8a1__tar.gz → 0.16.0b1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/.gitignore +1 -0
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/PKG-INFO +13 -16
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/README.md +6 -6
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/IActiveClass.py +29 -19
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/IBus.py +93 -84
- dss_python-0.16.0b1/dss/ICNData.py +185 -0
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/ICapControls.py +33 -38
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/ICapacitors.py +18 -19
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/ICircuit.py +107 -107
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/ICktElement.py +134 -107
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/ICtrlQueue.py +18 -18
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/IDSS.py +156 -89
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/IDSSElement.py +23 -8
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/IDSSEvents.py +5 -5
- dss_python-0.16.0b1/dss/IDSSProgress.py +56 -0
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/IDSSProperty.py +9 -15
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/IDSS_Executive.py +11 -11
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/IError.py +20 -15
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/IFuses.py +26 -35
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/IGICSources.py +21 -21
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/IGenerators.py +42 -54
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/IISources.py +9 -9
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/ILineCodes.py +37 -40
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/ILineGeometries.py +30 -37
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/ILineSpacings.py +13 -15
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/ILines.py +76 -92
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/ILoadShapes.py +27 -33
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/ILoads.py +78 -95
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/IMeters.py +50 -58
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/IMonitors.py +37 -39
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/IPDElements.py +57 -59
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/IPVSystems.py +30 -49
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/IParallel.py +18 -20
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/IParser.py +23 -41
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/IReactors.py +75 -77
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/IReclosers.py +32 -39
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/IReduceCkt.py +22 -34
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/IRegControls.py +46 -52
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/IRelays.py +19 -25
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/ISensors.py +28 -36
- dss_python-0.16.0b1/dss/ISettings.py +661 -0
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/ISolution.py +115 -108
- dss_python-0.16.0b1/dss/IStorages.py +323 -0
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/ISwtControls.py +18 -21
- dss_python-0.16.0b1/dss/ITSData.py +173 -0
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/IText.py +9 -15
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/ITopology.py +23 -29
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/ITransformers.py +50 -57
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/IVsources.py +13 -13
- dss_python-0.16.0b1/dss/IWindGens.py +395 -0
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/IWireData.py +25 -25
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/IXYCurves.py +23 -25
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/IYMatrix.py +33 -33
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/IZIP.py +14 -22
- dss_python-0.16.0b1/dss/Oddie.py +145 -0
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/UserModels/wrappers.py +47 -8
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/__init__.py +4 -4
- dss_python-0.16.0b1/dss/_cffi_api_util.py +1340 -0
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/_types.py +13 -3
- dss_python-0.16.0b1/dss/_version.py +1 -0
- dss_python-0.16.0b1/dss/error.py +3 -0
- dss_python-0.16.0b1/dss/messages/properties-alt-en-US.mo +0 -0
- dss_python-0.16.0b1/dss/messages/properties-en-US.mo +0 -0
- dss_python-0.16.0b1/dss/notebook.py +162 -0
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/patch_dss_com.py +68 -11
- dss_python-0.16.0b1/dss/plot.py +2684 -0
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/pyproject.toml +6 -9
- dss_python-0.15.8a1/dss/ICNData.py +0 -185
- dss_python-0.15.8a1/dss/IDSSProgress.py +0 -45
- dss_python-0.15.8a1/dss/IDSSimComs.py +0 -18
- dss_python-0.15.8a1/dss/ISettings.py +0 -321
- dss_python-0.15.8a1/dss/IStorages.py +0 -59
- dss_python-0.15.8a1/dss/ITSData.py +0 -173
- dss_python-0.15.8a1/dss/Oddie.py +0 -84
- dss_python-0.15.8a1/dss/_cffi_api_util.py +0 -1051
- dss_python-0.15.8a1/dss/_version.py +0 -1
- dss_python-0.15.8a1/dss/plot.py +0 -1998
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/LICENSE +0 -0
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/UserModels/__init__.py +0 -0
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/UserModels/bases.py +0 -0
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/enums.py +0 -0
- {dss_python-0.15.8a1 → dss_python-0.16.0b1}/dss/examples.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: dss-python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.16.0b1
|
|
4
4
|
Summary: Python interface (bindings and tools) for OpenDSS. Based on the AltDSS/DSS C-API project, the alternative OpenDSS implementation from DSS-Extensions.org. Multiplatform, API-compatible/drop-in replacement for the COM version of OpenDSS.
|
|
5
5
|
Project-URL: Homepage, https://github.com/dss-extensions/DSS-Python
|
|
6
6
|
Project-URL: Documentation, https://dss-extensions.org/DSS-Python
|
|
@@ -45,18 +45,15 @@ Classifier: Development Status :: 5 - Production/Stable
|
|
|
45
45
|
Classifier: Intended Audience :: Education
|
|
46
46
|
Classifier: Intended Audience :: Science/Research
|
|
47
47
|
Classifier: License :: OSI Approved :: BSD License
|
|
48
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
49
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
50
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
51
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
52
48
|
Classifier: Programming Language :: Python :: 3.11
|
|
53
49
|
Classifier: Programming Language :: Python :: 3.12
|
|
50
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
51
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
54
52
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
55
|
-
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
56
53
|
Classifier: Topic :: Scientific/Engineering
|
|
57
|
-
Requires-Python: >=3.
|
|
58
|
-
Requires-Dist: dss-python-backend==0.
|
|
59
|
-
Requires-Dist: numpy
|
|
54
|
+
Requires-Python: >=3.11
|
|
55
|
+
Requires-Dist: dss-python-backend==0.15.0b3
|
|
56
|
+
Requires-Dist: numpy<3,>=2
|
|
60
57
|
Requires-Dist: typing-extensions<5,>=4.5
|
|
61
58
|
Provides-Extra: all
|
|
62
59
|
Requires-Dist: altdss; extra == 'all'
|
|
@@ -82,7 +79,7 @@ Description-Content-Type: text/markdown
|
|
|
82
79
|
|
|
83
80
|
# DSS-Python: Extended bindings for an alternative implementation of EPRI's OpenDSS
|
|
84
81
|
|
|
85
|
-
Python bindings and misc tools for using our to [our customized/alternative implementation](https://github.com/dss-extensions/dss_capi) of [OpenDSS](http://smartgrid.epri.com/SimulationTool.aspx), AltDSS/DSS C-API library. OpenDSS is an open-source electric power distribution system simulator [distributed by EPRI](https://sourceforge.net/p/electricdss/). Based on DSS C-API, CFFI and NumPy, aiming for enhanced performance and full compatibility with
|
|
82
|
+
Python bindings and misc tools for using our to [our customized/alternative implementation](https://github.com/dss-extensions/dss_capi) of [OpenDSS](http://smartgrid.epri.com/SimulationTool.aspx), AltDSS/DSS C-API library. OpenDSS is an open-source electric power distribution system simulator [distributed by EPRI](https://sourceforge.net/p/electricdss/). Based on DSS C-API, CFFI and NumPy, aiming for enhanced performance and full compatibility with EPRI's OpenDSS COM object API on Windows, Linux and macOS. Support includes Intel-based (x86 and x64) processors, as well as ARM processors for Linux (including Raspberry Pi devices) and macOS (including Apple M1 and later).
|
|
86
83
|
|
|
87
84
|
More context about this project and its components (including alternatives in [Julia](https://dss-extensions.org/OpenDSSDirect.jl/latest/), [MATLAB](https://github.com/dss-extensions/dss_matlab/), C++, [C#/.NET](https://github.com/dss-extensions/dss_sharp/), [Go](https://github.com/dss-extensions/AltDSS-Go/), and [Rust](https://github.com/dss-extensions/AltDSS-Rust/)), please check [https://dss-extensions.org/](https://dss-extensions.org/) and our hub repository at [dss-extensions/dss-extensions](https://github.com/dss-extensions/dss-extensions) for more documentation, discussions and the [FAQ](https://dss-extensions.org/faq.html).
|
|
88
85
|
|
|
@@ -90,7 +87,7 @@ This package can be used as a companion to [OpenDSSDirect.py](http://github.com/
|
|
|
90
87
|
|
|
91
88
|
While we plan to add a lot more functionality into DSS-Python, the main goal of creating a COM-compatible API has been reached in 2018. If you find an unexpected missing feature, please report it! Currently missing features that will be implemented eventually are interactive features and diakoptics (planned for a future version).
|
|
92
89
|
|
|
93
|
-
This module mimics the COM structure (as exposed via `win32com` or `comtypes`) — see [The DSS instance](https://dss-extensions.org/DSS-Python/#the-dss-instance) as well as [OpenDSS COM/classic APIs](https://dss-extensions.org/classic_api.html) for some docs — effectively enabling multi-platform compatibility at Python level. Compared to other options, it provides easier migration from code that uses
|
|
90
|
+
This module mimics the COM structure (as exposed via `win32com` or `comtypes`) — see [The DSS instance](https://dss-extensions.org/DSS-Python/#the-dss-instance) as well as [OpenDSS COM/classic APIs](https://dss-extensions.org/classic_api.html) for some docs — effectively enabling multi-platform compatibility at Python level. Compared to other options, it provides easier migration from code that uses EPRI's OpenDSS through COM. See also [OpenDSS: Python APIs](https://dss-extensions.org/python_apis.html).
|
|
94
91
|
Most of the COM documentation can be used as-is, but instead of returning tuples or lists, this module returns/accepts NumPy arrays for numeric data exchange, which is usually preferred by the users. By toggle `DSS.AdvancedTypes`, complex numbers and matrices (shaped arrays) are also used to provide a more modern experience.
|
|
95
92
|
|
|
96
93
|
The module depends mostly on CFFI, NumPy, typing_extensions and, optionally, SciPy.Sparse for reading the sparse system admittance matrix. Pandas and matplotlib are optional dependencies [to enable plotting](https://github.com/dss-extensions/dss_python/blob/master/docs/examples/Plotting.ipynb) and other features.
|
|
@@ -180,7 +177,7 @@ import win32com.client
|
|
|
180
177
|
dss_engine = win32com.client.gencache.EnsureDispatch("OpenDSSEngine.DSS")
|
|
181
178
|
```
|
|
182
179
|
|
|
183
|
-
or `comtypes` (incidentally, `comtypes` is usually faster than `win32com`, so we recommend it if you need
|
|
180
|
+
or `comtypes` (incidentally, `comtypes` is usually faster than `win32com`, so we recommend it if you need EPRI's OpenDSS COM module):
|
|
184
181
|
|
|
185
182
|
```python
|
|
186
183
|
import comtypes.client
|
|
@@ -209,18 +206,18 @@ for i in range(len(voltages) // 2):
|
|
|
209
206
|
|
|
210
207
|
## Testing
|
|
211
208
|
|
|
212
|
-
Since the DLL is built using the Free Pascal compiler, which is not officially supported by EPRI, the results are validated running sample networks provided in
|
|
209
|
+
Since the DLL is built using the Free Pascal compiler, which is not officially supported by EPRI, the results are validated running sample networks provided in EPRI's OpenDSS distribution. The only modifications are done directly by the script, removing interactive features and some other minor issues. Most of the sample files from EPRI's OpenDSS repository are used for validation.
|
|
213
210
|
|
|
214
211
|
The validation scripts is `tests/validation.py` and requires the same folder structure as the building process. You need `win32com` to run it on Windows.
|
|
215
212
|
|
|
216
|
-
As of version 0.11, the full validation suite can be run on the three supported platforms. This is possible by saving
|
|
213
|
+
As of version 0.11, the full validation suite can be run on the three supported platforms. This is possible by saving EPRI's OpenDSS COM DLL output and loading it on macOS and Linux. We hope to fully automate this validation in the future.
|
|
217
214
|
|
|
218
215
|
## Roadmap: docs and interactive features
|
|
219
216
|
|
|
220
217
|
Besides bug fixes, the main functionality of this library is mostly done. Notable desirable features that may be implemented are:
|
|
221
218
|
|
|
222
219
|
- More examples, especially for the extra features. There is a growing documentation hosted at [https://dss-extensions.org/Python/](https://dss-extensions.org/DSS-Python/) and [https://dss-extensions.org/docs.html](https://dss-extensions.org/docs.html); watch also https://github.com/dss-extensions/dss-extensions for more.
|
|
223
|
-
- Reports integrated in Python and interactive features on plots. Since most of the plot types from
|
|
220
|
+
- Reports integrated in Python and interactive features on plots. Since most of the plot types from EPRI's OpenDSS are optionally available since DSS-Python 0.14.2, advanced integration and interactive features are planned for a future feature.
|
|
224
221
|
|
|
225
222
|
Expect news about these items by version 1.0.
|
|
226
223
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
# DSS-Python: Extended bindings for an alternative implementation of EPRI's OpenDSS
|
|
7
7
|
|
|
8
|
-
Python bindings and misc tools for using our to [our customized/alternative implementation](https://github.com/dss-extensions/dss_capi) of [OpenDSS](http://smartgrid.epri.com/SimulationTool.aspx), AltDSS/DSS C-API library. OpenDSS is an open-source electric power distribution system simulator [distributed by EPRI](https://sourceforge.net/p/electricdss/). Based on DSS C-API, CFFI and NumPy, aiming for enhanced performance and full compatibility with
|
|
8
|
+
Python bindings and misc tools for using our to [our customized/alternative implementation](https://github.com/dss-extensions/dss_capi) of [OpenDSS](http://smartgrid.epri.com/SimulationTool.aspx), AltDSS/DSS C-API library. OpenDSS is an open-source electric power distribution system simulator [distributed by EPRI](https://sourceforge.net/p/electricdss/). Based on DSS C-API, CFFI and NumPy, aiming for enhanced performance and full compatibility with EPRI's OpenDSS COM object API on Windows, Linux and macOS. Support includes Intel-based (x86 and x64) processors, as well as ARM processors for Linux (including Raspberry Pi devices) and macOS (including Apple M1 and later).
|
|
9
9
|
|
|
10
10
|
More context about this project and its components (including alternatives in [Julia](https://dss-extensions.org/OpenDSSDirect.jl/latest/), [MATLAB](https://github.com/dss-extensions/dss_matlab/), C++, [C#/.NET](https://github.com/dss-extensions/dss_sharp/), [Go](https://github.com/dss-extensions/AltDSS-Go/), and [Rust](https://github.com/dss-extensions/AltDSS-Rust/)), please check [https://dss-extensions.org/](https://dss-extensions.org/) and our hub repository at [dss-extensions/dss-extensions](https://github.com/dss-extensions/dss-extensions) for more documentation, discussions and the [FAQ](https://dss-extensions.org/faq.html).
|
|
11
11
|
|
|
@@ -13,7 +13,7 @@ This package can be used as a companion to [OpenDSSDirect.py](http://github.com/
|
|
|
13
13
|
|
|
14
14
|
While we plan to add a lot more functionality into DSS-Python, the main goal of creating a COM-compatible API has been reached in 2018. If you find an unexpected missing feature, please report it! Currently missing features that will be implemented eventually are interactive features and diakoptics (planned for a future version).
|
|
15
15
|
|
|
16
|
-
This module mimics the COM structure (as exposed via `win32com` or `comtypes`) — see [The DSS instance](https://dss-extensions.org/DSS-Python/#the-dss-instance) as well as [OpenDSS COM/classic APIs](https://dss-extensions.org/classic_api.html) for some docs — effectively enabling multi-platform compatibility at Python level. Compared to other options, it provides easier migration from code that uses
|
|
16
|
+
This module mimics the COM structure (as exposed via `win32com` or `comtypes`) — see [The DSS instance](https://dss-extensions.org/DSS-Python/#the-dss-instance) as well as [OpenDSS COM/classic APIs](https://dss-extensions.org/classic_api.html) for some docs — effectively enabling multi-platform compatibility at Python level. Compared to other options, it provides easier migration from code that uses EPRI's OpenDSS through COM. See also [OpenDSS: Python APIs](https://dss-extensions.org/python_apis.html).
|
|
17
17
|
Most of the COM documentation can be used as-is, but instead of returning tuples or lists, this module returns/accepts NumPy arrays for numeric data exchange, which is usually preferred by the users. By toggle `DSS.AdvancedTypes`, complex numbers and matrices (shaped arrays) are also used to provide a more modern experience.
|
|
18
18
|
|
|
19
19
|
The module depends mostly on CFFI, NumPy, typing_extensions and, optionally, SciPy.Sparse for reading the sparse system admittance matrix. Pandas and matplotlib are optional dependencies [to enable plotting](https://github.com/dss-extensions/dss_python/blob/master/docs/examples/Plotting.ipynb) and other features.
|
|
@@ -103,7 +103,7 @@ import win32com.client
|
|
|
103
103
|
dss_engine = win32com.client.gencache.EnsureDispatch("OpenDSSEngine.DSS")
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
-
or `comtypes` (incidentally, `comtypes` is usually faster than `win32com`, so we recommend it if you need
|
|
106
|
+
or `comtypes` (incidentally, `comtypes` is usually faster than `win32com`, so we recommend it if you need EPRI's OpenDSS COM module):
|
|
107
107
|
|
|
108
108
|
```python
|
|
109
109
|
import comtypes.client
|
|
@@ -132,18 +132,18 @@ for i in range(len(voltages) // 2):
|
|
|
132
132
|
|
|
133
133
|
## Testing
|
|
134
134
|
|
|
135
|
-
Since the DLL is built using the Free Pascal compiler, which is not officially supported by EPRI, the results are validated running sample networks provided in
|
|
135
|
+
Since the DLL is built using the Free Pascal compiler, which is not officially supported by EPRI, the results are validated running sample networks provided in EPRI's OpenDSS distribution. The only modifications are done directly by the script, removing interactive features and some other minor issues. Most of the sample files from EPRI's OpenDSS repository are used for validation.
|
|
136
136
|
|
|
137
137
|
The validation scripts is `tests/validation.py` and requires the same folder structure as the building process. You need `win32com` to run it on Windows.
|
|
138
138
|
|
|
139
|
-
As of version 0.11, the full validation suite can be run on the three supported platforms. This is possible by saving
|
|
139
|
+
As of version 0.11, the full validation suite can be run on the three supported platforms. This is possible by saving EPRI's OpenDSS COM DLL output and loading it on macOS and Linux. We hope to fully automate this validation in the future.
|
|
140
140
|
|
|
141
141
|
## Roadmap: docs and interactive features
|
|
142
142
|
|
|
143
143
|
Besides bug fixes, the main functionality of this library is mostly done. Notable desirable features that may be implemented are:
|
|
144
144
|
|
|
145
145
|
- More examples, especially for the extra features. There is a growing documentation hosted at [https://dss-extensions.org/Python/](https://dss-extensions.org/DSS-Python/) and [https://dss-extensions.org/docs.html](https://dss-extensions.org/docs.html); watch also https://github.com/dss-extensions/dss-extensions for more.
|
|
146
|
-
- Reports integrated in Python and interactive features on plots. Since most of the plot types from
|
|
146
|
+
- Reports integrated in Python and interactive features on plots. Since most of the plot types from EPRI's OpenDSS are optionally available since DSS-Python 0.14.2, advanced integration and interactive features are planned for a future feature.
|
|
147
147
|
|
|
148
148
|
Expect news about these items by version 1.0.
|
|
149
149
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# A compatibility layer for DSS C-API that mimics
|
|
2
|
-
# Copyright (c) 2016-
|
|
3
|
-
# Copyright (c) 2018-
|
|
1
|
+
# A compatibility layer for DSS C-API that mimics EPRI's OpenDSS COM interface.
|
|
2
|
+
# Copyright (c) 2016-2025 Paulo Meira
|
|
3
|
+
# Copyright (c) 2018-2025 DSS-Extensions contributors
|
|
4
4
|
from __future__ import annotations
|
|
5
5
|
from ._cffi_api_util import Base
|
|
6
6
|
from .enums import DSSJSONFlags
|
|
7
|
-
from typing import AnyStr, List, Iterator
|
|
7
|
+
from typing import AnyStr, List, Iterator, Optional
|
|
8
8
|
|
|
9
9
|
class IActiveClass(Base):
|
|
10
10
|
__slots__ = []
|
|
@@ -23,7 +23,7 @@ class IActiveClass(Base):
|
|
|
23
23
|
|
|
24
24
|
Original COM help: https://opendss.epri.com/ActiveClassName.html
|
|
25
25
|
'''
|
|
26
|
-
return self.
|
|
26
|
+
return self._lib.ActiveClass_Get_ActiveClassName()
|
|
27
27
|
|
|
28
28
|
@property
|
|
29
29
|
def AllNames(self) -> List[str]:
|
|
@@ -32,7 +32,7 @@ class IActiveClass(Base):
|
|
|
32
32
|
|
|
33
33
|
Original COM help: https://opendss.epri.com/AllNames.html
|
|
34
34
|
'''
|
|
35
|
-
return self.
|
|
35
|
+
return self._lib.ActiveClass_Get_AllNames()
|
|
36
36
|
|
|
37
37
|
@property
|
|
38
38
|
def Count(self) -> int:
|
|
@@ -41,10 +41,10 @@ class IActiveClass(Base):
|
|
|
41
41
|
|
|
42
42
|
Original COM help: https://opendss.epri.com/Count.html
|
|
43
43
|
'''
|
|
44
|
-
return self.
|
|
44
|
+
return self._lib.ActiveClass_Get_Count()
|
|
45
45
|
|
|
46
46
|
def __len__(self) -> int:
|
|
47
|
-
return self.
|
|
47
|
+
return self._lib.ActiveClass_Get_Count()
|
|
48
48
|
|
|
49
49
|
def __iter__(self) -> Iterator[IActiveClass]:
|
|
50
50
|
n = self.First
|
|
@@ -56,13 +56,13 @@ class IActiveClass(Base):
|
|
|
56
56
|
def First(self) -> int:
|
|
57
57
|
'''
|
|
58
58
|
Sets first element in the active class to be the active DSS object.
|
|
59
|
-
If the object is a CktElement,
|
|
59
|
+
If the object is a CktElement, ActiveCktElement also points to this element.
|
|
60
60
|
|
|
61
61
|
Returns 0 if none.
|
|
62
62
|
|
|
63
63
|
Original COM help: https://opendss.epri.com/First.html
|
|
64
64
|
'''
|
|
65
|
-
return self.
|
|
65
|
+
return self._lib.ActiveClass_Get_First()
|
|
66
66
|
|
|
67
67
|
@property
|
|
68
68
|
def Name(self) -> str:
|
|
@@ -71,14 +71,11 @@ class IActiveClass(Base):
|
|
|
71
71
|
|
|
72
72
|
Original COM help: https://opendss.epri.com/Name.html
|
|
73
73
|
'''
|
|
74
|
-
return self.
|
|
74
|
+
return self._lib.ActiveClass_Get_Name()
|
|
75
75
|
|
|
76
76
|
@Name.setter
|
|
77
77
|
def Name(self, Value: AnyStr):
|
|
78
|
-
|
|
79
|
-
Value = Value.encode(self._api_util.codec)
|
|
80
|
-
|
|
81
|
-
self._check_for_error(self._lib.ActiveClass_Set_Name(Value))
|
|
78
|
+
self._lib.ActiveClass_Set_Name(Value)
|
|
82
79
|
|
|
83
80
|
@property
|
|
84
81
|
def Next(self) -> int:
|
|
@@ -90,7 +87,7 @@ class IActiveClass(Base):
|
|
|
90
87
|
|
|
91
88
|
Original COM help: https://opendss.epri.com/Next.html
|
|
92
89
|
'''
|
|
93
|
-
return self.
|
|
90
|
+
return self._lib.ActiveClass_Get_Next()
|
|
94
91
|
|
|
95
92
|
@property
|
|
96
93
|
def NumElements(self) -> int:
|
|
@@ -99,7 +96,7 @@ class IActiveClass(Base):
|
|
|
99
96
|
|
|
100
97
|
Original COM help: https://opendss.epri.com/NumElements.html
|
|
101
98
|
'''
|
|
102
|
-
return self.
|
|
99
|
+
return self._lib.ActiveClass_Get_NumElements()
|
|
103
100
|
|
|
104
101
|
@property
|
|
105
102
|
def ActiveClassParent(self) -> str:
|
|
@@ -108,7 +105,7 @@ class IActiveClass(Base):
|
|
|
108
105
|
|
|
109
106
|
Original COM help: https://opendss.epri.com/ActiveClassParent.html
|
|
110
107
|
'''
|
|
111
|
-
return self.
|
|
108
|
+
return self._lib.ActiveClass_Get_ActiveClassParent()
|
|
112
109
|
|
|
113
110
|
def ToJSON(self, options: DSSJSONFlags = 0) -> str:
|
|
114
111
|
'''
|
|
@@ -121,4 +118,17 @@ class IActiveClass(Base):
|
|
|
121
118
|
|
|
122
119
|
**(API Extension)**
|
|
123
120
|
'''
|
|
124
|
-
return self.
|
|
121
|
+
return self._lib.ActiveClass_ToJSON(options)
|
|
122
|
+
|
|
123
|
+
def to_altdss(self) -> Optional[DSSObject]:
|
|
124
|
+
'''
|
|
125
|
+
Returns a Python object for the current active DSS object in this interface.
|
|
126
|
+
|
|
127
|
+
Requires AltDSS-Python.
|
|
128
|
+
|
|
129
|
+
*Available only for the AltDSS engine.*
|
|
130
|
+
|
|
131
|
+
**(API Extension)**
|
|
132
|
+
'''
|
|
133
|
+
ptr = self._lib.ActiveClass_Get_Pointer()
|
|
134
|
+
return self._api_util.get_dss_obj(ptr)
|