Skip to content

Commit

Permalink
Merge pull request #129 from NREL/upgrade-opendssdirect
Browse files Browse the repository at this point in the history
Upgrade to OpenDSSDirect v0.8.4
  • Loading branch information
AadilLatif authored Sep 26, 2023
2 parents 8ff0dd9 + c3c625f commit 278049e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions PyDSS/dssElement.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import ast

from opendssdirect import DSSException

from PyDSS.dssBus import dssBus
from PyDSS.dssObjectBase import dssObjectBase
from PyDSS.exceptions import InvalidParameter
from PyDSS.value_storage import ValueByNumber


class dssElement(dssObjectBase):

VARIABLE_OUTPUTS_BY_LABEL = {
Expand Down Expand Up @@ -81,8 +84,14 @@ def __init__(self, dssInstance):
self._Parameters[PptName] = str(i)

CktElmVarDict = dssInstance.CktElement.__dict__
for VarName in dssInstance.CktElement.AllVariableNames():
CktElmVarDict[VarName] = None
try:
for VarName in dssInstance.CktElement.AllVariableNames():
CktElmVarDict[VarName] = None
except DSSException as e:
# Prior to OpenDSSDirect.py v0.8.0 this returned an empty list for non-PC elements.
# v0.8.0 and later raises an exception. Ignore the error.
if e.args[1] != "The active circuit element is not a PC Element":
raise

for key in CktElmVarDict.keys():
try:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ scipy
bokeh
networkx
toml
OpenDSSDirect.py~=0.7.0
OpenDSSDirect.py~=0.8.4
Shapely
click
numpy
Expand Down

0 comments on commit 278049e

Please sign in to comment.