Skip to content

Commit df59d53

Browse files
committed
Prepare 0.10.7rc1 (code, changelog, tests)
1 parent 95ddb8f commit df59d53

File tree

10 files changed

+72
-55
lines changed

10 files changed

+72
-55
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ matrix:
77
sudo: required
88
env:
99
- DOCKER_IMAGE=pmeira/manylinux_wheel_cmake_fpc
10-
- DSS_CAPI_TAG=0.10.6
10+
- DSS_CAPI_TAG=0.10.7rc1
1111
- LINUX_X64=1
1212
- CONDA_SUBDIR=linux-64
1313
services:
@@ -32,7 +32,7 @@ matrix:
3232
sudo: required
3333
env:
3434
- DOCKER_IMAGE=pmeira/manylinux_wheel_cmake_fpc_i686
35-
- DSS_CAPI_TAG=0.10.6
35+
- DSS_CAPI_TAG=0.10.7rc1
3636
- CONDA_SUBDIR=linux-32
3737
services:
3838
- docker
@@ -52,7 +52,7 @@ matrix:
5252
- name: "osx_x64"
5353
os: osx
5454
env:
55-
- DSS_CAPI_TAG=0.10.6
55+
- DSS_CAPI_TAG=0.10.7rc1
5656
script:
5757
- export TRAVIS_TAG_DSS_PYTHON=$TRAVIS_TAG
5858
- export TRAVIS_TAG=

README.md

Lines changed: 12 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ See also the other projects from [DSS-Extensions.org](https://dss-extensions.org
1313
- [DSS Sharp](http://github.com/dss-extensions/dss_sharp/): available for .NET/C#, also mimics the COM classes, but Windows-only at the moment. Soon it will be possible to use it via COM too.
1414
- [DSS MATLAB](http://github.com/dss-extensions/dss_matlab/): presents multi-platform integration (Windows, Linux, MacOS) with DSS C-API and is also very compatible with the COM classes.
1515

16-
Version 0.10.6, based on OpenDSS revision 2909 (around OpenDSS v9.0.0.3). While we plan to add a lot more funcionality into DSS Python, the main goal of creating a COM-compatible API has been reached. If you find an unexpected missing feature, please report it!
16+
Version 0.10.7, based on OpenDSS revision 2963 (OpenDSS v9.1.3.4). While we plan to add a lot more funcionality into DSS Python, the main goal of creating a COM-compatible API has been reached. If you find an unexpected missing feature, please report it!
1717

1818
This module mimics the COM structure (as exposed via `win32com` or `comtypes`), effectively enabling multi-platform compatibility at Python level.
1919
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.
@@ -22,7 +22,8 @@ The module depends on CFFI, NumPy and, optionally, SciPy.Sparse for reading the
2222

2323
## Brief release history
2424

25-
- **2020-07-31 / version 0.10.6: Maintenance release to match DSS C-API 0.10.6, based on on OpenDSS revision 2909. New important settings: `DSS.LegacyModels` and `DSS.Error.ExtendedErrors`.**
25+
- **2020-12-28 / version 0.10.7: Maintenance release to match DSS C-API 0.10.7, based on on OpenDSS revision 2963. Includes fixes and new features from the official OpenDSS.**
26+
- 2020-07-31 / version 0.10.6: Maintenance release to match DSS C-API 0.10.6, based on on OpenDSS revision 2909. New important settings: `DSS.LegacyModels` and `DSS.Error.ExtendedErrors`.
2627
- 2020-03-03 / version 0.10.5: Maintenance release to match DSS C-API 0.10.5, based on on OpenDSS revision 2837. Temporarily drops the v8 parallel-machine functions, as well as conda packages on Windows.
2728
- 2019-11-16 / version 0.10.4: Maintenance release to match DSS C-API 0.10.4.
2829
- 2019-05-22 / version 0.10.3: Some important fixes, better general performance, new API extensions, new features ported from COM and the OpenDSS version 8 codebase.
@@ -39,55 +40,22 @@ The module depends on CFFI, NumPy and, optionally, SciPy.Sparse for reading the
3940

4041
## Recent changes
4142

42-
**Changes in 0.10.6, since 0.10.5**
43-
44-
Check the [changelog](docs/changelog.md#0105) document for a detailed list for all releases.
45-
46-
- Updated to DSS C-API 0.10.6, which includes most changes up to OpenDSS v9.0.0.3.
47-
- Debug builds of DSS C-API are now included. See the [Debugging](https://github.com/dss-extensions/dss_capi/blob/0.10.x/docs/debug.md) document.
48-
- New `DSS.LegacyModels`: allow using the legacy/deprecated models for `PVsystem`, `Storage`, `InvControl`, and `StorageController`.
49-
- New `DSS.Error.ExtendedErrors`: controls if the new extended error messages are used.
50-
- Many new properties and functions in `DSS.ActiveCircuit.PDElements`.
51-
- Now most of the low-level API calls are checked, mapping the errors from the `DSS.Error` interface to Python exceptions more frequently.
52-
53-
DSS C-API 0.10.6 changes:
54-
55-
- 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 explicitely return as nulls instead of "\0". This conforms to the behavior already seen in arrays of strings.
56-
- 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.
57-
- The releases now include both the optimized/default binary and a non-optimized/debug version. See the [Debugging](https://github.com/dss-extensions/dss_capi/blob/0.10.x/docs/debug.md) document for more.
58-
- Extended API validation and **Extended Errors** mechanism:
59-
- The whole API was reviewed to add basic checks for active circuit and element access.
60-
- 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.
61-
- The mechanism can be toggled by API functions `DSS_Set_ExtendedErrors` and `DSS_Get_ExtendedErrors`, or environment variable `DSS_CAPI_EXTENDED_ERRORS=0` to disable (defaults to enabled state).
62-
- New **Legacy Models** mechanism:
63-
- OpenDSS 9.0+ dropped the old `PVsystem`, `Storage`, `InvControl`, and `StorageController` models, replacing with the new versions previously known as `PVsystem2`, `Storage2`, `InvControl2` and `StorageController2`.
64-
- 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.
65-
- 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.
66-
- 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.
67-
- 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.
68-
- The mechanism can be controlled by API functions `DSS_Set_LegacyModels` and `DSS_Get_LegacyModels`, or environment variable `DSS_CAPI_LEGACY_MODELS=1` to enable (defaults to disabled state).
69-
- WireData API: expose the `CapRadius` property as a new pair of functions.
70-
- 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`.
71-
- `CktElement_Get_SeqPowers`: fix issue for positive sequence circuits (wrong results could corrupt memory).
72-
- Many API functions were optimized to avoid unnecessary allocations and copies.
73-
- Some bugs found in DSS C-API and also reported upstream (already fixed in SVN):
74-
- `CapRadius` DSS property: if the radius was initialized using `GMRac`, `CapRadius` was left uninitialized, resulting in invalid/NaN values.
75-
- `Sensors` API: some functions edited capacitors instead of sensors.
76-
- Updated to the official OpenDSS revision 2903, corresponding to versions 9.0.0+. Changes include:
77-
- ExportCIMXML: updated.
78-
- Relay: Fix in `GetPropertyValue`.
79-
- Line: In `DumpProperties` and `MakePosSequence`, the length is handled differently for lines with `LineGeometry` or `LineSpacing`.
80-
- Bus API: new `LineList`, `LoadList` functions.
81-
- Lines API: SeasonRating now returns NormAmps if there's no SeasonSignal.
82-
- New command DSS `Zsc012`: "Returns symmetrical component short circuit impedances Z0, Z1, and Z2 for the ACTIVE 3-PHASE BUS. Determined from Zsc matrix."
83-
- `PVsystem2`, `Storage2`, `InvControl2`, `StorageController2` updated and renamed.
43+
**Changes in 0.10.7, since 0.10.6**
44+
45+
Check the [changelog](docs/changelog.md#0107) document for a detailed list for all releases.
46+
47+
- Simple maintenance release.
48+
- Updated to DSS C-API 0.10.7, which includes most changes up to OpenDSS v9.1.3.4.
49+
- Includes tweaks related to the `CapRadius` property.
50+
- New properties ported from the official COM interface: `Bus.AllPCEatBus`, `Bus.AllPDEatBus`, and `CktElement.TotalPowers`.
8451

8552
## Missing features and limitations
8653

8754
Most limitations are inherited from `dss_capi`, i.e., these are not implemented:
8855

8956
- `DSSEvents` from `DLL/ImplEvents.pas`: seems too dependent on COM.
9057
- `DSSProgress` from `DLL/ImplDSSProgress.pas`: would need a reimplementation depending on the target UI (GUI, text, headless, etc.).
58+
- OpenDSS-GIS features are not implemented since they're not open-source.
9159

9260
In general, the DLL from `dss_capi` provides more features than both the official Direct DLL and the COM object.
9361

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ clone_folder: c:\projects\dss_python
55
cache:
66
- c:\projects\VCForPython27.msi
77
environment:
8-
DSS_CAPI_TAG: 0.10.6
8+
DSS_CAPI_TAG: 0.10.7rc1
99
DSS_CAPI_PATH: c:\projects\dss_capi
1010
ANACONDA_API_TOKEN:
1111
secure: Pcm5IXFi4ZUsi1ue5QvPNASDo1Ns1REYbAwDJXRd3FRn2CfKbNPgnPda6fxoN6wG

docs/changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# 0.10.7
2+
3+
- Simple maintenance release.
4+
- Updated to DSS C-API 0.10.7, which includes most changes up to OpenDSS v9.1.3.4.
5+
- Includes tweaks related to the `CapRadius` property.
6+
- New properties ported from the official COM interface: `Bus.AllPCEatBus`, `Bus.AllPDEatBus`, and `CktElement.TotalPowers`.
7+
18
# 0.10.6
29

310
- Updated to DSS C-API 0.10.6, which includes most changes up to OpenDSS v9.0.0.3.

dss/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
from .v7 import *
77
from .patch_dss_com import patch_dss_com
88

9-
__version__ = '0.10.6'
9+
__version__ = '0.10.7rc1'

dss/dss_capi_gr/IBus.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ class IBus(Base):
4141
'puVoltages',
4242
'x',
4343
'y',
44+
'AllPCEatBus',
45+
'AllPDEatBus'
4446
]
4547

4648
def GetUniqueNodeNumber(self, StartNumber):
@@ -232,6 +234,16 @@ def LineList(self):
232234
'''List of strings: Full Names of LINE elements connected to the active bus.'''
233235
return self.CheckForError(self._get_string_array(self._lib.Bus_Get_LineList))
234236

237+
@property
238+
def AllPCEatBus(self):
239+
'''Returns an array with the names of all PCE connected to the active bus'''
240+
return self.CheckForError(self._get_string_array(self._lib.Bus_Get_AllPCEatBus))
241+
242+
@property
243+
def AllPDEatBus(self):
244+
'''Returns an array with the names of all PDE connected to the active bus'''
245+
return self.CheckForError(self._get_string_array(self._lib.Bus_Get_AllPDEatBus))
246+
235247
def __getitem__(self, index):
236248
if isinstance(index, int):
237249
# bus index is zero based, pass it directly

dss/dss_capi_gr/ICktElement.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class ICktElement(Base):
3636
'OCPDevIndex',
3737
'IsIsolated',
3838
'EnergyMeter',
39+
'TotalPowers',
3940

4041
'Yprim',
4142
'NodeOrder',
@@ -331,6 +332,12 @@ def IsIsolated(self):
331332
'''
332333
return self.CheckForError(self._lib.CktElement_Get_IsIsolated()) != 0
333334

335+
@property
336+
def TotalPowers(self):
337+
'''Returns the total powers (complex) at ALL terminals of the active circuit element.'''
338+
self.CheckForError(self._lib.CktElement_Get_TotalPowers_GR())
339+
return self._get_float64_gr_array()
340+
334341
def __iter__(self):
335342
for index in range(self.CheckForError(self._lib.Circuit_Get_NumCktElements())):
336343
self.CheckForError(self._lib.Circuit_SetCktElementIndex(index))

dss/dss_capi_ir/IBus.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ class IBus(Base):
4141
'puVoltages',
4242
'x',
4343
'y',
44+
'AllPCEatBus',
45+
'AllPDEatBus'
4446
]
4547

4648
def GetUniqueNodeNumber(self, StartNumber):
@@ -217,6 +219,16 @@ def LineList(self):
217219
'''List of strings: Full Names of LINE elements connected to the active bus.'''
218220
return self.CheckForError(self._get_string_array(self._lib.Bus_Get_LineList))
219221

222+
@property
223+
def AllPCEatBus(self):
224+
'''Returns an array with the names of all PCE connected to the active bus'''
225+
return self.CheckForError(self._get_string_array(self._lib.Bus_Get_AllPCEatBus))
226+
227+
@property
228+
def AllPDEatBus(self):
229+
'''Returns an array with the names of all PDE connected to the active bus'''
230+
return self.CheckForError(self._get_string_array(self._lib.Bus_Get_AllPDEatBus))
231+
220232
def __getitem__(self, index):
221233
if isinstance(index, int):
222234
# bus index is zero based, pass it directly

dss/dss_capi_ir/ICktElement.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class ICktElement(Base):
3636
'OCPDevIndex',
3737
'IsIsolated',
3838
'EnergyMeter',
39+
'TotalPowers',
3940

4041
'Yprim',
4142
'NodeOrder',
@@ -315,6 +316,11 @@ def IsIsolated(self):
315316
'''
316317
return self.CheckForError(self._lib.CktElement_Get_IsIsolated()) != 0
317318

319+
@property
320+
def TotalPowers(self):
321+
'''Returns the total powers (complex) at ALL terminals of the active circuit element.'''
322+
return self._get_float64_array(self._lib.CktElement_Get_TotalPowers)
323+
318324
def __iter__(self):
319325
for index in range(self.CheckForError(self._lib.Circuit_Get_NumCktElements())):
320326
self.CheckForError(self._lib.Circuit_SetCktElementIndex(index))

tests/validate.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,15 @@ def validate_CktElement(self):
169169
fB = set(x.lower() for x in getattr(B, field))
170170
for propA in fA:
171171
assert propA in fB, propA
172+
173+
for field in ['TotalPowers']:
174+
fA = getattr(A, field)
175+
fB = getattr(B, field)
176+
if not SAVE_COM_OUTPUT: assert np.allclose(fA, fB, atol=self.atol, rtol=self.rtol), (field, fA, fB, A.Name, B.Name)
172177

173-
# Since the list of properties vary in releases,
174-
# we don't check it the list is the same anymore.
175-
# if not SAVE_COM_OUTPUT: assert all(x[0] == x[1] for x in zip(fA, fB)), (field, fA, fB)
178+
# Since the list of properties vary in releases,
179+
# we don't check it the list is the same anymore.
180+
# if not SAVE_COM_OUTPUT: assert all(x[0] == x[1] for x in zip(fA, fB)), (field, fA, fB)
176181

177182
for field in 'AllVariableNames,BusNames'.split(','):
178183
fA = getattr(A, field)
@@ -278,13 +283,13 @@ def validate_Buses(self):
278283
if not SAVE_COM_OUTPUT: assert A.Name == B.Name
279284

280285
if self.capi.ActiveCircuit.NumNodes < 1000:
281-
for field in ('LoadList', 'LineList'):
286+
for field in ('LoadList', 'LineList', 'AllPCEatBus', 'AllPDEatBus'):
282287
fB = getattr(B, field)
283288
fA = output['ActiveCircuit.ActiveBus[{}].{}'.format(name, field)] if LOAD_COM_OUTPUT else getattr(A, field)
284289
if SAVE_COM_OUTPUT: output['ActiveCircuit.ActiveBus[{}].{}'.format(name, field)] = fA
285290
if not SAVE_COM_OUTPUT: assert list(fA) == list(fB), (fA, fB)
286291

287-
292+
288293
for field in ('Coorddefined', 'Cust_Duration', 'Cust_Interrupts', 'Distance', 'Int_Duration', 'Isc', 'Lambda', 'N_Customers', 'N_interrupts', 'Nodes', 'NumNodes', 'SectionID', 'TotalMiles', 'VLL', 'VMagAngle', 'Voc', 'Voltages', 'YscMatrix', 'Zsc0', 'Zsc1', 'ZscMatrix', 'kVBase', 'puVLL', 'puVmagAngle', 'puVoltages', 'x', 'y', 'SeqVoltages', 'CplxSeqVoltages'):
289294
fB = getattr(B, field)
290295
if COM_VLL_BROKEN and field in ('VLL', 'puVLL') and len(fB) == 1:
@@ -1206,7 +1211,7 @@ def run_tests(fns):
12061211
com = dss.patch_dss_com(com)
12071212
print('COM Version:', com.Version)
12081213
global COM_VLL_BROKEN
1209-
COM_VLL_BROKEN = ('Version 8.6.7.1 ' in com.Version) or ('Version 9.0.0.8 ' in com.Version)
1214+
COM_VLL_BROKEN = ('Version 8.6.7.1 ' in com.Version) or ('Version 9.0.0.8 ' in com.Version) or ('Version 9.1.3.4 ' in com.Version)
12101215
else:
12111216
com = None
12121217

0 commit comments

Comments
 (0)