Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl committed Nov 22, 2023
1 parent 663efa3 commit 6e317db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion python/sdist/amici/petab/sbml_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def import_model_sbml(
# <EndWorkAround>

fixed_parameters.extend(
get_fixed_parameters(
_get_fixed_parameters_sbml(
petab_problem=petab_problem,
non_estimated_parameters_as_constants=non_estimated_parameters_as_constants,
)
Expand Down
13 changes: 8 additions & 5 deletions python/tests/test_petab_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -71,21 +73,22 @@ 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"}


@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
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 6e317db

Please sign in to comment.