Skip to content

Commit

Permalink
AmiciPetabProblem -> PetabProblem
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl committed Jan 16, 2024
1 parent 9ab1463 commit d806546
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 107 deletions.
119 changes: 23 additions & 96 deletions python/examples/example_petab/petab.ipynb

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions python/sdist/amici/petab/petab_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from .parameter_mapping import create_parameter_mapping


class AmiciPetabProblem:
class PetabProblem:
"""Manage experimental conditions based on a PEtab problem definition.
Create :class:`ExpData` objects from a PEtab problem definition, and handle
Expand Down Expand Up @@ -151,7 +151,7 @@ def get_edata(
NOTE: If ``store_edatas=True`` was passed to the constructor and the
returned object is modified, the changes will be reflected in the
internal `ExpData` objects. Also, if parameter values of
`AmiciPetabProblem` are changed, all `ExpData` objects will be updated.
`PetabProblem` are changed, all `ExpData` objects will be updated.
Create a deep copy if you want to avoid this.
:param condition_id: PEtab condition ID
Expand All @@ -176,7 +176,7 @@ def get_edatas(self):
NOTE: If ``store_edatas=True`` was passed to the constructor and the
returned objects are modified, the changes will be reflected in the
internal `ExpData` objects. Also, if parameter values of
`AmiciPetabProblem` are changed, all `ExpData` objects will be updated.
`PetabProblem` are changed, all `ExpData` objects will be updated.
Create a deep copy if you want to avoid this.
:return: List of ExpData objects
Expand Down
16 changes: 8 additions & 8 deletions python/tests/petab/test_petab_problem.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from amici.petab.petab_problem import AmiciPetabProblem
from amici.petab.petab_problem import PetabProblem
from benchmark_models_petab import get_problem


def test_amici_petab_problem_pregenerate():
"""AmiciPetabProblem with pre-generated ExpDatas"""
"""PetabProblem with pre-generated ExpDatas"""
# any example is fine - the only assumption is that we don't have
# preequilibration
petab_problem = get_problem("Boehm_JProteomeRes2014")
app = AmiciPetabProblem(petab_problem, store_edatas=True)
app = PetabProblem(petab_problem, store_edatas=True)

# ensure all edatas are generated upon construction
assert len(app._edatas) == len(
Expand All @@ -30,11 +30,11 @@ def test_amici_petab_problem_pregenerate():


def test_amici_petab_problem_on_demand():
"""AmiciPetabProblem with on-demand ExpDatas"""
"""PetabProblem with on-demand ExpDatas"""
# any example is fine - the only assumption is that we don't have
# preequilibration
petab_problem = get_problem("Boehm_JProteomeRes2014")
app = AmiciPetabProblem(petab_problem, store_edatas=False)
app = PetabProblem(petab_problem, store_edatas=False)

# ensure no edatas are generated upon construction
assert not app._edatas
Expand Down Expand Up @@ -65,12 +65,12 @@ def test_amici_petab_problem_on_demand():


def test_amici_petab_problem_pregenerate_equals_on_demand():
"""Check that AmiciPetabProblem produces the same ExpDatas
"""Check that PetabProblem produces the same ExpDatas
independent of the `store_edatas` parameter."""
# any example is fine
petab_problem = get_problem("Boehm_JProteomeRes2014")
app_store_true = AmiciPetabProblem(petab_problem, store_edatas=True)
app_store_false = AmiciPetabProblem(petab_problem, store_edatas=False)
app_store_true = PetabProblem(petab_problem, store_edatas=True)
app_store_false = PetabProblem(petab_problem, store_edatas=False)

parameter_update = {app_store_true.model.getParameterIds()[0]: 0.12345}
app_store_true.set_parameters(parameter_update, scaled_parameters=True)
Expand Down

0 comments on commit d806546

Please sign in to comment.