Skip to content

Commit 7ba2bea

Browse files
syntronadeas31
andauthored
Pylint fix (#407)
* [ModelicaSystem] fix pylint message OMPython/ModelicaSystem.py:1787:16: W0612: Unused variable 'key' (unused-variable) => replace items() by values() * [OMCSession] fix pylint: W0706: The except handler raises immediately (try-except-raise) --------- Co-authored-by: Adeel Asghar <adeel.asghar@liu.se>
1 parent c53a937 commit 7ba2bea

2 files changed

Lines changed: 1 addition & 7 deletions

File tree

OMPython/ModelicaSystem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1800,7 +1800,7 @@ def linearize(
18001800
)
18011801

18021802
if self._inputs:
1803-
for key, data in self._inputs.items():
1803+
for data in self._inputs.values():
18041804
if data is not None:
18051805
for value in data:
18061806
if value[0] < float(self._simulate_options["startTime"]):

OMPython/OMCSession.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,6 @@ def getClassComment(self, className):
171171
logger.warning("Method 'getClassComment(%s)' failed; OMTypedParser error: %s",
172172
className, ex.msg)
173173
return 'No description available'
174-
except OMCSessionException:
175-
raise
176174

177175
def getNthComponent(self, className, comp_id):
178176
""" returns with (type, name, description) """
@@ -201,8 +199,6 @@ def getParameterNames(self, className):
201199
logger.warning('OMPython error: %s', ex)
202200
# FIXME: OMC returns with a different structure for empty parameter set
203201
return []
204-
except OMCSessionException:
205-
raise
206202

207203
def getParameterValue(self, className, parameterName):
208204
try:
@@ -211,8 +207,6 @@ def getParameterValue(self, className, parameterName):
211207
logger.warning("Method 'getParameterValue(%s, %s)' failed; OMTypedParser error: %s",
212208
className, parameterName, ex.msg)
213209
return ""
214-
except OMCSessionException:
215-
raise
216210

217211
def getComponentModifierNames(self, className, componentName):
218212
return self._ask(question='getComponentModifierNames', opt=[className, componentName])

0 commit comments

Comments
 (0)