From da9deba5d205f0082754a4ee8b22f0e13072a88b Mon Sep 17 00:00:00 2001 From: syntron Date: Tue, 15 Apr 2025 21:30:05 +0200 Subject: [PATCH] [ModelicaSystem] do NOT store data in the class workspace --- OMPython/__init__.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/OMPython/__init__.py b/OMPython/__init__.py index 16f6af94c..0ac419a0e 100644 --- a/OMPython/__init__.py +++ b/OMPython/__init__.py @@ -646,7 +646,6 @@ def __init__(self, fileName=None, modelName=None, lmodel=None, commandLineOption raise Exception("Cannot create ModelicaSystem object without any arguments") return - self.tree = None self.quantitiesList = [] self.paramlist = {} self.inputlist = {} @@ -871,9 +870,8 @@ def requestApi(self, apiName, entity=None, properties=None): # 2 def xmlparse(self): if (os.path.exists(self.xmlFile)): - self.tree = ET.parse(self.xmlFile) - self.root = self.tree.getroot() - rootCQ = self.root + tree = ET.parse(self.xmlFile) + rootCQ = tree.getroot() for attr in rootCQ.iter('DefaultExperiment'): self.simulateOptions["startTime"] = attr.get('startTime') self.simulateOptions["stopTime"] = attr.get('stopTime')