Skip to content

Commit af54fc6

Browse files
committed
[OMSessionRunnerABC] define class
1 parent b8032dc commit af54fc6

1 file changed

Lines changed: 23 additions & 4 deletions

File tree

OMPython/OMCSession.py

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2073,16 +2073,16 @@ def _omc_port_get(self) -> str:
20732073
return port
20742074

20752075

2076-
class OMSessionRunner(OMSessionABC):
2076+
class OMSessionRunnerABC(OMSessionABC, metaclass=abc.ABCMeta):
20772077
"""
20782078
Implementation based on OMSessionABC without any use of an OMC server.
20792079
"""
20802080

20812081
def __init__(
20822082
self,
2083+
ompath_runner: Type[OMPathRunnerABC],
20832084
timeout: float = 10.0,
20842085
version: str = "1.27.0",
2085-
ompath_runner: Type[OMPathRunnerABC] = OMPathRunnerLocal,
20862086
cmd_prefix: Optional[list[str]] = None,
20872087
model_execution_local: bool = True,
20882088
) -> None:
@@ -2097,8 +2097,27 @@ def __init__(
20972097
if cmd_prefix is not None:
20982098
self._cmd_prefix = cmd_prefix
20992099

2100-
# TODO: some checking?!
2101-
# if ompath_runner == Type[OMPathRunnerBash]:
2100+
2101+
class OMSessionRunner(OMSessionRunnerABC):
2102+
"""
2103+
Implementation based on OMSessionABC without any use of an OMC server.
2104+
"""
2105+
2106+
def __init__(
2107+
self,
2108+
ompath_runner: Type[OMPathRunnerABC] = OMPathRunnerLocal,
2109+
timeout: float = 10.0,
2110+
version: str = "1.27.0",
2111+
cmd_prefix: Optional[list[str]] = None,
2112+
model_execution_local: bool = True,
2113+
) -> None:
2114+
super().__init__(
2115+
ompath_runner=ompath_runner,
2116+
timeout=timeout,
2117+
version=version,
2118+
cmd_prefix=cmd_prefix,
2119+
model_execution_local=model_execution_local,
2120+
)
21022121

21032122
def __post_init__(self) -> None:
21042123
"""

0 commit comments

Comments
 (0)