diff --git a/pytest.ini b/pytest.ini index 3868c80b1e..4f682576a3 100644 --- a/pytest.ini +++ b/pytest.ini @@ -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 diff --git a/python/sdist/amici/petab/simulations.py b/python/sdist/amici/petab/simulations.py index e80e40a94b..2cbed98dce 100644 --- a/python/sdist/amici/petab/simulations.py +++ b/python/sdist/amici/petab/simulations.py @@ -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: diff --git a/tests/benchmark-models/test_petab_benchmark.py b/tests/benchmark-models/test_petab_benchmark.py index 976ff3dc05..47bf503984 100644 --- a/tests/benchmark-models/test_petab_benchmark.py +++ b/tests/benchmark-models/test_petab_benchmark.py @@ -36,6 +36,7 @@ "Isensee_JCB2018", "Beer_MolBioSystems2014", "Alkan_SciSignal2018", + "Lang_PLOSComputBiol2024", # excluded due to excessive numerical failures "Crauste_CellSystems2017", "Fujita_SciSignal2010",