Skip to content

Commit 6b052e2

Browse files
committed
??? fix
1 parent e3388f6 commit 6b052e2

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

OMPython/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
ModelExecutionData,
3030
ModelExecutionException,
3131

32+
OMSessionRunner,
33+
3234
OMCSessionCmd,
3335
OMCSessionException,
3436
OMCSessionZMQ,
@@ -58,6 +60,8 @@
5860

5961
'doe_get_solutions',
6062

63+
'OMSessionRunner',
64+
6165
'OMCSessionCmd',
6266
'OMCSessionException',
6367
'OMCSessionZMQ',

tests/test_ModelicaDoERunner.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,20 @@ def test_ModelicaDoEOMC_local(tmp_path, model_doe, param_doe):
5656
resultfile_mod = mod.getWorkDirectory() / f"{mod.get_model_name()}_res_mod.mat"
5757
_run_simulation(mod=mod, resultfile=resultfile_mod, param=param_doe)
5858

59+
# run the model using only the runner class
60+
omcs = OMPython.OMSessionRunner(
61+
version=mod.get_session().get_version(),
62+
)
63+
modr = OMPython.ModelicaSystemRunner(
64+
session=omcs,
65+
work_directory=mod.getWorkDirectory(),
66+
)
67+
modr.setup(
68+
model_name="M",
69+
)
70+
5971
doe_mod = OMPython.ModelicaDoERunner(
60-
mod=mod,
72+
mod=modr,
6173
parameters=param_doe,
6274
resultpath=tmpdir,
6375
simargs={"override": {'stopTime': '1.0'}},

tests/test_ModelicaSystemRunner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def test_runner(model_firstorder, param):
4949
_run_simulation(mod=mod, resultfile=resultfile_mod, param=param)
5050

5151
# run the model using only the runner class
52-
omcs = OMPython.SessionRunner(
52+
omcs = OMPython.OMSessionRunner(
5353
version=mod.get_session().get_version(),
5454
)
5555
modr = OMPython.ModelicaSystemRunner(

0 commit comments

Comments
 (0)