You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,26 +1,25 @@
1
-
# dss_python: Unofficial bindings for EPRI's OpenDSS
1
+
# DSS Python: Unofficial bindings for EPRI's OpenDSS
2
2
3
-
Python bindings and misc tools for using OpenDSS (EPRI Distribution System Simulator). Based on CFFI and `dss_capi`, aiming for full COM compatibility on Windows, Linux and MacOS.
3
+
Python bindings and misc tools for using OpenDSS (EPRI Distribution System Simulator). Based on CFFI and DSS C-API, aiming for full COM compatibility on Windows, Linux and MacOS.
4
4
5
5
<palign="center">
6
6
<img alt="Overview of related repositories" src="https://raw.githubusercontent.com/PMeira/dss_python/master/docs/images/repomap.svg?sanitize=true" width=600>
7
7
</p>
8
8
9
-
If you are looking for the custom OpenDSS C-API library, see [`dss_capi`](http://github.com/PMeira/dss_capi/).
9
+
If you are looking for the custom OpenDSS C-API library, see [`DSS C-API`](http://github.com/PMeira/dss_capi/).
10
10
11
-
Version 0.10.0 (**unreleased**), based on OpenDSS revision 2246. For version 0.9.8, see [here](https://github.com/PMeira/dss_python/tree/0.9.8).
12
-
This is a work-in-progress but it's deemed stable enough to be made public. The main goal of creating a COM-compatible API was reached!
11
+
Version 0.10.0, based on OpenDSS revision 2395. While we plan to add a lot more funcionality into DSS Python, the main goal of creating a COM-compatible API has been reached.
13
12
14
13
This module mimics the COM structure (as exposed via `win32com` or `comtypes`), effectively enabling multi-platform compatibility at Python level.
15
14
Most of the COM documentation can be used as-is, but instead of returning tuples or lists, this modules returns/accepts NumPy arrays for numeric data exchange.
16
15
17
16
The module depends on CFFI, NumPy and, optionally, SciPy.Sparse for reading the sparse system admittance matrix.
18
17
19
-
If you are not bound to the COM API and its quirks, you might be insterested in OpenDSSDirect.py. [OpenDSSDirect.py](https://github.com/NREL/OpenDSSDirect.py/) exposes a more Pythonic API and contains extra utilities. Thanks to @kdheepak, OpenDSSDirect.py v0.3+ uses dss_python's backend -- this means you can use both modules at once. For example, if you have old code using the official COM objects, you could quickly switch to dss_python with very few code changes, and then use [`opendssdirect.utils`](https://nrel.github.io/OpenDSSDirect.py/opendssdirect.html#module-opendssdirect.utils) to generate some DataFrames.
18
+
If you are not bound to the COM API and its quirks, you might be insterested in OpenDSSDirect.py. [OpenDSSDirect.py](https://github.com/NREL/OpenDSSDirect.py/) exposes a more Pythonic API and contains extra utilities. Thanks to @kdheepak, OpenDSSDirect.py v0.3+ uses DSS Python's backend -- this means you can use both modules at once. For example, if you have old code using the official COM objects, you could quickly switch to DSS Python with very few code changes, and then use [`opendssdirect.utils`](https://nrel.github.io/OpenDSSDirect.py/opendssdirect.html#module-opendssdirect.utils) to generate some DataFrames.
20
19
21
20
## Recent changes
22
21
23
-
- version 0.10.0**(WIP)**: Introduce a faster but less compatible module and add optional warnings for the traditional version (e.g. warn when using `DSS.activecircuit` instead of `DSS.ActiveCircuit`).
22
+
-2018-11-17 / version 0.10.0: Lots of changes, fixes and new features. Check the new [changelog](docs/changelog.md) document for a list.
24
23
- 2018-08-12 / version 0.9.8: Reorganize modules (v7 and v8), adds 8 missing methods and new backend methods for OpenDSSDirect.py v0.3+. Integrates many fixes from DSS_CAPI and the upstream OpenDSS.
25
24
- 2018-04-30 / version 0.9.7: Fix some of the setters that used array data.
26
25
- 2018-04-05 / version 0.9.6: Adds missing `ActiveCircuit.CktElements[index]` (or `...CktElements(index)`) and `ActiveCircuit.Buses[index]` (or `...Buses(index)`).
Assuming you successfully built or downloaded the `dss_capi` (check [its repository](http://github.com/PMeira/dss_capi/) for instructions), keep the folder organization as follows:
74
+
Assuming you successfully built or downloaded the DSS C-API DLLs (check [its repository](http://github.com/PMeira/dss_capi/) for instructions), keep the folder organization as follows:
76
75
77
76
```
78
77
dss_capi/
@@ -87,6 +86,8 @@ python setup.py build
87
86
python setup.py install
88
87
```
89
88
89
+
If you are familiar with `conda-build`, there is a complete recipe to build DSS C-API, KLUSolve and DSS Python in the `conda` subfolder.
90
+
90
91
Example usage
91
92
=============
92
93
@@ -126,26 +127,25 @@ for i in range(len(voltages) // 2):
If you do not need the mixed-cased handling, you can omit the call to `use_com_compat()` and use the casing used in this project.
130
-
130
+
If you do not need the mixed-cased handling, omit the call to `use_com_compat()` and use the casing used in this project, which should make most of the COM instance conventions.
131
131
132
132
If you want to play with the experimental OpenDSS-PM interface (from OpenDSS v8), it is installed side-by-side and you can import it as:
133
133
134
134
```
135
135
import dss.v8
136
-
dss.v8.use_com_compat()
137
136
dss_engine = dss.v8.DSS
138
137
```
139
138
140
-
*All validation tests succeed with `dss.v8` but beware those don't include parallel machine tests yet!*
139
+
Although it is experimental, most of its funcionality is working. Depending on your use-case, the parallel interface can be an easy way of better using your machine resources. Otherwise, you can always use general distributed computing resources via Python.
140
+
141
141
142
142
Testing
143
143
=======
144
144
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 the official OpenDSS distribution. The only modifications are done directly by the script, removing interactive features and some other minor issues.
145
145
146
146
The validation scripts is `tests/validation.py` and requires the same folder structure as the building process. You need `win32com` to run it.
147
147
148
-
Currently, the following sample files from the official OpenDSS repository are used:
148
+
Currently, at least the following sample files from the official OpenDSS repository are used:
149
149
150
150
```
151
151
Distrib/EPRITestCircuits/ckt5/Master_ckt5.dss
@@ -192,7 +192,7 @@ Currently, the following sample files from the official OpenDSS repository are u
192
192
193
193
On Windows 10, remember to set the compatibility layer to Windows 7 (set the environment variable `__COMPAT_LAYER=WIN7RTM`), otherwise you may encounter issues with COM due to [ASLR](https://en.wikipedia.org/wiki/Address_space_layout_randomization) on Python 3.6+.
194
194
195
-
There is no validation on Linux yet since we cannot run the COM module there. The most likely solution will be to pickle the data on Windows and load them on Linux.
195
+
There is no full validation on Linux yet since we cannot run the COM module there. There is an ongoing effort on pickling the data on Windows and loading on Linux for comparison (for the full test suite, it results in 8+GB of data and can be time-consuming).
196
196
197
197
Roadmap
198
198
=======
@@ -209,7 +209,7 @@ Please allow me a few days to respond.
209
209
210
210
Credits / Acknowlegement
211
211
========================
212
-
`dss_python` is based on EPRI's OpenDSS via the [`dss_capi`](http://github.com/PMeira/dss_capi/) project, check its licensing information.
212
+
DSS Python is based on EPRI's OpenDSS via the [`dss_capi`](http://github.com/PMeira/dss_capi/) project, check its licensing information.
213
213
214
214
This project is licensed under the (new) BSD, available in the `LICENSE` file. It's the same license OpenDSS uses (`OPENDSS_LICENSE`). OpenDSS itself uses KLUSolve and SuiteSparse, licensed under the GNU LGPL 2.1.
0 commit comments