Skip to content

Commit

Permalink
Merge branch 'develop' into 1512_sacess_errs
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl authored Nov 26, 2024
2 parents 217b380 + 6c049f5 commit a3511d8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
9 changes: 8 additions & 1 deletion test/base/test_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 12 additions & 3 deletions test/petab/test_amici_objective.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit a3511d8

Please sign in to comment.