@@ -35,8 +35,8 @@ def test_setParameters():
3535 mod = OMPython .ModelicaSystem (model_path + "BouncingBall.mo" , "BouncingBall" )
3636
3737 # method 1
38- mod .setParameters ("e= 1.234" )
39- mod .setParameters ("g= 321.0" )
38+ mod .setParameters (pvals = { "e" : 1.234 } )
39+ mod .setParameters (pvals = { "g" : 321.0 } )
4040 assert mod .getParameters ("e" ) == ["1.234" ]
4141 assert mod .getParameters ("g" ) == ["321.0" ]
4242 assert mod .getParameters () == {
@@ -47,7 +47,7 @@ def test_setParameters():
4747 mod .getParameters ("thisParameterDoesNotExist" )
4848
4949 # method 2
50- mod .setParameters ([ "e= 21.3" , "g= 0.12" ] )
50+ mod .setParameters (pvals = { "e" : 21.3 , "g" : 0.12 } )
5151 assert mod .getParameters () == {
5252 "e" : "21.3" ,
5353 "g" : "0.12" ,
@@ -64,8 +64,8 @@ def test_setSimulationOptions():
6464 mod = OMPython .ModelicaSystem (fileName = model_path + "BouncingBall.mo" , modelName = "BouncingBall" )
6565
6666 # method 1
67- mod .setSimulationOptions ("stopTime= 1.234" )
68- mod .setSimulationOptions ("tolerance= 1.1e-08" )
67+ mod .setSimulationOptions (simOptions = { "stopTime" : 1.234 } )
68+ mod .setSimulationOptions (simOptions = { "tolerance" : 1.1e-08 } )
6969 assert mod .getSimulationOptions ("stopTime" ) == ["1.234" ]
7070 assert mod .getSimulationOptions ("tolerance" ) == ["1.1e-08" ]
7171 assert mod .getSimulationOptions (["tolerance" , "stopTime" ]) == ["1.1e-08" , "1.234" ]
@@ -77,7 +77,7 @@ def test_setSimulationOptions():
7777 mod .getSimulationOptions ("thisOptionDoesNotExist" )
7878
7979 # method 2
80- mod .setSimulationOptions ([ "stopTime= 2.1" , "tolerance= 1.2e-08" ] )
80+ mod .setSimulationOptions (simOptions = { "stopTime" : 2.1 , "tolerance" : " 1.2e-08"} )
8181 d = mod .getSimulationOptions ()
8282 assert d ["stopTime" ] == "2.1"
8383 assert d ["tolerance" ] == "1.2e-08"
@@ -119,7 +119,7 @@ def test_getSolutions(model_firstorder):
119119 a = - 1
120120 tau = - 1 / a
121121 stopTime = 5 * tau
122- mod .setSimulationOptions ([ f"stopTime= { stopTime } " , "stepSize= 0.1" , "tolerance= 1e-8" ] )
122+ mod .setSimulationOptions (simOptions = { " stopTime" : stopTime , "stepSize" : 0.1 , "tolerance" : 1e-8 } )
123123 mod .simulate ()
124124
125125 x = mod .getSolutions ("x" )
@@ -298,7 +298,7 @@ def test_getters(tmp_path):
298298 x0 = 1.0
299299 x_analytical = - b / a + (x0 + b / a ) * np .exp (a * stopTime )
300300 dx_analytical = (x0 + b / a ) * a * np .exp (a * stopTime )
301- mod .setSimulationOptions (f"stopTime= { stopTime } " )
301+ mod .setSimulationOptions (simOptions = { " stopTime" : stopTime } )
302302 mod .simulate ()
303303
304304 # getOutputs after simulate()
@@ -327,7 +327,7 @@ def test_getters(tmp_path):
327327 mod .getContinuous ("a" ) # a is a parameter
328328
329329 with pytest .raises (OMPython .ModelicaSystemError ):
330- mod .setSimulationOptions ("thisOptionDoesNotExist=3" )
330+ mod .setSimulationOptions (simOptions = { "thisOptionDoesNotExist" : 3 } )
331331
332332
333333def test_simulate_inputs (tmp_path ):
@@ -345,7 +345,7 @@ def test_simulate_inputs(tmp_path):
345345""" )
346346 mod = OMPython .ModelicaSystem (fileName = model_file .as_posix (), modelName = "M_input" )
347347
348- mod .setSimulationOptions ("stopTime= 1.0" )
348+ mod .setSimulationOptions (simOptions = { "stopTime" : 1.0 } )
349349
350350 # integrate zero (no setInputs call) - it should default to None -> 0
351351 assert mod .getInputs () == {
0 commit comments