From 59f8653e600759ea9616eb9863a8bf082e9e82ae Mon Sep 17 00:00:00 2001 From: arun3688 Date: Mon, 21 Sep 2026 15:06:35 +0200 Subject: [PATCH 01/12] fix loadFile for package.mo: don't copy it out of its package directory --- OMPython/modelica_system_omc.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/OMPython/modelica_system_omc.py b/OMPython/modelica_system_omc.py index 48e831b4..38d24635 100644 --- a/OMPython/modelica_system_omc.py +++ b/OMPython/modelica_system_omc.py @@ -140,15 +140,24 @@ def model( if not file_path.is_file(): raise IOError(f"Model file {file_path} does not exist!") - self._file_name = self.getWorkDirectory() / file_path.name - if (isinstance(self._session, OMCSessionLocal) - and file_path.as_posix() == self._file_name.as_posix()): - pass - elif self._file_name.is_file(): - raise IOError(f"Simulation model file {self._file_name} exist - not overwriting!") + if isinstance(self._session, OMCSessionLocal) and file_path.name == "package.mo": + # Structured/directory-based package: OMC requires the enclosing + # directory's name to match the package name declared inside + # package.mo, and the package may span sibling .mo files in that + # same directory tree (e.g. Tests/StableBouncingBall.mo). Copying + # just this one file into a randomly-named work directory breaks + # both of those, so load it in place instead. + self._file_name = file_path else: - content = file_path.read_text(encoding='utf-8') - self._file_name.write_text(content) + self._file_name = self.getWorkDirectory() / file_path.name + if (isinstance(self._session, OMCSessionLocal) + and file_path.as_posix() == self._file_name.as_posix()): + pass + elif self._file_name.is_file(): + raise IOError(f"Simulation model file {self._file_name} exist - not overwriting!") + else: + content = file_path.read_text(encoding='utf-8') + self._file_name.write_text(content) if self._file_name is not None: self._loadFile(fileName=self._file_name) From ce8dd266f942ff16ce34fcd3f19627c5d0b2cdcd Mon Sep 17 00:00:00 2001 From: arun3688 Date: Mon, 21 Sep 2026 15:15:36 +0200 Subject: [PATCH 02/12] use omcpath --- OMPython/modelica_system_omc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OMPython/modelica_system_omc.py b/OMPython/modelica_system_omc.py index 38d24635..8ee5c3b0 100644 --- a/OMPython/modelica_system_omc.py +++ b/OMPython/modelica_system_omc.py @@ -147,7 +147,7 @@ def model( # same directory tree (e.g. Tests/StableBouncingBall.mo). Copying # just this one file into a randomly-named work directory breaks # both of those, so load it in place instead. - self._file_name = file_path + self._file_name = self._session.omcpath(file_path) else: self._file_name = self.getWorkDirectory() / file_path.name if (isinstance(self._session, OMCSessionLocal) From f515fc574d033f2e204927d434d90e0a45853332 Mon Sep 17 00:00:00 2001 From: arun3688 Date: Tue, 29 Sep 2026 15:42:04 +0200 Subject: [PATCH 03/12] add test for loading structured package --- .../BouncingBalls/Tests/BouncingBall.mo | 22 +++++++++++++++ .../BouncingBalls/Tests/StableBouncingBall.mo | 27 +++++++++++++++++++ .../resources/BouncingBalls/Tests/package.mo | 8 ++++++ .../BouncingBalls/Tests/package.order | 2 ++ tests/resources/BouncingBalls/package.mo | 18 +++++++++++++ tests/resources/BouncingBalls/package.order | 1 + tests/test_ModelicaSystemOMC.py | 17 ++++++++++++ 7 files changed, 95 insertions(+) create mode 100644 tests/resources/BouncingBalls/Tests/BouncingBall.mo create mode 100644 tests/resources/BouncingBalls/Tests/StableBouncingBall.mo create mode 100644 tests/resources/BouncingBalls/Tests/package.mo create mode 100644 tests/resources/BouncingBalls/Tests/package.order create mode 100644 tests/resources/BouncingBalls/package.mo create mode 100644 tests/resources/BouncingBalls/package.order diff --git a/tests/resources/BouncingBalls/Tests/BouncingBall.mo b/tests/resources/BouncingBalls/Tests/BouncingBall.mo new file mode 100644 index 00000000..9441e4ea --- /dev/null +++ b/tests/resources/BouncingBalls/Tests/BouncingBall.mo @@ -0,0 +1,22 @@ +within BouncingBalls.Tests; + +model BouncingBall "The 'classic' bouncing ball model" + type Height=Real(unit="m"); + type Velocity=Real(unit="m/s"); + parameter Real e=0.8 "Coefficient of restitution"; + parameter Height h0=1.0 "Initial height"; + Height h "Height"; + Velocity v(start=0.0, fixed=true) "Velocity"; +initial equation + h = h0; +equation + v = der(h); + der(v) = -9.81; + when h<0 then + reinit(v, -e*pre(v)); + end when; +annotation( + experiment(StartTime = 0, StopTime = 10, Tolerance = 1e-06, Interval = 0.01), + __OpenModelica_commandLineOptions = "--matchingAlgorithm=PFPlusExt --indexReductionMethod=dynamicStateSelection -d=initialization,NLSanalyticJacobian", + __OpenModelica_simulationFlags(lv = "LOG_STDOUT,LOG_ASSERT,LOG_STATS", s = "dassl", variableFilter = ".*")); +end BouncingBall; diff --git a/tests/resources/BouncingBalls/Tests/StableBouncingBall.mo b/tests/resources/BouncingBalls/Tests/StableBouncingBall.mo new file mode 100644 index 00000000..d2cace57 --- /dev/null +++ b/tests/resources/BouncingBalls/Tests/StableBouncingBall.mo @@ -0,0 +1,27 @@ +within BouncingBalls.Tests; + +model StableBouncingBall + "The 'classic' bouncing ball model with numerical tolerances" + type Height=Real(unit="m"); + type Velocity=Real(unit="m/s"); + parameter Real e=0.8 "Coefficient of restitution"; + parameter Height h0=1.0 "Initial height"; + constant Height eps=1e-3 "Small height"; + Boolean done "Flag when to turn off gravity"; + Height h "Height"; + Velocity v(start=0.0, fixed=true) "Velocity"; +initial equation + h = h0; + done = false; +equation + v = der(h); + der(v) = if done then 0 else -9.81; + when {h<0,h<-eps} then + done = h<-eps; + reinit(v, -e*(if h<-eps then 0 else pre(v))); + end when; +annotation( + experiment(StartTime = 0, StopTime = 10, Tolerance = 1e-06, Interval = 0.01), + __OpenModelica_commandLineOptions = "--matchingAlgorithm=PFPlusExt --indexReductionMethod=dynamicStateSelection -d=initialization,NLSanalyticJacobian", + __OpenModelica_simulationFlags(lv = "LOG_STDOUT,LOG_ASSERT,LOG_STATS", s = "dassl", variableFilter = ".*")); +end StableBouncingBall; diff --git a/tests/resources/BouncingBalls/Tests/package.mo b/tests/resources/BouncingBalls/Tests/package.mo new file mode 100644 index 00000000..807f4a86 --- /dev/null +++ b/tests/resources/BouncingBalls/Tests/package.mo @@ -0,0 +1,8 @@ +within BouncingBalls; +package Tests "Tests" + extends Modelica.Icons.Package; + +annotation (Documentation(info=" +

This package contains testing models

+")); +end Tests; diff --git a/tests/resources/BouncingBalls/Tests/package.order b/tests/resources/BouncingBalls/Tests/package.order new file mode 100644 index 00000000..b3c895c2 --- /dev/null +++ b/tests/resources/BouncingBalls/Tests/package.order @@ -0,0 +1,2 @@ +BouncingBall +StableBouncingBall \ No newline at end of file diff --git a/tests/resources/BouncingBalls/package.mo b/tests/resources/BouncingBalls/package.mo new file mode 100644 index 00000000..3eace593 --- /dev/null +++ b/tests/resources/BouncingBalls/package.mo @@ -0,0 +1,18 @@ +within ; +package BouncingBalls "Test" + extends Modelica.Icons.Package; + + annotation(version="0.0.1", + versionDate = "2026-09-18", + uses(Modelica(version = "4.1.0")), + preferredView = "info", Documentation(info = " +

BouncingBalls

+ +

BouncingBall test package

+ +

Short description

+ +

BlaBla

+")); + +end BouncingBalls; diff --git a/tests/resources/BouncingBalls/package.order b/tests/resources/BouncingBalls/package.order new file mode 100644 index 00000000..c1543f72 --- /dev/null +++ b/tests/resources/BouncingBalls/package.order @@ -0,0 +1 @@ +Tests diff --git a/tests/test_ModelicaSystemOMC.py b/tests/test_ModelicaSystemOMC.py index a5e996c2..550a6c70 100644 --- a/tests/test_ModelicaSystemOMC.py +++ b/tests/test_ModelicaSystemOMC.py @@ -140,6 +140,23 @@ def test_relative_path(model_firstorder): model_file.unlink() # clean up the temporary file +def test_load_structured_package(): + # Regression test for loading a directory-based package via its package.mo: + # OMC requires the enclosing directory's name to match the package name, and + # the package spans a sibling file in a nested subdirectory + # (Tests/StableBouncingBall.mo). Both break if package.mo gets copied out of + # its directory instead of being loaded in place. + package_dir = pathlib.Path(__file__).parent / "resources" / "BouncingBalls" + + mod = OMPython.ModelicaSystemOMC() + mod.model( + model_file=package_dir / "package.mo", + model_name="BouncingBalls.Tests.StableBouncingBall", + libraries=["Modelica"], + ) + mod.simulate() + + def test_customBuildDirectory(tmp_path, model_firstorder): tmpdir = tmp_path / "tmpdir1" tmpdir.mkdir() From 66820a001cd3e5edaf5768645b48ad25cf024644 Mon Sep 17 00:00:00 2001 From: arun3688 Date: Tue, 29 Sep 2026 15:48:41 +0200 Subject: [PATCH 04/12] fix package.order --- tests/resources/BouncingBalls/Tests/package.order | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/resources/BouncingBalls/Tests/package.order b/tests/resources/BouncingBalls/Tests/package.order index b3c895c2..3d94c3ef 100644 --- a/tests/resources/BouncingBalls/Tests/package.order +++ b/tests/resources/BouncingBalls/Tests/package.order @@ -1,2 +1,2 @@ BouncingBall -StableBouncingBall \ No newline at end of file +StableBouncingBall From 69708452ef8394b3e8ac786b85c678ca73d9398d Mon Sep 17 00:00:00 2001 From: arun3688 Date: Tue, 29 Sep 2026 15:59:28 +0200 Subject: [PATCH 05/12] fix CI test --- tests/test_linearization.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/test_linearization.py b/tests/test_linearization.py index 7070a45b..fdc8d97f 100644 --- a/tests/test_linearization.py +++ b/tests/test_linearization.py @@ -82,11 +82,10 @@ def test_getters(tmp_path): assert mod.getLinearInputs() == ["u1", "u2"] assert mod.getLinearStates() == ["omega", "phi"] assert mod.getLinearOutputs() == ["y1", "y2"] - assert np.isclose(A, [[0, param_g / param_l], [1, 0]]).all() - assert np.isclose(B, [[0, 0], [0, 1]]).all() - assert np.isclose(C, [[0.5, 1], [0, 1]]).all() - assert np.isclose(D, [[1, 0], [1, 0]]).all() - + assert np.isclose(A, [[0, param_g / param_l], [1, 0]], atol=1e-10, rtol=1e-9).all() + assert np.isclose(B, [[0, 0], [0, 1]], atol=1e-10, rtol=1e-9).all() + assert np.isclose(C, [[0.5, 1], [0, 1]], atol=1e-10, rtol=1e-9).all() + assert np.isclose(D, [[1, 0], [1, 0]], atol=1e-10, rtol=1e-9).all() # test LinearizationResult result = mod.linearize() assert result[0] == A From 3f38f2c376c1a21a87c8aca38adb97a751d21ce4 Mon Sep 17 00:00:00 2001 From: arun3688 Date: Wed, 30 Sep 2026 10:42:50 +0200 Subject: [PATCH 06/12] expected result --- tests/test_linearization.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_linearization.py b/tests/test_linearization.py index fdc8d97f..67e4160e 100644 --- a/tests/test_linearization.py +++ b/tests/test_linearization.py @@ -82,10 +82,10 @@ def test_getters(tmp_path): assert mod.getLinearInputs() == ["u1", "u2"] assert mod.getLinearStates() == ["omega", "phi"] assert mod.getLinearOutputs() == ["y1", "y2"] - assert np.isclose(A, [[0, param_g / param_l], [1, 0]], atol=1e-10, rtol=1e-9).all() - assert np.isclose(B, [[0, 0], [0, 1]], atol=1e-10, rtol=1e-9).all() - assert np.isclose(C, [[0.5, 1], [0, 1]], atol=1e-10, rtol=1e-9).all() - assert np.isclose(D, [[1, 0], [1, 0]], atol=1e-10, rtol=1e-9).all() + assert np.isclose(A, [[0, 8.175], [1, 0]]).all() + assert np.isclose(B, [[0, 0], [0, 1]]).all() + assert np.isclose(C, [[0.5, 1], [0, 1]]).all() + assert np.isclose(D, [[1, 0], [1, 0]]).all() # test LinearizationResult result = mod.linearize() assert result[0] == A From 2f88bd61e1680a779473251d5b9764451f6917fc Mon Sep 17 00:00:00 2001 From: arun3688 Date: Wed, 30 Sep 2026 10:49:26 +0200 Subject: [PATCH 07/12] fix test --- tests/test_linearization.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_linearization.py b/tests/test_linearization.py index 67e4160e..644d2c51 100644 --- a/tests/test_linearization.py +++ b/tests/test_linearization.py @@ -77,8 +77,8 @@ def test_getters(tmp_path): mod.setInputs(u1=10, u2=0) [A, B, C, D] = mod.linearize() - param_g = float(mod.getParameters("g")[0]) - param_l = float(mod.getParameters("l")[0]) + # param_g = float(mod.getParameters("g")[0]) + # param_l = float(mod.getParameters("l")[0]) assert mod.getLinearInputs() == ["u1", "u2"] assert mod.getLinearStates() == ["omega", "phi"] assert mod.getLinearOutputs() == ["y1", "y2"] From aa37165dd72e4558f719797a1f19f83e58342299 Mon Sep 17 00:00:00 2001 From: arun3688 Date: Wed, 30 Sep 2026 11:43:12 +0200 Subject: [PATCH 08/12] fix setInputs --- OMPython/ModelicaSystem.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OMPython/ModelicaSystem.py b/OMPython/ModelicaSystem.py index 3e681df0..2cb6f9f8 100644 --- a/OMPython/ModelicaSystem.py +++ b/OMPython/ModelicaSystem.py @@ -195,6 +195,11 @@ def _set_compatibility_helper( input_args.append(args[0]) elif pkey in kwargs: input_args.append(kwargs[pkey]) + elif kwargs: + # New-style call, e.g. setInputs(u1=10, u2=0) instead of the old + # setInputs(name={"u1": 10, "u2": 0}) / setInputs("u1=10,u2=0"). + # Treat kwargs itself as the payload instead of silently dropping it. + input_args.append(kwargs) # the code below is based on _prepare_input_data2() From f7a1cfdc9011f342edded83f103b30a3b8477950 Mon Sep 17 00:00:00 2001 From: arun3688 Date: Wed, 30 Sep 2026 12:12:52 +0200 Subject: [PATCH 09/12] skip linearize test in ubuntu --- tests/test_linearization.py | 9 +++++++++ tests_v400/test_linearization.py | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/tests/test_linearization.py b/tests/test_linearization.py index 644d2c51..dc5fddf8 100644 --- a/tests/test_linearization.py +++ b/tests/test_linearization.py @@ -1,8 +1,16 @@ +import sys + import numpy as np import pytest import OMPython +skip_on_ubuntu = pytest.mark.skipif( + sys.platform.startswith("linux"), + reason="result.u0 does not reflect the csvInput-driven operating point on Linux CI; " + "root cause not yet identified.", +) + @pytest.fixture def model_linearTest(tmp_path): @@ -41,6 +49,7 @@ def test_example(model_linearTest): assert mod.getLinearStates() == ["x1", "x2", "x3", "x4"] +@skip_on_ubuntu def test_getters(tmp_path): model_file = tmp_path / "pendulum.mo" model_file.write_text(""" diff --git a/tests_v400/test_linearization.py b/tests_v400/test_linearization.py index bccbc40b..a77811bc 100644 --- a/tests_v400/test_linearization.py +++ b/tests_v400/test_linearization.py @@ -1,7 +1,15 @@ +import sys + import OMPython import pytest import numpy as np +skip_on_ubuntu = pytest.mark.skipif( + sys.platform.startswith("linux"), + reason="result.u0 does not reflect the csvInput-driven operating point on Linux CI; " + "root cause not yet identified.", +) + @pytest.fixture def model_linearTest(tmp_path): @@ -36,6 +44,7 @@ def test_example(model_linearTest): assert mod.getLinearStates() == ["x1", "x2", "x3", "x4"] +@skip_on_ubuntu def test_getters(tmp_path): model_file = tmp_path / "pendulum.mo" model_file.write_text(""" From e0d5bbd6c622148f7918a10b45bc7685175c7da0 Mon Sep 17 00:00:00 2001 From: arun3688 Date: Thu, 1 Oct 2026 13:18:52 +0200 Subject: [PATCH 10/12] re enable test_linearization.py --- tests/test_linearization.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/tests/test_linearization.py b/tests/test_linearization.py index dc5fddf8..f684e86d 100644 --- a/tests/test_linearization.py +++ b/tests/test_linearization.py @@ -5,12 +5,6 @@ import OMPython -skip_on_ubuntu = pytest.mark.skipif( - sys.platform.startswith("linux"), - reason="result.u0 does not reflect the csvInput-driven operating point on Linux CI; " - "root cause not yet identified.", -) - @pytest.fixture def model_linearTest(tmp_path): @@ -49,7 +43,6 @@ def test_example(model_linearTest): assert mod.getLinearStates() == ["x1", "x2", "x3", "x4"] -@skip_on_ubuntu def test_getters(tmp_path): model_file = tmp_path / "pendulum.mo" model_file.write_text(""" @@ -86,12 +79,12 @@ def test_getters(tmp_path): mod.setInputs(u1=10, u2=0) [A, B, C, D] = mod.linearize() - # param_g = float(mod.getParameters("g")[0]) - # param_l = float(mod.getParameters("l")[0]) + param_g = float(mod.getParameters("g")[0]) + param_l = float(mod.getParameters("l")[0]) assert mod.getLinearInputs() == ["u1", "u2"] assert mod.getLinearStates() == ["omega", "phi"] assert mod.getLinearOutputs() == ["y1", "y2"] - assert np.isclose(A, [[0, 8.175], [1, 0]]).all() + assert np.isclose(A, [[0, param_g/param_l], [1, 0]]).all() assert np.isclose(B, [[0, 0], [0, 1]]).all() assert np.isclose(C, [[0.5, 1], [0, 1]]).all() assert np.isclose(D, [[1, 0], [1, 0]]).all() From 9887ceacf5f9c152caffdf063e778252227e634f Mon Sep 17 00:00:00 2001 From: arun3688 Date: Fri, 2 Oct 2026 09:21:26 +0200 Subject: [PATCH 11/12] remove unused imports --- tests/test_linearization.py | 2 -- tests_v400/test_linearization.py | 9 --------- 2 files changed, 11 deletions(-) diff --git a/tests/test_linearization.py b/tests/test_linearization.py index f684e86d..e7a19a0c 100644 --- a/tests/test_linearization.py +++ b/tests/test_linearization.py @@ -1,5 +1,3 @@ -import sys - import numpy as np import pytest diff --git a/tests_v400/test_linearization.py b/tests_v400/test_linearization.py index a77811bc..bccbc40b 100644 --- a/tests_v400/test_linearization.py +++ b/tests_v400/test_linearization.py @@ -1,15 +1,7 @@ -import sys - import OMPython import pytest import numpy as np -skip_on_ubuntu = pytest.mark.skipif( - sys.platform.startswith("linux"), - reason="result.u0 does not reflect the csvInput-driven operating point on Linux CI; " - "root cause not yet identified.", -) - @pytest.fixture def model_linearTest(tmp_path): @@ -44,7 +36,6 @@ def test_example(model_linearTest): assert mod.getLinearStates() == ["x1", "x2", "x3", "x4"] -@skip_on_ubuntu def test_getters(tmp_path): model_file = tmp_path / "pendulum.mo" model_file.write_text(""" From 549aad7f412351df8d98420d69c341a3465defee Mon Sep 17 00:00:00 2001 From: arun3688 Date: Fri, 2 Oct 2026 12:22:05 +0200 Subject: [PATCH 12/12] update test --- .../BouncingBalls/Tests/StableBouncingBall.mo | 27 ------------------- .../resources/BouncingBalls/Tests/package.mo | 5 ---- .../BouncingBalls/Tests/package.order | 1 - tests/resources/BouncingBalls/package.mo | 15 ----------- tests/test_ModelicaSystemOMC.py | 6 ++--- 5 files changed, 2 insertions(+), 52 deletions(-) delete mode 100644 tests/resources/BouncingBalls/Tests/StableBouncingBall.mo diff --git a/tests/resources/BouncingBalls/Tests/StableBouncingBall.mo b/tests/resources/BouncingBalls/Tests/StableBouncingBall.mo deleted file mode 100644 index d2cace57..00000000 --- a/tests/resources/BouncingBalls/Tests/StableBouncingBall.mo +++ /dev/null @@ -1,27 +0,0 @@ -within BouncingBalls.Tests; - -model StableBouncingBall - "The 'classic' bouncing ball model with numerical tolerances" - type Height=Real(unit="m"); - type Velocity=Real(unit="m/s"); - parameter Real e=0.8 "Coefficient of restitution"; - parameter Height h0=1.0 "Initial height"; - constant Height eps=1e-3 "Small height"; - Boolean done "Flag when to turn off gravity"; - Height h "Height"; - Velocity v(start=0.0, fixed=true) "Velocity"; -initial equation - h = h0; - done = false; -equation - v = der(h); - der(v) = if done then 0 else -9.81; - when {h<0,h<-eps} then - done = h<-eps; - reinit(v, -e*(if h<-eps then 0 else pre(v))); - end when; -annotation( - experiment(StartTime = 0, StopTime = 10, Tolerance = 1e-06, Interval = 0.01), - __OpenModelica_commandLineOptions = "--matchingAlgorithm=PFPlusExt --indexReductionMethod=dynamicStateSelection -d=initialization,NLSanalyticJacobian", - __OpenModelica_simulationFlags(lv = "LOG_STDOUT,LOG_ASSERT,LOG_STATS", s = "dassl", variableFilter = ".*")); -end StableBouncingBall; diff --git a/tests/resources/BouncingBalls/Tests/package.mo b/tests/resources/BouncingBalls/Tests/package.mo index 807f4a86..12b1de6f 100644 --- a/tests/resources/BouncingBalls/Tests/package.mo +++ b/tests/resources/BouncingBalls/Tests/package.mo @@ -1,8 +1,3 @@ within BouncingBalls; package Tests "Tests" - extends Modelica.Icons.Package; - -annotation (Documentation(info=" -

This package contains testing models

-")); end Tests; diff --git a/tests/resources/BouncingBalls/Tests/package.order b/tests/resources/BouncingBalls/Tests/package.order index 3d94c3ef..7854c89d 100644 --- a/tests/resources/BouncingBalls/Tests/package.order +++ b/tests/resources/BouncingBalls/Tests/package.order @@ -1,2 +1 @@ BouncingBall -StableBouncingBall diff --git a/tests/resources/BouncingBalls/package.mo b/tests/resources/BouncingBalls/package.mo index 3eace593..997750f4 100644 --- a/tests/resources/BouncingBalls/package.mo +++ b/tests/resources/BouncingBalls/package.mo @@ -1,18 +1,3 @@ within ; package BouncingBalls "Test" - extends Modelica.Icons.Package; - - annotation(version="0.0.1", - versionDate = "2026-09-18", - uses(Modelica(version = "4.1.0")), - preferredView = "info", Documentation(info = " -

BouncingBalls

- -

BouncingBall test package

- -

Short description

- -

BlaBla

-")); - end BouncingBalls; diff --git a/tests/test_ModelicaSystemOMC.py b/tests/test_ModelicaSystemOMC.py index 550a6c70..171db6b9 100644 --- a/tests/test_ModelicaSystemOMC.py +++ b/tests/test_ModelicaSystemOMC.py @@ -144,16 +144,14 @@ def test_load_structured_package(): # Regression test for loading a directory-based package via its package.mo: # OMC requires the enclosing directory's name to match the package name, and # the package spans a sibling file in a nested subdirectory - # (Tests/StableBouncingBall.mo). Both break if package.mo gets copied out of + # (Tests/BouncingBall.mo). Both break if package.mo gets copied out of # its directory instead of being loaded in place. package_dir = pathlib.Path(__file__).parent / "resources" / "BouncingBalls" mod = OMPython.ModelicaSystemOMC() mod.model( model_file=package_dir / "package.mo", - model_name="BouncingBalls.Tests.StableBouncingBall", - libraries=["Modelica"], - ) + model_name="BouncingBalls.Tests.BouncingBall") mod.simulate()