Skip to content

Commit 8db7387

Browse files
syntronadeas31
andauthored
E002 prepare restructure (#440)
* (E001) update tests (v4.x.x) [test_*] reorder imports [tests_ModelicaDoE*] fix pylint hint * use .items() [tests_*] use OMSessionABC.get_version() [test_ModelicaSystemCmd] use get_model_name() instead of access to private variable _model_name [test_ModelicaSystemOMC] read file using utf-8 encoding / linter fix [test_ModelicaSystemRunner] update test case * ModelicaSystemRunner & OMCPath * ModelicaSystemRunner & OMPathRunnerLocal * ModelicaSystemRunner & OMPathRunnerBash * ModelicaSystemRunner & OMPathRunnerBash using docker * ModelicaSystemRunner & OMPathRunnerBash using WSL (not tested!) [test_OMCPath] update test case * OMCPath & OMCSessionZMQ * OMCPath & OMCSessionLocal * OMCPath & OMCSessionDocker * OMCPath & OMCSessionWSL (not tested!) * OMPathLocal & OMCSessionRunner * OMPathBash & OMCSessionRunner * OMPathBash & OMCSessionRunner in docker * OMPathBash & OMCSessionRunner in WSL (not tested!) add workflow to run unittests in ./tests [test_OMParser] use only the public interface => om_parser_basic() [test_OMTypedParser] rename file / use om_parser_typed() update tests - do NOT run test_FMIRegression.py reason: * it is only a test for OMC / not OMPython specific * furthermore, it is run automatically via cron job (= FMITest) [test_ModelExecutionCmd] rename from test_ModelicaSystemCmd * (E002) prepare restructure [ModelicaSystemCmd] add missing docstring [OMCSession] spelling fixes [OMCSessionCmd] add warning about depreciated class [OMCSessionABC] remove duplicated code; see OMSessionABC [OMSessionRunnerABC] define class [OMCSessionZMQ] call super()__init__() [OMCPath] fix forward dependency on OMCSessionLocal [OMSessionException] rename from OMCSessionException [__init__] fix imports --------- Co-authored-by: Adeel Asghar <adeel.asghar@liu.se>
1 parent 149f654 commit 8db7387

3 files changed

Lines changed: 122 additions & 108 deletions

File tree

OMPython/ModelicaSystem.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
ModelExecutionData,
2626
ModelExecutionException,
2727

28-
OMCSessionException,
28+
OMSessionException,
2929
OMCSessionLocal,
3030

3131
OMPathABC,
@@ -1688,7 +1688,7 @@ def sendExpression(self, expr: str, parsed: bool = True) -> Any:
16881688
"""
16891689
try:
16901690
retval = self._session.sendExpression(expr=expr, parsed=parsed)
1691-
except OMCSessionException as ex:
1691+
except OMSessionException as ex:
16921692
raise ModelicaSystemError(f"Error executing {repr(expr)}: {ex}") from ex
16931693

16941694
logger.debug(f"Result of executing {repr(expr)}: {textwrap.shorten(repr(retval), width=100)}")
@@ -2829,7 +2829,9 @@ def _prepare_structure_parameters(
28292829

28302830

28312831
class ModelicaSystemCmd(ModelExecutionCmd):
2832-
# TODO: docstring
2832+
"""
2833+
Compatibility class; in the new version it is renamed as MOdelExecutionCmd.
2834+
"""
28332835

28342836
def __init__(
28352837
self,

0 commit comments

Comments
 (0)