AMICI-dev / AMICI

Advanced Multilanguage Interface to CVODES and IDAS
https://amici.readthedocs.io/
Other
110 stars 31 forks source link

Model::setSteadyStateSensitivityMode affects model simulation even when not computing sensitivities #2575

Closed dweindl closed 2 weeks ago

dweindl commented 2 weeks ago

While working on #2574, I noticed that to keep python/tests/test_pregenerated_models.py::test_pregenerated_model[model_steadystate-nosensi] working, one needs both

amici_model.setSteadyStateComputationMode(amici.SteadyStateComputationMode.integrateIfNewtonFails)
amici_model.setSteadyStateSensitivityMode(amici.SteadyStateSensitivityMode.integrateIfNewtonFails)

although the test does not compute any sensitivities.

Changing SteadyStateComputationMode alone, will result in

FAILED python/tests/test_pregenerated_models.py::test_pregenerated_model[model_steadystate-nosensi] - AssertionError: Regression check failed for J for 2 indices:
        at (np.int64(0), np.int64(0)): Expected -2.0455670563167567, got -2.045567126527688
        at (np.int64(2), np.int64(0)): Expected 0.2189886877484498, got 0.21898870409183105

I don't think Model::setSteadyStateSensitivityMode should affect model simulation in case no sensitivities are computed.