From 81ff9cb43f257dad3569ff090ebcb3d35f4fc986 Mon Sep 17 00:00:00 2001 From: syntron Date: Sun, 18 Jan 2026 20:37:24 +0100 Subject: [PATCH 1/2] [OMCSession] use function keyword arguments if possible --- OMPython/OMCSession.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/OMPython/OMCSession.py b/OMPython/OMCSession.py index 6b5b2b3d..8d4774fc 100644 --- a/OMPython/OMCSession.py +++ b/OMPython/OMCSession.py @@ -50,7 +50,7 @@ def poll(self): return None if self.process.is_running() else True def kill(self): - return os.kill(self.pid, signal.SIGKILL) + return os.kill(pid=self.pid, signal=signal.SIGKILL) def wait(self, timeout): try: @@ -848,10 +848,12 @@ def run_model_executable(self, cmd_run_data: OMCSessionRunData) -> int: return returncode def execute(self, command: str): - warnings.warn(message="This function is depreciated and will be removed in future versions; " - "please use sendExpression() instead", - category=DeprecationWarning, - stacklevel=2) + warnings.warn( + message="This function is depreciated and will be removed in future versions; " + "please use sendExpression() instead", + category=DeprecationWarning, + stacklevel=2, + ) return self.sendExpression(command, parsed=False) From d06a6634841db2aa115a6bc8260d86ad8f5897d9 Mon Sep 17 00:00:00 2001 From: syntron Date: Sun, 18 Jan 2026 20:37:43 +0100 Subject: [PATCH 2/2] [ModelicaSystem] use function keyword arguments if possible --- OMPython/ModelicaSystem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OMPython/ModelicaSystem.py b/OMPython/ModelicaSystem.py index 03c24b51..93a45be8 100644 --- a/OMPython/ModelicaSystem.py +++ b/OMPython/ModelicaSystem.py @@ -1024,7 +1024,7 @@ def getOptimizationOptions( raise ModelicaSystemError("Unhandled input for getOptimizationOptions()") def _parse_om_version(self, version: str) -> tuple[int, int, int]: - match = re.search(r"v?(\d+)\.(\d+)\.(\d+)", version) + match = re.search(pattern=r"v?(\d+)\.(\d+)\.(\d+)", string=version) if not match: raise ValueError(f"Version not found in: {version}") major, minor, patch = map(int, match.groups())