From 6e317db838bf72cb88d574820fc32d8ea45b42e5 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Wed, 22 Nov 2023 19:10:17 +0100 Subject: [PATCH] .. --- python/sdist/amici/petab/sbml_import.py | 2 +- python/tests/test_petab_import.py | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/python/sdist/amici/petab/sbml_import.py b/python/sdist/amici/petab/sbml_import.py index 935a529c9b..6388d6f8b0 100644 --- a/python/sdist/amici/petab/sbml_import.py +++ b/python/sdist/amici/petab/sbml_import.py @@ -322,7 +322,7 @@ def import_model_sbml( # fixed_parameters.extend( - get_fixed_parameters( + _get_fixed_parameters_sbml( petab_problem=petab_problem, non_estimated_parameters_as_constants=non_estimated_parameters_as_constants, ) diff --git a/python/tests/test_petab_import.py b/python/tests/test_petab_import.py index fc978b76ea..7a476f272d 100644 --- a/python/tests/test_petab_import.py +++ b/python/tests/test_petab_import.py @@ -6,7 +6,6 @@ from amici.testing import TemporaryDirectoryWinSafe, skip_on_valgrind petab = pytest.importorskip("petab", reason="Missing petab") -amici_petab_import = pytest.importorskip("amici.petab_import") @pytest.fixture @@ -47,6 +46,9 @@ def test_get_fixed_parameters(simple_sbml_model): p4: not fixed (via parameter table `estimate=1`) p5: fixed (implicitly, because not listed as estimated) """ + from amici.petab.sbml_import import ( + _get_fixed_parameters_sbml as get_fixed_parameters, + ) from petab.models.sbml_model import SbmlModel sbml_doc, sbml_model = simple_sbml_model @@ -71,14 +73,14 @@ def test_get_fixed_parameters(simple_sbml_model): parameter_df=parameter_df, condition_df=condition_df, ) - assert set(amici_petab_import.get_fixed_parameters(petab_problem)) == { + assert set(get_fixed_parameters(petab_problem)) == { "p1", "p3", "p5", } assert set( - amici_petab_import.get_fixed_parameters( + get_fixed_parameters( petab_problem, non_estimated_parameters_as_constants=False ) ) == {"p1", "p5"} @@ -86,6 +88,7 @@ def test_get_fixed_parameters(simple_sbml_model): @skip_on_valgrind def test_default_output_parameters(simple_sbml_model): + from amici.petab.petab_import import import_model from petab.models.sbml_model import SbmlModel sbml_doc, sbml_model = simple_sbml_model @@ -116,7 +119,7 @@ def test_default_output_parameters(simple_sbml_model): ) with TemporaryDirectoryWinSafe() as outdir: - sbml_importer = amici_petab_import.import_model( + sbml_importer = import_model( petab_problem=petab_problem, output_parameter_defaults={"observableParameter1_obs1": 1.0}, compile=False, @@ -130,7 +133,7 @@ def test_default_output_parameters(simple_sbml_model): ) with pytest.raises(ValueError): - amici_petab_import.import_model( + import_model( petab_problem=petab_problem, output_parameter_defaults={"nonExistentParameter": 1.0}, compile=False,