Skip to content

Commit 0b43d24

Browse files
committed
[ModelicaSystem] rename ModelicaSystem => ModelicaSystemOMC
* add compatibility variable for ModelicaSystem
1 parent 57977a6 commit 0b43d24

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
@@ -1487,7 +1487,7 @@ def getLinearStates(self) -> list[str]:
14871487
return self._linearized_states
14881488

14891489

1490-
class ModelicaSystem(ModelicaSystemABC):
1490+
class ModelicaSystemOMC(ModelicaSystemABC):
14911491
"""
14921492
Class to simulate a Modelica model using OpenModelica via OMCSession.
14931493
"""
@@ -2102,6 +2102,12 @@ def optimize(self) -> dict[str, Any]:
21022102
return self._requestApi(apiName='optimize', entity=self._model_name, properties=properties)
21032103

21042104

2105+
class ModelicaSystem(ModelicaSystemOMC):
2106+
"""
2107+
Compatibility class.
2108+
"""
2109+
2110+
21052111
class ModelicaSystemDoE:
21062112
"""
21072113
Class to run DoEs based on a (Open)Modelica model using ModelicaSystem
@@ -2177,7 +2183,7 @@ def run_doe():
21772183
def __init__(
21782184
self,
21792185
# ModelicaSystem definition to use
2180-
mod: ModelicaSystem,
2186+
mod: ModelicaSystemOMC,
21812187
# simulation specific input
21822188
# TODO: add more settings (simulation options, input options, ...)
21832189
simargs: Optional[dict[str, Optional[str | dict[str, str] | numbers.Number]]] = None,
@@ -2190,7 +2196,7 @@ def __init__(
21902196
ModelicaSystem.simulate(). Additionally, the path to store the result files is needed (= resultpath) as well as
21912197
a list of parameters to vary for the Doe (= parameters). All possible combinations are considered.
21922198
"""
2193-
if not isinstance(mod, ModelicaSystem):
2199+
if not isinstance(mod, ModelicaSystemOMC):
21942200
raise ModelicaSystemError("Missing definition of ModelicaSystem!")
21952201

21962202
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,
@@ -43,6 +44,7 @@
4344
'ModelExecutionException',
4445

4546
'ModelicaSystem',
47+
'ModelicaSystemOMC',
4648
'ModelExecutionCmd',
4749
'ModelicaSystemDoE',
4850
'ModelicaSystemError',

0 commit comments

Comments
 (0)