diff --git a/pypesto/objective/amici/amici.py b/pypesto/objective/amici/amici.py index 6edbe1dde..d9fd371a3 100644 --- a/pypesto/objective/amici/amici.py +++ b/pypesto/objective/amici/amici.py @@ -713,3 +713,9 @@ def update_from_problem( ) in condition_mapping.map_sim_fix.items(): if (val := id_to_val.get(mapped_to_par)) is not None: condition_mapping.map_sim_fix[model_par] = val + for ( + model_par, + mapped_to_par, + ) in condition_mapping.map_preeq_fix.items(): + if (val := id_to_val.get(mapped_to_par)) is not None: + condition_mapping.map_preeq_fix[model_par] = val diff --git a/setup.cfg b/setup.cfg index bc28ae610..d9eb70919 100644 --- a/setup.cfg +++ b/setup.cfg @@ -105,7 +105,8 @@ ipopt = dlib = dlib >= 19.19.0 nlopt = - nlopt >= 2.6.2 + # != 2.9.0: https://github.com/stevengj/nlopt/issues/575 + nlopt >= 2.6.2, != 2.9.0 pyswarm = pyswarm >= 0.6 cma = diff --git a/test/base/test_engine.py b/test/base/test_engine.py index 6db8e79c3..1481c4ca1 100644 --- a/test/base/test_engine.py +++ b/test/base/test_engine.py @@ -86,7 +86,14 @@ def test_deepcopy_objective(): ) ) factory = petab_importer.create_objective_creator() - objective = factory.create_objective() + amici_model = factory.create_model() + amici_model.setSteadyStateSensitivityMode( + amici.SteadyStateSensitivityMode.integrateIfNewtonFails + ) + amici_model.setSteadyStateComputationMode( + amici.SteadyStateComputationMode.integrateIfNewtonFails + ) + objective = factory.create_objective(model=amici_model) objective.amici_solver.setSensitivityMethod( amici.SensitivityMethod_adjoint diff --git a/test/petab/test_amici_objective.py b/test/petab/test_amici_objective.py index 274962fc1..5ff4512b4 100644 --- a/test/petab/test_amici_objective.py +++ b/test/petab/test_amici_objective.py @@ -86,12 +86,21 @@ def test_preeq_guesses(): importer = pypesto.petab.PetabImporter.from_yaml( os.path.join(models.MODELS_DIR, model_name, model_name + ".yaml") ) - problem = importer.create_problem() - obj = problem.objective - obj.amici_solver.setNewtonMaxSteps(0) + obj_creator = importer.create_objective_creator() + amici_model = obj_creator.create_model() + amici_model.setSteadyStateComputationMode( + amici.SteadyStateComputationMode.integrateIfNewtonFails + ) + amici_model.setSteadyStateSensitivityMode( + amici.SteadyStateSensitivityMode.integrateIfNewtonFails + ) + obj = obj_creator.create_objective(model=amici_model) + problem = importer.create_problem(objective=obj) obj.amici_model.setSteadyStateSensitivityMode( amici.SteadyStateSensitivityMode.integrationOnly ) + obj = problem.objective + obj.amici_solver.setNewtonMaxSteps(0) obj.amici_solver.setAbsoluteTolerance(1e-12) obj.amici_solver.setRelativeTolerance(1e-12) diff --git a/test/petab/test_petab_import.py b/test/petab/test_petab_import.py index 1ce935880..d4a39f6d5 100644 --- a/test/petab/test_petab_import.py +++ b/test/petab/test_petab_import.py @@ -36,12 +36,13 @@ def setUpClass(cls): cls.obj_edatas = [] def test_0_import(self): - for model_name in ["Zheng_PNAS2012", "Boehm_JProteomeRes2014"]: + for model_name in [ + "Zheng_PNAS2012", + "Boehm_JProteomeRes2014", + "Weber_BMC2015", + ]: # test yaml import for one model: - yaml_config = os.path.join( - models.MODELS_DIR, model_name, model_name + ".yaml" - ) - petab_problem = petab.Problem.from_yaml(yaml_config) + petab_problem = models.get_problem(model_name) self.petab_problems.append(petab_problem) def test_1_compile(self):