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

Release 0.20.0 #2210

Merged
merged 24 commits into from
Nov 21, 2023
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
890b993
Fix unused pysb2amici / sbml2amici / DEExporter `compiler` argument (…
dweindl Aug 31, 2023
847a596
Fix pre-commit configuration (#2171)
dweindl Aug 31, 2023
5e5ec61
Doc: Rename 'steadystate example' (#2174)
dweindl Sep 20, 2023
c038ff5
Fix incorrect path in LICENSE.md
dweindl Oct 18, 2023
fb2a101
Fix CMake cmake_minimum_required deprecation warning (#2183)
dweindl Oct 30, 2023
492e480
Fix Fix misleading preequilibration failure messages (#2181)
dweindl Oct 30, 2023
ea95896
GHA: print longest test durations
dweindl Oct 30, 2023
71295a5
Evaluate and plot symbolic expressions based on simulation results (#…
dweindl Nov 1, 2023
269910b
Remove setuptools<64 restriction (#2180)
dweindl Nov 3, 2023
316d94d
Easier access to timepoints via ExpDataView (#2193)
dweindl Nov 15, 2023
eccdc1f
Nicer __repr__ for ReturnDataView (#2192)
dweindl Nov 15, 2023
187362a
Fix ExpData equality operator for Python (#2194)
dweindl Nov 15, 2023
1726f43
Enable deepcopy for ExpData(View) (#2196)
dweindl Nov 15, 2023
48b8629
Allow subsetting simulation conditions in simulate_petab (#2199)
dweindl Nov 15, 2023
17f85fb
GHA: Modularize actions (apt dependencies, sonar tools) (#2197)
dweindl Nov 16, 2023
acf526a
GHA: Clean up custom doxygen (#2201)
dweindl Nov 16, 2023
32730f0
GHA: Cleanup custom swig usage (#2200)
dweindl Nov 16, 2023
1cae191
GHA: further cleanup (#2202)
dweindl Nov 16, 2023
3330ccb
GHA: test installation from pypi on python3.11 (#2198)
dweindl Nov 16, 2023
892a7c8
CMake set CMP0144 (#2209)
dweindl Nov 21, 2023
a4a0b49
GHA: split into smaller jobs (#2204)
dweindl Nov 21, 2023
8b836ae
Doc: Update reference list (#2172)
dweindl Nov 21, 2023
4f6e829
GHA: Fix OpenMP not found on macos (#2207)
dweindl Nov 21, 2023
92c0530
bump version; update changelog
dweindl Nov 21, 2023
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
Prev Previous commit
Next Next commit
Fix Fix misleading preequilibration failure messages (#2181)
When preequilibration (or finding a steadystate in general) fails,
`SteadystateProblem::handleSteadyStateFailure` produced
`AMICI simulation failed: Steady state computation failed. First run of Newton solver failed. Simulation to steady state failed: No convergence was achieved. Second run of Newton solver failed.`,
even in cases where no Newton solve or no simulation was attempted.
This is confusing and is changed here, so that the message now reflects what has actually happened.

Closes #2178
  • Loading branch information
dweindl authored Oct 30, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 492e48056d99ebaf8435706a6e144c8899d46975
11 changes: 9 additions & 2 deletions include/amici/steadystateproblem.h
Original file line number Diff line number Diff line change
@@ -208,8 +208,15 @@ class SteadystateProblem {

/**
* @brief Stores state and throws an exception if equilibration failed
*/
[[noreturn]] void handleSteadyStateFailure();
* @param tried_newton_1 Whether any Newton step was attempted before
* simulation
* @param tried_simulation Whether simulation was attempted
* @param tried_newton_2 Whether any Newton step was attempted after
* simulation
*/
[[noreturn]] void handleSteadyStateFailure(
bool tried_newton_1, bool tried_simulation, bool tried_newton_2
);

/**
* @brief Assembles the error message to be thrown.
34 changes: 22 additions & 12 deletions src/steadystateproblem.cpp
Original file line number Diff line number Diff line change
@@ -60,9 +60,9 @@ SteadystateProblem::SteadystateProblem(Solver const& solver, Model const& model)
"sensitivities during simulation");
if (solver.getSensitivityMethod() == SensitivityMethod::forward
&& model.getSteadyStateComputationMode()
== SteadyStateComputationMode::newtonOnly
== SteadyStateComputationMode::newtonOnly
&& model.getSteadyStateSensitivityMode()
== SteadyStateSensitivityMode::integrationOnly)
== SteadyStateSensitivityMode::integrationOnly)
throw AmiException("For forward sensitivity analysis steady-state "
"computation mode 'newtonOnly' and steady-state "
"sensitivity mode 'integrationOnly' are not "
@@ -152,7 +152,10 @@ void SteadystateProblem::findSteadyState(

/* Nothing worked, throw an as informative error as possible */
if (!checkSteadyStateSuccess())
handleSteadyStateFailure();
handleSteadyStateFailure(
!turnOffNewton, !turnOffSimulation,
!turnOffNewton && !turnOffSimulation
);
}

void SteadystateProblem::findSteadyStateByNewtonsMethod(
@@ -394,16 +397,23 @@ void SteadystateProblem::getQuadratureBySimulation(
}
}

[[noreturn]] void SteadystateProblem::handleSteadyStateFailure() {
[[noreturn]] void SteadystateProblem::handleSteadyStateFailure(
bool tried_newton_1, bool tried_simulation, bool tried_newton_2
) {
/* Throw error message according to error codes */
std::string errorString = "Steady state computation failed. "
"First run of Newton solver failed";
writeErrorString(&errorString, steady_state_status_[0]);
errorString.append(" Simulation to steady state failed");
writeErrorString(&errorString, steady_state_status_[1]);
errorString.append(" Second run of Newton solver failed");
writeErrorString(&errorString, steady_state_status_[2]);

std::string errorString = "Steady state computation failed.";
if (tried_newton_1) {
errorString.append(" First run of Newton solver failed");
writeErrorString(&errorString, steady_state_status_[0]);
}
if (tried_simulation) {
errorString.append(" Simulation to steady state failed");
writeErrorString(&errorString, steady_state_status_[1]);
}
if (tried_newton_2) {
errorString.append(" Second run of Newton solver failed");
writeErrorString(&errorString, steady_state_status_[2]);
}
throw AmiException(errorString.c_str());
}