Skip to content

Commit f838239

Browse files
syntronadeas31
andauthored
[ModelicaSystem] do NOT store data in the class workspace (#252)
Co-authored-by: Adeel Asghar <adeel.asghar@liu.se>
1 parent 8df1ab8 commit f838239

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

OMPython/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,6 @@ def __init__(self, fileName=None, modelName=None, lmodel=None, commandLineOption
620620
if fileName is None and modelName is None and not lmodel: # all None
621621
raise Exception("Cannot create ModelicaSystem object without any arguments")
622622

623-
self.tree = None
624623
self.quantitiesList = []
625624
self.paramlist = {}
626625
self.inputlist = {}
@@ -842,9 +841,8 @@ def xmlparse(self):
842841
self._raise_error(errstr=f"XML file not generated: {self.xmlFile}")
843842
return
844843

845-
self.tree = ET.parse(self.xmlFile)
846-
self.root = self.tree.getroot()
847-
rootCQ = self.root
844+
tree = ET.parse(self.xmlFile)
845+
rootCQ = tree.getroot()
848846
for attr in rootCQ.iter('DefaultExperiment'):
849847
for key in ("startTime", "stopTime", "stepSize", "tolerance",
850848
"solver", "outputFormat"):

0 commit comments

Comments
 (0)