Skip to content

Commit 9abf38d

Browse files
committed
[ModelicaSystem] rename ModelicaSystem => ModelicaSystemOMC
* add compatibility variable for ModelicaSystem
1 parent 873cbb8 commit 9abf38d

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

OMPython/ModelicaSystem.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,7 +1478,7 @@ def getLinearStates(self) -> list[str]:
14781478
return self._linearized_states
14791479

14801480

1481-
class ModelicaSystem(ModelicaSystemABC):
1481+
class ModelicaSystemOMC(ModelicaSystemABC):
14821482
"""
14831483
Class to simulate a Modelica model using OpenModelica via OMCSession.
14841484
"""
@@ -2093,6 +2093,12 @@ def optimize(self) -> dict[str, Any]:
20932093
return self._requestApi(apiName='optimize', entity=self._model_name, properties=properties)
20942094

20952095

2096+
class ModelicaSystem(ModelicaSystemOMC):
2097+
"""
2098+
Compatibility class.
2099+
"""
2100+
2101+
20962102
class ModelicaSystemDoE:
20972103
"""
20982104
Class to run DoEs based on a (Open)Modelica model using ModelicaSystem
@@ -2168,7 +2174,7 @@ def run_doe():
21682174
def __init__(
21692175
self,
21702176
# ModelicaSystem definition to use
2171-
mod: ModelicaSystem,
2177+
mod: ModelicaSystemOMC,
21722178
# simulation specific input
21732179
# TODO: add more settings (simulation options, input options, ...)
21742180
simargs: Optional[dict[str, Optional[str | dict[str, str] | numbers.Number]]] = None,
@@ -2181,7 +2187,7 @@ def __init__(
21812187
ModelicaSystem.simulate(). Additionally, the path to store the result files is needed (= resultpath) as well as
21822188
a list of parameters to vary for the Doe (= parameters). All possible combinations are considered.
21832189
"""
2184-
if not isinstance(mod, ModelicaSystem):
2190+
if not isinstance(mod, ModelicaSystemOMC):
21852191
raise ModelicaSystemError("Missing definition of ModelicaSystem!")
21862192

21872193
self._mod = mod

OMPython/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from OMPython.ModelicaSystem import (
1515
LinearizationResult,
1616
ModelicaSystem,
17+
ModelicaSystemOMC,
1718
ModelExecutionCmd,
1819
ModelicaSystemDoE,
1920
ModelicaSystemError,
@@ -40,6 +41,7 @@
4041
'ModelExecutionException',
4142

4243
'ModelicaSystem',
44+
'ModelicaSystemOMC',
4345
'ModelExecutionCmd',
4446
'ModelicaSystemDoE',
4547
'ModelicaSystemError',

0 commit comments

Comments
 (0)