Skip to content

Commit 337a5bb

Browse files
committed
??? rebase cleanup
1 parent 994d31a commit 337a5bb

5 files changed

Lines changed: 11 additions & 10 deletions

File tree

OMPython/ModelicaSystem.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ def _parse_om_version(version: str) -> tuple[int, int, int]:
838838
def _process_override_data(
839839
self,
840840
om_cmd: ModelExecutionCmd,
841-
override_file: OMCPath,
841+
override_file: OMPathBase,
842842
override_var: dict[str, str],
843843
override_sim: dict[str, str],
844844
) -> None:
@@ -1682,7 +1682,7 @@ def sendExpression(self, expr: str, parsed: bool = True) -> Any:
16821682
Wrapper for OMCSession.sendExpression().
16831683
"""
16841684
try:
1685-
retval = self._session.sendExpression(command=expr, parsed=parsed)
1685+
retval = self._session.sendExpression(expr=expr, parsed=parsed)
16861686
except OMCSessionException as ex:
16871687
raise ModelicaSystemError(f"Error executing {repr(expr)}: {ex}") from ex
16881688

OMPython/OMCSession.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ def _tempdir(tempdir_base: OMPathBase) -> OMPathBase:
756756
return tempdir
757757

758758
@abc.abstractmethod
759-
def sendExpression(self, command: str, parsed: bool = True) -> Any:
759+
def sendExpression(self, expr: str, parsed: bool = True) -> Any:
760760
"""
761761
Function needed to send expressions to the OMC server via ZMQ.
762762
"""
@@ -2023,8 +2023,8 @@ def write_text(self, data: str) -> int:
20232023
try:
20242024
subprocess.run(cmdl, check=True)
20252025
return len(data)
2026-
except subprocess.CalledProcessError:
2027-
raise IOError(f"Error writing data to file {self.as_posix()}!")
2026+
except subprocess.CalledProcessError as exc:
2027+
raise IOError(f"Error writing data to file {self.as_posix()}!") from exc
20282028

20292029
def mkdir(self, parents: bool = True, exist_ok: bool = False) -> None:
20302030
"""
@@ -2190,7 +2190,7 @@ def omcpath_tempdir(self, tempdir_base: Optional[OMPathBase] = None) -> OMPathBa
21902190

21912191
return self._tempdir(tempdir_base=tempdir_base)
21922192

2193-
def sendExpression(self, command: str, parsed: bool = True) -> Any:
2193+
def sendExpression(self, expr: str, parsed: bool = True) -> Any:
21942194
raise OMCSessionException(f"{self.__class__.__name__} does not uses an OMC server!")
21952195

21962196

OMPython/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
)
2929
from OMPython.OMCSession import (
3030
OMCPath,
31-
OMCSession,
3231

3332
ModelExecutionData,
3433
ModelExecutionException,
@@ -41,7 +40,6 @@
4140
OMCSessionPort,
4241
OMCSessionLocal,
4342

44-
OMCPath,
4543
OMPathRunnerBash,
4644
OMPathRunnerLocal,
4745

@@ -75,7 +73,6 @@
7573

7674
'OMCPath',
7775

78-
'OMCSession',
7976
'ModelicaSystemCmd',
8077

8178
'doe_get_solutions',
@@ -95,6 +92,8 @@
9592
'OMSessionRunner',
9693

9794
'OMCSessionABC',
95+
'OMCSessionDocker',
96+
'OMCSessionDockerContainer',
9897
'OMCSessionWSL',
9998

10099
'OMCProcessLocal',

tests/test_FMIRegression.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import os
22
import pathlib
3-
import pytest
43
import shutil
54
import tempfile
65

6+
import pytest
7+
78
import OMPython
89

910

tests/test_OMCPath.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
reason="OMCPath(non-local) only working for Python >= 3.12.",
1515
)
1616

17+
1718
def test_OMCPath_OMCSessionZMQ():
1819
om = OMPython.OMCSessionZMQ()
1920

0 commit comments

Comments
 (0)