Skip to content

DSS-Python 0.15.7

Latest
Compare
Choose a tag to compare
@PMeira PMeira released this 29 Mar 06:25
· 2 commits to master since this release

DSS-Python 0.15.7 is a minor bugfix release that integrates a fix in the DSS engine for the LineGeometries API:

  • Address issue with the classic LineGeometries API. Instead of using the number of input conductors, the API was using the number of effective conductors if reduce=yes. Now it returns all the conductors.

An upcoming release is expected for the next week, including support for the official OpenDSSDirect.DLL on Windows, within its limitations (in terms of API, features and platforms, for the moment).


Since DSS-Python targets closer compatibility with code written using the official OpenDSS COM interface in Python, some extra features that initially were expected to land on OpenDSSDirect.py have now been published under this new package, AltDSS-Python. Check its site for the motivation, examples, and API reference.

❓ What's this?

DSS-Python is a Python package that provides access to the DSS-Extensions engine, using DSS C-API and CFFI. This engine is a customized port of the Windows/Delphi code to Free Pascal, including several quality-of-life improvements for Python users. DSS-Python tries to provide a drop-in replacement from the official OpenDSS COM API, while adding some features/extensions. It is also the underlying package used by OpenDSSDirect.py since 2018. If you are new to DSS-Extensions, see our FAQ here, as well as general documentation in the main website.

Version 0.15.6 has been released on the official Python package repository (PyPI). Since version 0.14.0, the main DSS-Python package is pure Python, but relies on the new dss-python-backend to allow us easier iteration on Python features. The backend package is available for Windows, macOS and Linux. This release includes support for Intel x86 and x86-64, ARM platforms, including Apple's M1 and later.

Please feel free to open issues on GitHub or post on https://github.com/orgs/dss-extensions/discussions

Note: Although the majority of features are ported frequently from the official OpenDSS and validated with a large suite of tests, this is not supported by EPRI.

The main differences in behavior compared to the official OpenDSS implementation are listed in https://github.com/dss-extensions/dss_capi/blob/master/docs/known_differences.md

Some of the tests can also serve as examples of some features. For example, see test_general.py/test_threading2 for an example of how to use DSSContexts and Python threads.

ℹ️ Recent news

The DSS-Python documentation and examples have also been updated, and will be better integrated into the new DSS-Extensions site soon, which does contain shared documentation, including DSS language/data model reference and notes about the classic OpenDSS API (based on the original COM implementation).

Other highlights in the v0.15.x: there are new functions to save the circuit which customized flags, and the work-in-progress JSON implementation now allows both saving and loading whole circuits.

Installation

For a minimal install, use :

pip install dss-python==0.15.7

To install all recommended packages, including OpenDSSDirect.py, AltDSS, matplotlib (to allow enabling plotting from DSS scripts) and pandas:

pip install dss-python[all]==0.15.7

In a typical Python environment, users will most likely have both matplotlib and pandas already installed.

❓AltDSS-Python

Like OpenDSSDirect.py, AltDSS-Python can also be used together with DSS-Python. Since multiple DSS engines are supported, there are utility functions to map across the packages. AltDSS-Python, or just AltDSS in this context, uses a whole different paradigm from the older Python packages, moving away from the "Active..." paradigm. The new AltDSS includes integration to all OpenDSS object types (access, creation, manipulation, all directly in Python), exposed as Python objects, and also allows using batches of DSS objects to accelerate some operations that would be otherwise slow in Python, pushing many operations to the engine, ranging from collected results for multiple objects, to efficient use of DSS properties. For example, bulk updating (incrementing/decrementing/multiplying/etc.) an int or float property for thousands of elements doesn't require copying the data and is done directly in the engine, after the input data for the operation is prepared in Python.

Engine updates

As usual, there have been a lot of changes our OpenDSS engine, AltDSS/DSS C-API. See https://github.com/dss-extensions/dss_capi/blob/master/docs/changelog.md#versions-014x for the complete changes since the last announced release here on GitHub. There are a few specific bugfixes, ports from the official OpenDSS, besides the on-going refactoring of the whole codebase.