Releases: dss-extensions/DSS-Python
DSS Python 0.10.7-1
On 2021-03-09, version 0.10.7-1 has been released on the official Python package repository (PyPI) for Windows, macOS and Linux. For Anaconda cloud (channel dss-extensions), packages are available for macOS and Linux.
Note: Although the majority of features are ported frequently from the official OpenDSS and validated with a large suite of tests, this is not an official EPRI project.
The main differences in behavior compared to the official OpenDSS are listed in https://github.com/dss-extensions/dss_capi/blob/0.10.x/docs/known_differences.md
This release includes a correction to an issue with energy meter reports.
Installation
Using pip (Python versions: 3.5 to 3.9):
pip install dss_python==0.10.7-1
Or install it with conda (available for Python versions 3.5 to 3.9 for macOS and Linux, and 3.6 to 3.9 on Windows x64):
conda install -c dss-extensions dss_python=0.10.7.post1
Recent changes
Changes in 0.10.7-1
- Correct issue with energy meter reports.
Changes in 0.10.7, since 0.10.6
Check the changelog document for a detailed list for all releases.
- Maintenance release.
- Updated to DSS C-API 0.10.7, which includes most changes up to OpenDSS v9.1.3.4.
- Includes an important bug fix related to the
CapRadius
DSS property. If your DSS scripts included the patternGMRac=... rad=...
orGMRac=... diam=...
(in this order and without specifyingCapRadius
), you should upgrade and re-evaluate the results. - New API properties ported from the official COM interface:
Bus.AllPCEatBus
,Bus.AllPDEatBus
,CktElement.TotalPowers
,Meters.ZonePCE
DSS C-API 0.10.7 changes:
- Simple maintenance release, which includes most changes up to OpenDSS v9.1.3.4 (revision 2963).
- Includes an important bug fix related to the
CapRadius
DSS property. If your DSS scripts included the patternGMRac=... rad=...
orGMRac=... diam=...
(in this order and without specifyingCapRadius
), you should upgrade and re-evaluate the results. - This version should be fully API compatible with 0.10.3+.
- A reference document listing the DSS commands and properties for all DSS elements is now available at https://github.com/dss-extensions/dss_capi/blob/0.10.x/docs/dss_properties.md
- New functions API ported from the official OpenDSS include:
Bus_Get_AllPCEatBus
,Bus_Get_AllPDEatBus
,CktElement_Get_TotalPowers
,Meters_Get_ZonePCE
. - The changes ported from the official OpenDSS include the following (check the repository for more details):
- "Adds LineType property to LineCode and LineGeometry objects."
- "Correcting bug found in storage device when operating in idling mode. It was preventing the solution of other test feeders (IEEE 9500)"
- "Enabling fuel option for generator, fixing bug found in TotalPower command."
- "Adding kvar compensation calculation for normalizing reactive power at feeder head. v 9.1.2.4"
- "Adding: - Line type variable to line definition. - AllPCEatBus and AllPDEatBus commands to the executive command set. - AllPCEatBus and AllPDEatBus commands to bus interface in COM/DLL. (...)"
- "Adding capability to energy meter for getting the list of all PCE (shunt) within a zone. Interface "AllPCEatZone" for COM/DLL created."
- "Fixing bug found when calculating voltage bases with large amount of numbers (large array)."
Reminder: mixed-case handling
If you were using use_com_compat
to allow mixed-cased attributes, it should work better than before. You may now use use_com_compat(warn=True)
to warn when you use an attribute that wouldn't exist without calling use_com_compat
. The intention is that the user should run their code to get a list of warnings, fix it, and then remove use_com_compat
since it does have a small performance impact.
DSS_Python 0.10.7
On 2020-12-29, version 0.10.7 has been released on the official Python package repository (PyPI) for Windows, macOS and Linux. For Anaconda cloud (channel PMeira), packages are available for macOS and Linux.
Note: Although the majority of features are ported frequently from the official OpenDSS and validated with a large suite of tests, this is not an official EPRI project.
The main differences in behavior compared to the official OpenDSS are listed in https://github.com/dss-extensions/dss_capi/blob/0.10.x/docs/known_differences.md
This release includes bugfixes and new features, among them:
- Bug fix related to the
CapRadius
DSS property. If your DSS scripts included the patternGMRac=... rad=...
orGMRac=... diam=...
(in this order and without specifyingCapRadius
), you should upgrade and re-evaluate the results. The issue also affect the official OpenDSS package. - Support for Python 3.9. Also note that Python 2.7 was dropped as planned.
Installation
Using pip (Python versions: 3.5 to 3.9):
pip install dss_python==0.10.7
Or install it with conda (available for Python versions 3.5 to 3.9 for macOS and Linux, and 3.6 to 3.9 on Windows x64):
conda install -c dss-extensions dss_python
EDIT: moved to the dss-extensions conda channel and readded Windows builds.
Recent changes
Changes in 0.10.7, since 0.10.6
Check the changelog document for a detailed list for all releases.
- Maintenance release.
- Updated to DSS C-API 0.10.7, which includes most changes up to OpenDSS v9.1.3.4.
- Includes an important bug fix related to the
CapRadius
DSS property. If your DSS scripts included the patternGMRac=... rad=...
orGMRac=... diam=...
(in this order and without specifyingCapRadius
), you should upgrade and re-evaluate the results. - New API properties ported from the official COM interface:
Bus.AllPCEatBus
,Bus.AllPDEatBus
,CktElement.TotalPowers
,Meters.ZonePCE
DSS C-API 0.10.7 changes:
- Simple maintenance release, which includes most changes up to OpenDSS v9.1.3.4 (revision 2963).
- Includes an important bug fix related to the
CapRadius
DSS property. If your DSS scripts included the patternGMRac=... rad=...
orGMRac=... diam=...
(in this order and without specifyingCapRadius
), you should upgrade and re-evaluate the results. - This version should be fully API compatible with 0.10.3+.
- A reference document listing the DSS commands and properties for all DSS elements is now available at https://github.com/dss-extensions/dss_capi/blob/0.10.x/docs/dss_properties.md
- New functions API ported from the official OpenDSS include:
Bus_Get_AllPCEatBus
,Bus_Get_AllPDEatBus
,CktElement_Get_TotalPowers
,Meters_Get_ZonePCE
. - The changes ported from the official OpenDSS include the following (check the repository for more details):
- "Adds LineType property to LineCode and LineGeometry objects."
- "Correcting bug found in storage device when operating in idling mode. It was preventing the solution of other test feeders (IEEE 9500)"
- "Enabling fuel option for generator, fixing bug found in TotalPower command."
- "Adding kvar compensation calculation for normalizing reactive power at feeder head. v 9.1.2.4"
- "Adding: - Line type variable to line definition. - AllPCEatBus and AllPDEatBus commands to the executive command set. - AllPCEatBus and AllPDEatBus commands to bus interface in COM/DLL. (...)"
- "Adding capability to energy meter for getting the list of all PCE (shunt) within a zone. Interface "AllPCEatZone" for COM/DLL created."
- "Fixing bug found when calculating voltage bases with large amount of numbers (large array)."
Reminder: mixed-case handling
If you were using use_com_compat
to allow mixed-cased attributes, it should work better than before. You may now use use_com_compat(warn=True)
to warn when you use an attribute that wouldn't exist without calling use_com_compat
. The intention is that the user should run their code to get a list of warnings, fix it, and then remove use_com_compat
since it does have a small performance impact.
DSS_Python 0.10.6
On 2020-07-31, version 0.10.6 has been released on the official Python package repository (PyPI) for Windows, macOS and Linux. For Anaconda cloud (channel PMeira), packages are available for macOS and Linux.
Note: Although the majority of features are ported frequently from the official OpenDSS and validated with a large suite of tests, this is not an official EPRI project.
The main differences in behavior compared to the official OpenDSS are listed in https://github.com/dss-extensions/dss_capi/blob/0.10.x/docs/known_differences.md
Installation
Using pip (Python versions: 2.7, 3.5 to 3.8):
pip install dss_python
Or install it with conda (available for Python versions 3.5 to 3.8 for macOS and Linux):
conda install -c pmeira dss_python
Recent changes
Changes in 0.10.6, since 0.10.5
Check the changelog document for a detailed list for all releases.
- Updated to DSS C-API 0.10.6, which includes most changes up to OpenDSS v9.0.0.3.
- Debug builds of DSS C-API are now included. See the Debugging document.
- New
DSS.LegacyModels
: allow using the legacy/deprecated models forPVsystem
,Storage
,InvControl
, andStorageController
. - New
DSS.Error.ExtendedErrors
: controls if the new extended error messages are used. - Many new properties and functions in
DSS.ActiveCircuit.PDElements
. - Now most of the low-level API calls are checked, mapping the errors from the
DSS.Error
interface to Python exceptions more frequently.
DSS C-API 0.10.6 changes:
- This version should be fully API compatible with 0.10.3+. The behavior of some functions changed with the new extensions. Especially, empty strings are explicitly return as nulls instead of "\0". This conforms to the behavior already seen in arrays of strings.
- The binary releases now use Free Pascal 3.2.0. We observed the solution process is around 6% faster, and results are even closer to the official OpenDSS.
- The releases now include both the optimized/default binary and a non-optimized/debug version. See the Debugging document for more.
- Extended API validation and Extended Errors mechanism:
- The whole API was reviewed to add basic checks for active circuit and element access.
- By default, invalid accesses now result in errors reported through the Error interface. This can be disabled to achieve the previous behavior, more compatible with the official COM implementation -- that is, ignore the error, just return a default/invalid value and assume the user has handled it.
- The mechanism can be toggled by API functions
DSS_Set_ExtendedErrors
andDSS_Get_ExtendedErrors
, or environment variableDSS_CAPI_EXTENDED_ERRORS=0
to disable (defaults to enabled state).
- New Legacy Models mechanism:
- OpenDSS 9.0+ dropped the old
PVsystem
,Storage
,InvControl
, andStorageController
models, replacing with the new versions previously known asPVsystem2
,Storage2
,InvControl2
andStorageController2
. - The behavior and parameters from the new models are different -- they are better, more complete and versatile models. Check the official OpenDSS docs and examples for further information.
- The implementation of the new models in DSS C-API was validated successfully with all test cases available. As such, we mirror the decision to make them the default models.
- As an extension, we implemented the Legacy Models option. By toggling it, a
clear
command will be issued and the alternative models will be loaded. This should allow users to migrate to the new version but, if something that used to work with the old models stopped working somehow, the user can toggle the old models. The idea is to keep reproducibility of results while we keep updating the engine and the API. - Since EPRI dropped/deprecated the old models, we might drop them too, in a future release. Please open an issue on GitHub or send a message if those old models are important to you.
- The mechanism can be controlled by API functions
DSS_Set_LegacyModels
andDSS_Get_LegacyModels
, or environment variableDSS_CAPI_LEGACY_MODELS=1
to enable (defaults to disabled state).
- OpenDSS 9.0+ dropped the old
- WireData API: expose the
CapRadius
property as a new pair of functions. - PDElements API: extended with many batch functions exposing equivalents to some CSV reports:
AllNames
,AllMaxCurrents
,AllPctNorm
,AllPctEmerg
,AllCurrents
,AllCurrentsMagAng
,AllCplxSeqCurrents
,AllSeqCurrents
,AllPowers
,AllSeqPowers
,AllNumPhases
,AllNumConductors
,AllNumTerminals
. CktElement_Get_SeqPowers
: fix issue for positive sequence circuits (wrong results could corrupt memory).- Many API functions were optimized to avoid unnecessary allocations and copies.
- Some bugs found in DSS C-API and also reported upstream (already fixed in SVN):
CapRadius
DSS property: if the radius was initialized usingGMRac
,CapRadius
was left uninitialized, resulting in invalid/NaN values.Sensors
API: some functions edited capacitors instead of sensors.
- Updated to the official OpenDSS revision 2903, corresponding to versions 9.0.0+. Changes include:
- ExportCIMXML: updated.
- Relay: Fix in
GetPropertyValue
. - Line: In
DumpProperties
andMakePosSequence
, the length is handled differently for lines withLineGeometry
orLineSpacing
. - Bus API: new
LineList
,LoadList
functions. - Lines API: SeasonRating now returns NormAmps if there's no SeasonSignal.
- New command DSS
Zsc012
: "Returns symmetrical component short circuit impedances Z0, Z1, and Z2 for the ACTIVE 3-PHASE BUS. Determined from Zsc matrix." PVsystem2
,Storage2
,InvControl2
,StorageController2
updated and renamed.
Reminder: mixed-case handling
If you were using use_com_compat
to allow mixed-cased attributes, it should work better than before. You may now use use_com_compat(warn=True)
to warn when you use an attribute that wouldn't exist without calling use_com_compat
. The intention is that the user should run their code to get a list of warnings, fix it, and then remove use_com_compat
since it does have a small performance impact.
DSS Python 0.10.5
On 2020-03-03, version 0.10.5 has been released on the official Python package repository (PyPI) for Windows, macOS and Linux. For Anaconda cloud (channel PMeira), packages are available for macOS and Linux.
Note: back on 2019-11-16, version 0.10.4 was not announced on GitHub but it was properly released on PyPI
Installation
Using pip (Python versions: 2.7, 3.5 to 3.8):
pip install dss_python
Or install it with conda (available for Python versions 3.5, 3.6, 3.7 for macOS and Linux):
conda install -c pmeira dss_python
Relevant changes
This is a maintenance release.
- Updated to DSS C-API 0.10.5, which includes most changes up to OpenDSS v8.6.7.1. Includes new properties and new experimental components (under testing).
- New properties exposed:
ActiveClass.ActiveClassParent
,PVSystems.Pmpp
,PVSystems.IrradianceNow
. - For the time being,
dss.v8
doesn't use the parallel-machine version anymore. This will be addressed in a future release, most likely in the 0.11.x series coming in the following months.
DSS C-API 0.10.5 changes:
- Disable builds and distribution of v8-only variation -- the extra/missing parallel-machine will be completely merged in a mixed (v7+v8) codebase in the coming months.
- This version should be fully API compatible with 0.10.3+.
Bus
andCktElement
API functions reworked with some more checks.- Updated up to revision 2837 of the official OpenDSS code:
- Ported changes from SVN (v7 and v8) into DSS C-API v7 variation (v8 was left untouched).
- 4 new API level functions (
ActiveClass_Get_ActiveClassParent
,PVSystems_Get_Pmpp
,PVSystems_Set_Pmpp
,PVSystems_Get_IrradianceNow
) - 4 new components:
PVsystem2
,Storage2
,InvControl2
,StorageController2
-- added for early testing, no dedicated API functions yet. At the moment, please consider them experimental features subject to change. CIM100
: several changesExpControl
: newTresponse
propertyConductorData
,LineConstants
,LineGeometry
: newCapradius
propertyXfmrCode
,Transformer
: new Seasons and Ratings propertiesBus_Get_puVLL
andBus_Get_VLL
-- see revision 2836 (official SVN). Included an extra fix in DSS C-API to avoid some corner cases.- Other small bug fixes like the Full Carson fix -- see https://sourceforge.net/p/electricdss/discussion/861976/thread/2de01d0cdb/ and revision 2805 (official SVN)
Check the full changelog for DSS C-API at https://github.com/dss-extensions/dss_capi/blob/master/docs/changelog.md#version-0105
The main differences in behavior compared to the official OpenDSS are listed in https://github.com/dss-extensions/dss_capi/blob/0.10.x/docs/known_differences.md
Reminder: mixed-case handling
If you were using use_com_compat
to allow mixed-cased attributes, it should work better than before. You may now use use_com_compat(warn=True)
to warn when you use an attribute that wouldn't exist without calling use_com_compat
. The intention is that the user should run their code to get a list of warnings, fix it, and then remove use_com_compat
since it does have a small performance impact.
DSS Python 0.10.3
Version 0.10.3 has been released on the official Python package repository (PyPI) and Anaconda cloud (channel PMeira) on 2019-05-22.
This is the last release to provide pre-built binaries for Python 3.4.
Installation
Install it with conda (available for Python versions 3.5, 3.6, 3.7 for all platforms, 2.7 also included for Windows):
conda install -c pmeira dss_python
Or using pip (Python versions: 2.7, 3.4, 3.5, 3.6, 3.7):
pip install dss_python
Relevant changes
From the changelog:
- Includes fix for issue with the line parameters on Linux and macOS due to memory-address aliasing issues.
- Prebuilt binaries for DSS C-API and KLUSolve are used instead of rebuilding everything from source.
- Prebuilt packages (wheels) for 32-bit Linux are now available.
- Development artifacts are now included in the distribution package. This enables advanced usage and easier integration with compiled languages (examples pending, please open an issue if you'd like to know more).
ReduceCkt
ported from COM: new circuit reduction methods available inDSS.ActiveCircuit.ReduceCkt
Lines
: ported from COM, new seasonal ratings mechanism that allows changing the current rating through the simulation- Optimization and extended error-checking in many properties
- Includes new
Settings.LoadsTerminalCheck
: on static scenarios (no open terminals for loads) to toggle the costly checks for open terminals. If set to false, it can save around 25% of simulation time, depending on the circuit characteristics. - All components now can be accessed by index (
idx
property) - All components now have faster
Name
iteration - Ported to v7/default interface: the DSS commands
CalcIncMatrix
,CalcIncMatrix_O
,Refine_BusLevels
,CalcLaplacian
, and related export options:IncMatrix
,IncMatrixRows
,IncMatrixCols
,BusLevels
,Laplacian
,ZLL
,ZCC
,Contours
,Y4
. Also includes related Python-level properties. - Some other new properties:
CktElement.IsIsolated
Lines.IsSwitch
Transformers.LossesByType
andTransformers.AllLossesByType
Also check the changelog for DSS C-API at https://github.com/dss-extensions/dss_capi/blob/master/docs/changelog.md#version-0103
Reminder: mixed-case handling
If you were using use_com_compat
to allow mixed-cased attributes, it should work better than before. You may now use use_com_compat(warn=True)
to warn when you use an attribute that wouldn't exist without calling use_com_compat
. The intention is that the user should run their code to get a list of warnings, fix it, and then remove use_com_compat
since it does have a small performance impact.
DSS Python 0.10.2
This is an incremental release to address a couple of issues.
DSS Python has recently moved from https://github.com/PMeira/dss_python/ to https://github.com/dss-extensions/dss_python/
Relevant changes:
CtrlQueue
: Add the missing functionPush
.- New
DSS.AllowEditor
: this new property controls if the external editor is called on DSS commands likeShow
. If set toFalse
, the editor is not called, but other side effects should not be affected (e.g. files can be created). - The
enum34
module was added as a dependency for Python < 3.5. This allowed us to make thedss.enums
module better and will be the base for future development using enumerations. - The
Options
enumeration was split into several new enumerations (AutoAddTypes
,CktModels
,ControlModes
,SolutionLoadModels
,SolutionAlgorithms
,RandomModes
). It is now marked as deprecated for future removal. LoadShapes
are faster due to changes from DSS C-API.
Reminder: mixed-case handling
If you were using use_com_compat
to allow mixed-cased attributes, it should work better than before. You may now use use_com_compat(warn=True)
to warn when you use an attribute that wouldn't exist without calling use_com_compat
. The intention is that the user should run their code to get a list of warnings, fix it, and then remove use_com_compat
since it does have a small performance impact.
Installation
Install it with conda (available for Python versions 3.5, 3.6, 3.7 for all platforms, 2.7 also included for Windows):
conda install -c pmeira dss_python=0.10.2
Or using pip (Python versions: 2.7, 3.4, 3.5, 3.6, 3.7):
pip install dss_python==0.10.2
DSS Python 0.10.1
This is a minor DSS Python release that contains lots of changes from DSS C-API. See the changes from DSS C-API for details, including changes from the official OpenDSS code since 0.10.0.
DSS Python has recently moved from https://github.com/PMeira/dss_python/ to https://github.com/dss-extensions/dss_python/
Major changes:
- More and faster error-checking! Python exception will be raised for more errors and with a lower overhead.
- Fix for
YMatrix.getI
andYMatrix.getV
(ported from OpenDSSDirect.py) - Fix for
ActiveCircuit.ActiveCktElement.Variable
andActiveCircuit.ActiveCktElement.Variablei
: now returns a tuple of(value, errorcode)
, compatible with COM. - New
DSS.Error.EarlyAbort
: controls whether all errors halts the DSS script processing (Compile/Redirect), defaults to True.
Reminder: mixed-case handling
If you were using use_com_compat
to allow mixed-cased attributes, it should work better than before. You may now use use_com_compat(warn=True)
to warn when you use an attribute that wouldn't exist without calling use_com_compat
. The intention is that the user should run their code to get a list of warnings, fix it, and then remove use_com_compat
since it does have a small performance impact.
Installation
Install it with conda:
conda install -c pmeira dss_python=0.10.1
Or via pip:
pip install dss_python==0.10.1
DSS Python 0.10.0
Major changes
- The creation of the binary modules has been automated using Travis-CI and AppVeyor. We expect that this will allow us to release more often, bringing new features sooner.
- Integrates many fixes from the upstream OpenDSS and changes specific to DSS C-API.
- Reorganizes and reuses the code across DSS versions (v7 and v8)
- Uses
__slots__
to simplify attribute handling. - Exposes both the our classic API (e.g.
dss.v7.DSS_IR
for the immediate/direct results) and global result API (e.g.dss.v7.DSS_GR
for the global result interface). See DSS C-API's docs for a detailed explanation. We default to the GR interface since it will generally be faster at the cost of a small memory overhead. - Although still experimental, the v8/PM module is more stable. If you try it, please give feedback.
- Error checking is now done for most API writes. That is, if an OpenDSS error occurs, it should cause a Python exception soon after. Previously, you need to call
CheckForError()
manually to trigger this. This change was introduced after user reports indicated that manually checking for errors is a common behavior. - Expose API extensions for the classes
LineGeometry
,WireData
,LineSpacing
,CNData
,TSData
,Reactor
. - Make most DSS classes iterable (including buses), e.g. you can now use:
for l in DSS.ActiveCircuit.Loads:
print(l.Name)
- Add a COM patching function (
dss.patch_dss_com
) -- that is, extend the COM instance with iterators like above and some other few functions to make it easier to exchange between COM and DSS Python:
import win32com.client, dss
com = dss.patch_dss_com(win32com.client.gencache.EnsureDispatch("OpenDSSEngine.DSS"))
# ...compile a circuit, etc.
for l in com.ActiveCircuit.Loads:
print(l.Name, l.kva)
for b in com.ActiveCircuit.ActiveBus:
print(b.Name, b.x, b.y)
Performance
On microbenchmarks, the GR interface can reduce the running time up to 50% (typically 25%) on properties that return arrays. If you find issues using the default GR interface, you can always use the classic interface from 0.9.8 by importing the appropriate module: from dss import DSS_IR as DSS
. Currently, the GR changes do not affect writing data (setting properties), only reading them.
Mixed-case handling
If you were using use_com_compat
to allow mixed-cased attributes, it should work better than before. You may now use use_com_compat(warn=True)
to warn when you use an attribute that wouldn't exist without calling use_com_compat
. The intention is that the user should run their code to get a list of warnings, fix it, and then remove use_com_compat
since it does have a small performance impact.
Installation
Install it with conda:
conda install -c pmeira dss_python=0.10.0
Or via pip:
pip install dss_python==0.10.0
dss_python 0.9.8: Wheels for multiple platforms
This version introduces a few changes and general bugfixes:
- Based on OpenDSS revision 2246,
dss_capi
0.9.8 and matchingelectricdss-src
. Integrates many fixes. - A major reorganization of modules (
main
becamev7
,pm
becamev8
). - Build system for
dss_python
anddss_capi
changed to allow some automated builds. This will be revisited in the future for further support. - KLUSolve built from source on all platforms. On Windows, MSVC2017 is used for all versions and on Python 2.7 you may need its runtime (x64, x86)
- Adds 8 missing methods.
- New backend methods for OpenDSSDirect.py v0.3+.
- Provides binary wheels on PyPI for MacOS (10.7), Linux (manylinux , hopefully widely compatible), and Windows. Besides the previous 64-bit build, binary wheels for Windows 32-bit are also available!
You can now install on most platforms using:
pip install dss_python==0.9.8
We also hope to upload conda packages soon. When that happens, this text and the main README.md will be updated to reflect it.
Anaconda packages are also available, you can now use conda to install it:
conda install -c pmeira dss_python
Starting in version 0.9.8, we disabled the opendsscmd.ini creation. You can set the default base frequency using the environment variable DSS_BASE_FREQUENCY, or just set it in the DSS scripts (recommended). This also means that the initial datapath is set to the current working directory. When running multiple instances in parallel, the way the configuration file was handled could introduced unexpected behavior.
0.9.7: Fix issue with some setters
This release includes a minor fix to make array setters work correctly.
As always, if you are using Windows (64-bit only), you can install the wheels available on the official Python package index:
pip install dss_python==0.9.7