Skip to content

Commit 370f76c

Browse files
committed
[ModelicaSystem] rename model_definition() => definition()
1 parent 8cc8f50 commit 370f76c

File tree

7 files changed

+16
-16
lines changed

7 files changed

+16
-16
lines changed

OMPython/ModelicaSystem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ def __init__(
424424
self._file_name: Optional[os.PathLike]
425425
self._variable_filter: Optional[str] = None
426426

427-
def model_definition(
427+
def definition(
428428
self,
429429
model: str,
430430
file: Optional[str | os.PathLike | pathlib.Path] = None,

tests/test_FMIExport.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
def test_CauerLowPassAnalog():
77
mod = OMPython.ModelicaSystem()
8-
mod.model_definition(
8+
mod.definition(
99
model="Modelica.Electrical.Analog.Examples.CauerLowPassAnalog",
1010
libraries=["Modelica"],
1111
)
@@ -19,7 +19,7 @@ def test_CauerLowPassAnalog():
1919

2020
def test_DrumBoiler():
2121
mod = OMPython.ModelicaSystem()
22-
mod.model_definition(
22+
mod.definition(
2323
model="Modelica.Fluid.Examples.DrumBoiler.DrumBoiler",
2424
libraries=["Modelica"],
2525
)

tests/test_ModelicaSystem.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def test_ModelicaSystem_loop(model_firstorder):
2323
def worker():
2424
filePath = model_firstorder.as_posix()
2525
mod = OMPython.ModelicaSystem()
26-
mod.model_definition(
26+
mod.definition(
2727
file=filePath,
2828
model="M",
2929
)
@@ -37,7 +37,7 @@ def test_setParameters():
3737
omc = OMPython.OMCSessionZMQ()
3838
model_path = omc.sendExpression("getInstallationDirectoryPath()") + "/share/doc/omc/testmodels/"
3939
mod = OMPython.ModelicaSystem()
40-
mod.model_definition(
40+
mod.definition(
4141
file=model_path + "BouncingBall.mo",
4242
model="BouncingBall",
4343
)
@@ -70,7 +70,7 @@ def test_setSimulationOptions():
7070
omc = OMPython.OMCSessionZMQ()
7171
model_path = omc.sendExpression("getInstallationDirectoryPath()") + "/share/doc/omc/testmodels/"
7272
mod = OMPython.ModelicaSystem()
73-
mod.model_definition(
73+
mod.definition(
7474
file=model_path + "BouncingBall.mo",
7575
model="BouncingBall",
7676
)
@@ -107,7 +107,7 @@ def test_relative_path(model_firstorder):
107107
assert "/" not in model_relative
108108

109109
mod = OMPython.ModelicaSystem()
110-
mod.model_definition(
110+
mod.definition(
111111
file=model_relative,
112112
model="M",
113113
)
@@ -121,7 +121,7 @@ def test_customBuildDirectory(tmp_path, model_firstorder):
121121
tmpdir = tmp_path / "tmpdir1"
122122
tmpdir.mkdir()
123123
mod = OMPython.ModelicaSystem(customBuildDirectory=tmpdir)
124-
mod.model_definition(
124+
mod.definition(
125125
file=filePath,
126126
model="M",
127127
)
@@ -135,7 +135,7 @@ def test_customBuildDirectory(tmp_path, model_firstorder):
135135
def test_getSolutions(model_firstorder):
136136
filePath = model_firstorder.as_posix()
137137
mod = OMPython.ModelicaSystem()
138-
mod.model_definition(
138+
mod.definition(
139139
file=filePath,
140140
model="M",
141141
)
@@ -176,7 +176,7 @@ def test_getters(tmp_path):
176176
end M_getters;
177177
""")
178178
mod = OMPython.ModelicaSystem()
179-
mod.model_definition(
179+
mod.definition(
180180
file=model_file.as_posix(),
181181
model="M_getters",
182182
)
@@ -372,7 +372,7 @@ def test_simulate_inputs(tmp_path):
372372
end M_input;
373373
""")
374374
mod = OMPython.ModelicaSystem()
375-
mod.model_definition(
375+
mod.definition(
376376
file=model_file.as_posix(),
377377
model="M_input",
378378
)

tests/test_ModelicaSystemCmd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def model_firstorder(tmp_path):
1818
@pytest.fixture
1919
def mscmd_firstorder(model_firstorder):
2020
mod = OMPython.ModelicaSystem()
21-
mod.model_definition(
21+
mod.definition(
2222
file=model_firstorder.as_posix(),
2323
model="M",
2424
)

tests/test_OMSessionCmd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def test_isPackage():
99

1010
def test_isPackage2():
1111
mod = OMPython.ModelicaSystem()
12-
mod.model_definition(
12+
mod.definition(
1313
model="Modelica.Electrical.Analog.Examples.CauerLowPassAnalog",
1414
libraries=["Modelica"],
1515
)

tests/test_linearization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def model_linearTest(tmp_path):
2525

2626
def test_example(model_linearTest):
2727
mod = OMPython.ModelicaSystem()
28-
mod.model_definition(
28+
mod.definition(
2929
file=model_linearTest,
3030
model="linearTest",
3131
)
@@ -60,7 +60,7 @@ def test_getters(tmp_path):
6060
end Pendulum;
6161
""")
6262
mod = OMPython.ModelicaSystem()
63-
mod.model_definition(
63+
mod.definition(
6464
file=model_file.as_posix(),
6565
model="Pendulum",
6666
libraries=["Modelica"],

tests/test_optimization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_optimization_example(tmp_path):
3434
""")
3535

3636
mod = OMPython.ModelicaSystem()
37-
mod.model_definition(
37+
mod.definition(
3838
file=model_file.as_posix(),
3939
model="BangBang2021",
4040
)

0 commit comments

Comments
 (0)