Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default steady-state method to integrationOnly #2574

Merged
merged 1 commit into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/amici/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -2063,12 +2063,12 @@ class Model : public AbstractModel, public ModelDimensions {

/** method for steady-state computation */
SteadyStateComputationMode steadystate_computation_mode_{
SteadyStateComputationMode::integrateIfNewtonFails
SteadyStateComputationMode::integrationOnly
};

/** method for steadystate sensitivities computation */
SteadyStateSensitivityMode steadystate_sensitivity_mode_{
SteadyStateSensitivityMode::integrateIfNewtonFails
SteadyStateSensitivityMode::integrationOnly
};

/**
Expand Down
2 changes: 2 additions & 0 deletions python/tests/test_compare_conservation_laws_sbml.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def get_results(
sensi_order=0,
sensi_meth=amici.SensitivityMethod.forward,
sensi_meth_preeq=amici.SensitivityMethod.forward,
stst_mode=amici.SteadyStateComputationMode.integrateIfNewtonFails,
stst_sensi_mode=amici.SteadyStateSensitivityMode.newtonOnly,
reinitialize_states=False,
):
Expand All @@ -115,6 +116,7 @@ def get_results(
solver.setSensitivityMethodPreequilibration(sensi_meth_preeq)
solver.setSensitivityMethod(sensi_meth)
model.setSteadyStateSensitivityMode(stst_sensi_mode)
model.setSteadyStateComputationMode(stst_mode)
if edata is None:
model.setTimepoints(np.linspace(0, 5, 101))
else:
Expand Down
7 changes: 6 additions & 1 deletion python/tests/test_preequilibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@
def preeq_fixture(pysb_example_presimulation_module):
model = pysb_example_presimulation_module.getModel()
model.setReinitializeFixedParameterInitialStates(True)

model.setSteadyStateComputationMode(
amici.SteadyStateComputationMode.integrateIfNewtonFails
)
model.setSteadyStateSensitivityMode(
amici.SteadyStateSensitivityMode.integrateIfNewtonFails
)
solver = model.getSolver()
solver.setSensitivityOrder(amici.SensitivityOrder.first)
solver.setSensitivityMethod(amici.SensitivityMethod.forward)
Expand Down
7 changes: 7 additions & 0 deletions python/tests/test_pregenerated_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ def test_pregenerated_model(sub_test, case):
amici.readModelDataFromHDF5(
options_file, model.get(), f"/{sub_test}/{case}/options"
)
if model_name == "model_steadystate":
model.setSteadyStateComputationMode(
amici.SteadyStateComputationMode.integrateIfNewtonFails
)
model.setSteadyStateSensitivityMode(
amici.SteadyStateSensitivityMode.integrateIfNewtonFails
)
amici.readSolverSettingsFromHDF5(
options_file, solver.get(), f"/{sub_test}/{case}/options"
)
Expand Down
8 changes: 4 additions & 4 deletions python/tests/test_swig_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ def test_copy_constructors(pysb_example_presimulation_module):
# `pysb_example_presimulation_module.getModel()`.
"StateIsNonNegative": None,
"SteadyStateComputationMode": [
2,
1,
amici.SteadyStateComputationMode.integrationOnly,
amici.SteadyStateComputationMode.integrateIfNewtonFails,
],
"SteadyStateSensitivityMode": [
2,
1,
amici.SteadyStateSensitivityMode.integrationOnly,
amici.SteadyStateSensitivityMode.integrateIfNewtonFails,
],
("t0", "setT0"): [
0.0,
Expand Down
Loading