Skip to content

Commit

Permalink
definition and pathfile name
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin CO committed Mar 3, 2025
1 parent cd191e1 commit d59cb74
Show file tree
Hide file tree
Showing 3 changed files with 1,052 additions and 1,047 deletions.
10 changes: 5 additions & 5 deletions tests/shard1/test_ivp.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
tested_index = np.linspace(0, 330, 34, dtype=int)


def test_values(result, tested_values):
def check_values(result, tested_values):
for i in range(len(tested_values)):
np.testing.assert_almost_equal(
result[tested_index[i]],
Expand Down Expand Up @@ -113,7 +113,7 @@ def test_ding2003_ivp(model):
268.88100073943167,
]

test_values(result["F"][0], tested_values)
check_values(result["F"][0], tested_values)


ding2007_model = ModelMaker.create_model("ding2007", stim_time=stim_time, sum_stim_truncation=10)
Expand Down Expand Up @@ -210,7 +210,7 @@ def test_ding2007_ivp(model):
193.8469562724926,
]

test_values(result["F"][0], tested_values)
check_values(result["F"][0], tested_values)


hmed2018_model = ModelMaker.create_model("hmed2018", stim_time=stim_time, sum_stim_truncation=10)
Expand Down Expand Up @@ -305,7 +305,7 @@ def test_hmed2018_ivp(model):
268.224267798157,
]

test_values(result["F"][0], tested_values)
check_values(result["F"][0], tested_values)


ding2003_with_fatigue_model = ModelMaker.create_model(
Expand Down Expand Up @@ -417,7 +417,7 @@ def test_pulse_mode_ivp(pulse_mode):
228.37937196951108,
]

test_values(result["F"][0], tested_values)
check_values(result["F"][0], tested_values)


def test_ivp_methods():
Expand Down
7 changes: 6 additions & 1 deletion tests/shard1/test_run_examples.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import importlib
import pytest

Expand Down Expand Up @@ -28,9 +29,13 @@ def test_examples(module_name):
"examples.getting_started.pulse_intensity_optimization_multibody",
"examples.getting_started.pulse_width_optimization_multibody",
]
from examples.model_msk import init as model_path

biomodel_folder = os.path.dirname(model_path.__file__)
biorbd_model_path = biomodel_folder + "/arm26_biceps_1dof.bioMod"


@pytest.mark.parametrize("module_name", MULTIBODY_EXAMPLE_MODULES)
def test_multibody_examples(module_name):
ocp_module = importlib.import_module(module_name)
ocp_module.main(plot=False, biorbd_path="../../examples/model_msk/arm26_biceps_1dof.bioMod")
ocp_module.main(plot=False, biorbd_path=biorbd_model_path)
Loading

0 comments on commit d59cb74

Please sign in to comment.