Skip to content

Commit 43690ff

Browse files
committed
Plots: add initial/incomplete implementation
Many of the plots commands already work Ref #3
1 parent 6e08549 commit 43690ff

File tree

3 files changed

+1272
-4
lines changed

3 files changed

+1272
-4
lines changed

docs/changelog.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
- Reenabled Parallel interface and PM functions (actors and so on), based on a new implementation.
66
- Enable incremental Y matrix options -- controlled by `DSS.YMatrix.SolverOptions`, options listed in `SparseSolverOptions`.
77
- New `ToJSON` functions to dump object properties (power flow state is not included at the moment)
8-
- Initial implementation `DSS.Obj` API for direct DSS object and uniform batch manipulation, covering all DSS classes implemented in DSS C-API. The shape of this API may change for the next releases. At the moment it is intended for advanced users. For example, if you get an object handle from the engine and load a new circuit, the handle is invalid and you should not access it anymore (otherwise, crashes are expected).
8+
- Initial implementation of the new `DSS.Obj` API for direct DSS object and uniform batch manipulation, covering all DSS classes implemented in DSS C-API. The shape of this API may change for the next releases. At the moment it is intended for advanced users. For example, if you get an object handle from the engine and load a new circuit, the handle is invalid and you should not access it anymore (otherwise, crashes are expected).
9+
- Initial (work-in-progress) implementation of plotting functions. This will also be finished and polished in following releases.
910
- Due to some changes ported from the official OpenDSS since 0.10.7, some results may change, especially for circuits that used miles as length units. The same is observed across the official OpenDSS releases.
1011

11-
DSS C-API 0.10.7 changes:
12+
13+
DSS C-API 0.12.0 changes:
1214

1315
**Includes porting of most official OpenDSS features up to revision 3460.** Check the OpenDSS SVN commits for details.
1416

@@ -60,7 +62,7 @@ This version still maintains basic compatibility with the 0.10.x series of relea
6062
- The C headers for our library were updated to include the `const` modifier for various of the parameters. A few function declarations were fixed.
6163
- Initial batch of i18n changes.
6264

63-
Due to the high number of IO changes, we recommend checking the performance before and after the upgrade to ensure your use case is not affected negatively. If issues are found, please do report.
65+
Due to the high number of IO changes, we recommend checking the performance before and after the upgrade to ensure your use case is not affected negatively, especially if your application relies heavily on OpenDSS text output. If issues are found, please do report.
6466

6567

6668
# 0.10.7

dss/_cffi_api_util.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ def _decode_and_free_string(self, s) -> str:
170170

171171
class CffiApiUtil(object):
172172
def __init__(self, ffi, lib, ctx=None):
173+
self.owns_ctx = True
173174
self.codec = codec
174175
self.ctx = ctx
175176
self.ffi = ffi
@@ -185,7 +186,7 @@ def __delete__(self):
185186
if self.ctx is None:
186187
return
187188

188-
if self.lib.ctx_Get_Prime() != self.ctx:
189+
if self.lib.ctx_Get_Prime() != self.ctx and self.owns_ctx:
189190
self.lib.ctx_Dispose(self.ctx)
190191

191192
def init_buffers(self):

0 commit comments

Comments
 (0)