From da06b3bf53aa2a2a95f5f746b1915153105e5d3d Mon Sep 17 00:00:00 2001 From: syntron Date: Sat, 27 Dec 2025 21:35:22 +0100 Subject: [PATCH 1/2] [ModelicaSystem] fix pylint message OMPython/ModelicaSystem.py:1787:16: W0612: Unused variable 'key' (unused-variable) => replace items() by values() --- OMPython/ModelicaSystem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OMPython/ModelicaSystem.py b/OMPython/ModelicaSystem.py index 570c7b43..37687d77 100644 --- a/OMPython/ModelicaSystem.py +++ b/OMPython/ModelicaSystem.py @@ -1800,7 +1800,7 @@ def linearize( ) if self._inputs: - for key, data in self._inputs.items(): + for data in self._inputs.values(): if data is not None: for value in data: if value[0] < float(self._simulate_options["startTime"]): From b651052924e744cdc52a3242339fabeda850a95a Mon Sep 17 00:00:00 2001 From: syntron Date: Mon, 29 Dec 2025 14:25:17 +0100 Subject: [PATCH 2/2] [OMCSession] fix pylint: W0706: The except handler raises immediately (try-except-raise) --- OMPython/OMCSession.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/OMPython/OMCSession.py b/OMPython/OMCSession.py index 1e2a5383..5ed0fd8d 100644 --- a/OMPython/OMCSession.py +++ b/OMPython/OMCSession.py @@ -171,8 +171,6 @@ def getClassComment(self, className): logger.warning("Method 'getClassComment(%s)' failed; OMTypedParser error: %s", className, ex.msg) return 'No description available' - except OMCSessionException: - raise def getNthComponent(self, className, comp_id): """ returns with (type, name, description) """ @@ -201,8 +199,6 @@ def getParameterNames(self, className): logger.warning('OMPython error: %s', ex) # FIXME: OMC returns with a different structure for empty parameter set return [] - except OMCSessionException: - raise def getParameterValue(self, className, parameterName): try: @@ -211,8 +207,6 @@ def getParameterValue(self, className, parameterName): logger.warning("Method 'getParameterValue(%s, %s)' failed; OMTypedParser error: %s", className, parameterName, ex.msg) return "" - except OMCSessionException: - raise def getComponentModifierNames(self, className, componentName): return self._ask(question='getComponentModifierNames', opt=[className, componentName])