Skip to content

Commit

Permalink
Merge branch 'develop' into cmakebuildext
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl authored May 15, 2024
2 parents 1714cce + 44ed074 commit 2be4b4c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 21 deletions.
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ filterwarnings =
ignore:The --rsyncdir command line argument and rsyncdirs config variable are deprecated.:DeprecationWarning
ignore:.*:ImportWarning:tellurium
ignore:.*PyDevIPCompleter6.*:DeprecationWarning
# ignore numpy log(0) warnings (np.log(0) = -inf)
ignore:divide by zero encountered in log:RuntimeWarning

norecursedirs = .git amici_models build doc documentation matlab models ThirdParty amici sdist examples
45 changes: 24 additions & 21 deletions python/sdist/amici/petab/simulations.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,30 +166,33 @@ def simulate_petab(
amici_model=amici_model,
)

if problem_parameters is not None and not scaled_parameters:
problem_parameters = petab_problem.scale_parameters(problem_parameters)
scaled_parameters = True

if problem_parameters is None:
# scaled PEtab nominal values
problem_parameters = dict(
zip(
petab_problem.x_ids,
petab_problem.x_nominal_scaled,
strict=True,
)
problem_parameters = {}

# scaled PEtab nominal values
default_problem_parameters = dict(
zip(
petab_problem.x_ids,
petab_problem.get_x_nominal(scaled=scaled_parameters),
strict=True,
)
# depending on `fill_fixed_parameters` for parameter mapping, the
# parameter mapping may contain values instead of symbols for fixed
# parameters. In this case, we need to filter them here to avoid
# warnings in `fill_in_parameters`.
free_parameters = parameter_mapping.free_symbols
problem_parameters = {
par_id: par_value
for par_id, par_value in problem_parameters.items()
if par_id in free_parameters
}

elif not scaled_parameters:
problem_parameters = petab_problem.scale_parameters(problem_parameters)
)
# depending on `fill_fixed_parameters` for parameter mapping, the
# parameter mapping may contain values instead of symbols for fixed
# parameters. In this case, we need to filter them here to avoid
# warnings in `fill_in_parameters`.
free_parameters = parameter_mapping.free_symbols
default_problem_parameters = {
par_id: par_value
for par_id, par_value in default_problem_parameters.items()
if par_id in free_parameters
}

scaled_parameters = True
problem_parameters = default_problem_parameters | problem_parameters

# Get edatas
if edatas is None:
Expand Down
1 change: 1 addition & 0 deletions tests/benchmark-models/test_petab_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"Isensee_JCB2018",
"Beer_MolBioSystems2014",
"Alkan_SciSignal2018",
"Lang_PLOSComputBiol2024",
# excluded due to excessive numerical failures
"Crauste_CellSystems2017",
"Fujita_SciSignal2010",
Expand Down

0 comments on commit 2be4b4c

Please sign in to comment.