From 40b496fcd349b2ad1b808f9971c61fd7605deb19 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Sat, 19 Oct 2024 23:34:37 +0200 Subject: [PATCH 1/6] GHA: Ignore python3.13 failures for now (#2557) Until all dependencies work with Python3.13. pyarrow wheels are still missing. --- .github/workflows/test_python_ver_matrix.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_python_ver_matrix.yml b/.github/workflows/test_python_ver_matrix.yml index de61a4776b..8ccf2c1558 100644 --- a/.github/workflows/test_python_ver_matrix.yml +++ b/.github/workflows/test_python_ver_matrix.yml @@ -25,8 +25,15 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.10', '3.11', '3.12', '3.13'] - experimental: [false] + include: + - python-version: '3.10' + experimental: false + - python-version: '3.11' + experimental: false + - python-version: '3.12' + experimental: false + - python-version: '3.13' + experimental: true steps: - run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV From fbe38408c48976de89b5c8e1c9e2b1c8c1cd84b4 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Sun, 20 Oct 2024 09:15:23 +0200 Subject: [PATCH 2/6] Fix dangling pointer in SolverTest.SettersGettersWithSetup (#2556) Fixes a dangling pointer issue in SolverTest.SettersGettersWithSetup. The SUNContext was destroyed before the associated AmiVectors which resulted in invalid reads. --- scripts/run-valgrind-cpp.sh | 2 +- tests/cpp/unittests/testMisc.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/run-valgrind-cpp.sh b/scripts/run-valgrind-cpp.sh index fd08cbda54..a96b1d90e6 100755 --- a/scripts/run-valgrind-cpp.sh +++ b/scripts/run-valgrind-cpp.sh @@ -10,4 +10,4 @@ set -eou pipefail # run tests cd "${AMICI_PATH}/build/" VALGRIND_OPTS="--leak-check=full --error-exitcode=1 --trace-children=yes --show-leak-kinds=definite" -valgrind ${VALGRIND_OPTS} ctest +CTEST_OUTPUT_ON_FAILURE=1 valgrind ${VALGRIND_OPTS} ctest diff --git a/tests/cpp/unittests/testMisc.cpp b/tests/cpp/unittests/testMisc.cpp index b06880072f..0cc7a017dc 100644 --- a/tests/cpp/unittests/testMisc.cpp +++ b/tests/cpp/unittests/testMisc.cpp @@ -360,10 +360,9 @@ TEST_F(SolverTest, SettersGettersWithSetup) ASSERT_EQ(static_cast(solver.getSensitivityMethod()), static_cast(sensi_meth)); - sundials::Context sunctx; auto rdata = std::make_unique(solver, testModel); - AmiVector x(nx, sunctx), dx(nx, sunctx); - AmiVectorArray sx(nx, 1, sunctx), sdx(nx, 1, sunctx); + AmiVector x(nx, solver.getSunContext()), dx(nx, solver.getSunContext()); + AmiVectorArray sx(nx, 1, solver.getSunContext()), sdx(nx, 1, solver.getSunContext()); testModel.setInitialStates(std::vector{ 0 }); From a82f6d4946a5e11d60eaba662eedcf57d3a9306d Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Sun, 20 Oct 2024 09:34:53 +0200 Subject: [PATCH 3/6] clang-format 19.1.1 updates --- include/amici/logging.h | 2 +- src/solver_cvodes.cpp | 3 +-- src/solver_idas.cpp | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/amici/logging.h b/include/amici/logging.h index 6af039d4c4..9441c21042 100644 --- a/include/amici/logging.h +++ b/include/amici/logging.h @@ -80,7 +80,7 @@ struct LogItem { ) : severity(severity) , identifier(identifier) - , message(message){}; + , message(message) {}; /** Severity level */ LogSeverity severity = LogSeverity::error; diff --git a/src/solver_cvodes.cpp b/src/solver_cvodes.cpp index 72fcfa78ed..f777011329 100644 --- a/src/solver_cvodes.cpp +++ b/src/solver_cvodes.cpp @@ -91,8 +91,7 @@ static_assert( "AMICI_FIRST_QRHSFUNC_ERR != CV_FIRST_QRHSFUNC_ERR" ); static_assert( - amici::AMICI_WARNING == CV_WARNING, - "AMICI_WARNING != CV_WARNING" + amici::AMICI_WARNING == CV_WARNING, "AMICI_WARNING != CV_WARNING" ); /* diff --git a/src/solver_idas.cpp b/src/solver_idas.cpp index 8e64edb92e..12ac2d2084 100644 --- a/src/solver_idas.cpp +++ b/src/solver_idas.cpp @@ -71,8 +71,7 @@ static_assert( "AMICI_IDAS_CONSTR_FAIL != IDA_CONSTR_FAIL" ); static_assert( - amici::AMICI_WARNING == IDA_WARNING, - "AMICI_WARNING != IDA_WARNING" + amici::AMICI_WARNING == IDA_WARNING, "AMICI_WARNING != IDA_WARNING" ); /* From 9f562667ba74d1dfdd86514f89155644daeec4ba Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Sun, 20 Oct 2024 10:08:17 +0200 Subject: [PATCH 4/6] Fix crashes when errors occur at output timepoints (#2555) Fixes a bug that lead to program termination if a root-after-reinitialization error (potentially also others) occurred at an output timepoint, because an non-existing/invalid SimulationState for that timepoint was accessed. See #2491 for further details. Fixes #2491. Also avoid some unnecessary copying (during which previously the segfault occurred if this bug triggered in non-debug builds). --- include/amici/forwardproblem.h | 17 +++++++++++++++-- src/rdata.cpp | 6 +++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/include/amici/forwardproblem.h b/include/amici/forwardproblem.h index ffcca63666..40a4147f4e 100644 --- a/include/amici/forwardproblem.h +++ b/include/amici/forwardproblem.h @@ -2,6 +2,7 @@ #define AMICI_FORWARDPROBLEM_H #include "amici/defines.h" +#include "amici/edata.h" #include "amici/misc.h" #include "amici/model.h" #include "amici/vector.h" @@ -195,7 +196,7 @@ class ForwardProblem { if (model->getTimepoint(it) == initial_state_.t) return getInitialSimulationState(); auto map_iter = timepoint_states_.find(model->getTimepoint(it)); - assert(map_iter != timepoint_states_.end()); + Ensures(map_iter != timepoint_states_.end()); return map_iter->second; }; @@ -441,8 +442,20 @@ class FinalStateStorer : public ContextManager { * @brief destructor, stores simulation state */ ~FinalStateStorer() { - if (fwd_) + if (fwd_) { fwd_->final_state_ = fwd_->getSimulationState(); + // if there is an associated output timepoint, also store it in + // timepoint_states if it's not present there. + // this may happen if there is an error just at + // (or indistinguishably before) an output timepoint + auto final_time = fwd_->getFinalTime(); + auto const timepoints = fwd_->model->getTimepoints(); + if (!fwd_->timepoint_states_.count(final_time) + && std::find(timepoints.cbegin(), timepoints.cend(), final_time) + != timepoints.cend()) { + fwd_->timepoint_states_[final_time] = fwd_->final_state_; + } + } } private: diff --git a/src/rdata.cpp b/src/rdata.cpp index a2fa02dd62..4ec983af2b 100644 --- a/src/rdata.cpp +++ b/src/rdata.cpp @@ -241,7 +241,7 @@ void ReturnData::processForwardProblem( if (edata) initializeObjectiveFunction(model.hasQuadraticLLH()); - auto initialState = fwd.getInitialSimulationState(); + auto const& initialState = fwd.getInitialSimulationState(); if (initialState.x.getLength() == 0 && model.nx_solver > 0) return; // if x wasn't set forward problem failed during initialization @@ -259,7 +259,7 @@ void ReturnData::processForwardProblem( realtype tf = fwd.getFinalTime(); for (int it = 0; it < model.nt(); it++) { if (model.getTimepoint(it) <= tf) { - auto simulation_state = fwd.getSimulationStateTimepoint(it); + auto const simulation_state = fwd.getSimulationStateTimepoint(it); model.setModelState(simulation_state.state); getDataOutput(it, model, simulation_state, edata); } else { @@ -273,7 +273,7 @@ void ReturnData::processForwardProblem( if (nz > 0) { auto rootidx = fwd.getRootIndexes(); for (int iroot = 0; iroot <= fwd.getEventCounter(); iroot++) { - auto simulation_state = fwd.getSimulationStateEvent(iroot); + auto const simulation_state = fwd.getSimulationStateEvent(iroot); model.setModelState(simulation_state.state); getEventOutput( simulation_state.t, rootidx.at(iroot), model, simulation_state, From 7f863cfc34aba4459a1445c9a2202d3fe0a095c3 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Sun, 20 Oct 2024 12:18:27 +0200 Subject: [PATCH 5/6] Update references (#2518) * BarthelKun2024 * ArmisteadHoe2024 --- documentation/amici_refs.bib | 32 ++++++++++++++++++++++++++++++++ documentation/references.md | 21 ++++++++++++++++++++- 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/documentation/amici_refs.bib b/documentation/amici_refs.bib index 49da6efa30..b7fee9361e 100644 --- a/documentation/amici_refs.bib +++ b/documentation/amici_refs.bib @@ -1403,6 +1403,38 @@ @Article{JakstaiteZho2024 publisher = {American Chemical Society (ACS)}, } +@InBook{BarthelKun2024, + author = {Barthel, Lars and Kunz, Philipp and King, Rudibert and Meyer, Vera}, + editor = {Kwade, Arno and Kampen, Ingo}, + pages = {467--490}, + publisher = {Springer Nature Switzerland}, + title = {Harnessing Genetic and Microfluidic Approaches to Model Shear Stress Response in Cell Wall Mutants of the Filamentous Cell Factory Aspergillus niger}, + year = {2024}, + address = {Cham}, + isbn = {978-3-031-63164-1}, + abstract = {Aspergillus niger is an efficient biotechnological cell factory harnessed for the production of proteins, enzymes, platform chemicals and secondary metabolites. Critical for productivity of filamentous fungi such as A. niger is their hyphal growth and the ability of their cell walls to withstand shear stress conditions during submerged bioreactor cultivations. As chitin is thought to be fundamental for the rigidity of fungal hyphae, we generated a chitin synthase knock-out library for A. niger and studied the impact of these genetic modifications on its ability to withstand shear stress during submerged bioreactor cultivations. We isolated a double deletion mutant in which the genes chsE and chsD were inactivated and observed a reduction in chitin content by 60{\%}, cell wall thickness by 20{\%}, hyphal diameter by 60{\%} and maximum growth rate by 25{\%}. We furthermore developed a parallelized microfluidic growth chamber system that enabled us to track the growth of the double mutant and the respective control strain using a confocal laser scanning microscope, and, additionally, to compare their growth responses when subjected to different shear stress conditions. A newly developed mathematical model allowed us to compute and evaluate lag-phase, maximum growth rate and shear stress response based on the microscopic images obtained. Overall, this microfluidic approach clearly identified differences in shear stress response between both strains and has high potential as scale-down screening tool to predict growth characteristics under submerged bioreactor cultivations.}, + booktitle = {Dispersity, Structure and Phase Changes of Proteins and Bio Agglomerates in Biotechnological Processes}, + creationdate = {2024-09-29T16:46:24}, + doi = {10.1007/978-3-031-63164-1_15}, + modificationdate = {2024-09-29T16:46:24}, + url = {https://doi.org/10.1007/978-3-031-63164-1_15}, +} + +@Article{ArmisteadHoe2024, + author = {Armistead, Joy and Höpfl, Sebastian and Goldhausen, Pierre and Müller-Hartmann, Andrea and Fahle, Evelin and Hatzold, Julia and Franzen, Rainer and Brodesser, Susanne and Radde, Nicole E. and Hammerschmidt, Matthias}, + journal = {Cell Death & Disease}, + title = {A sphingolipid rheostat controls apoptosis versus apical cell extrusion as alternative tumour-suppressive mechanisms}, + year = {2024}, + issn = {2041-4889}, + month = oct, + number = {10}, + volume = {15}, + creationdate = {2024-10-17T16:27:55}, + doi = {10.1038/s41419-024-07134-2}, + modificationdate = {2024-10-17T16:28:08}, + publisher = {Springer Science and Business Media LLC}, +} + @Comment{jabref-meta: databaseType:bibtex;} @Comment{jabref-meta: grouping: diff --git a/documentation/references.md b/documentation/references.md index d58c6fc2ff..c7322e8fe9 100644 --- a/documentation/references.md +++ b/documentation/references.md @@ -1,6 +1,6 @@ # References -List of publications using AMICI. Total number is 92. +List of publications using AMICI. Total number is 94. If you applied AMICI in your work and your publication is missing, please let us know via a new [GitHub issue](https://github.com/AMICI-dev/AMICI/issues/new?labels=documentation&title=Add+publication&body=AMICI+was+used+in+this+manuscript:+DOI). @@ -15,6 +15,15 @@ If you applied AMICI in your work and your publication is missing, please let us

2024

+
+Armistead, Joy, Sebastian Höpfl, Pierre Goldhausen, Andrea +Müller-Hartmann, Evelin Fahle, Julia Hatzold, Rainer Franzen, Susanne +Brodesser, Nicole E. Radde, and Matthias Hammerschmidt. 2024. “A +Sphingolipid Rheostat Controls Apoptosis Versus Apical Cell Extrusion as +Alternative Tumour-Suppressive Mechanisms.” Cell Death & +Disease 15 (10). https://doi.org/10.1038/s41419-024-07134-2. +
Baltussen, Mathieu G., Thijs J. de Jong, Quentin Duez, William E. Robinson, and Wilhelm T. S. Huck. 2024. “Chemical Reservoir @@ -22,6 +31,16 @@ Computation in a Self-Organizing Reaction Network.” Nature, June. https://doi.org/10.1038/s41586-024-07567-x.
+
+Barthel, Lars, Philipp Kunz, Rudibert King, and Vera Meyer. 2024. +“Harnessing Genetic and Microfluidic Approaches to Model Shear +Stress Response in Cell Wall Mutants of the Filamentous Cell Factory +Aspergillus Niger.” In Dispersity, Structure and Phase +Changes of Proteins and Bio Agglomerates in Biotechnological +Processes, edited by Arno Kwade and Ingo Kampen, 467–90. Cham: +Springer Nature Switzerland. https://doi.org/10.1007/978-3-031-63164-1_15. +
Dorešić, Domagoj, Stephan Grein, and Jan Hasenauer. 2024. “Efficient Parameter Estimation for ODE Models of Cellular From 8e9f93a984c3dac28c33fcddc1ca9e9f8b5a5259 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Sat, 19 Oct 2024 17:18:47 +0200 Subject: [PATCH 6/6] Update changelog, bump version --- CHANGELOG.md | 35 +++++++++++++++++++++++++++++++++++ version.txt | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 44e57b2f22..8eb0abd8ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,41 @@ See also our [versioning policy](https://amici.readthedocs.io/en/latest/versioni ## v0.X Series +### v0.27.0 (2024-10-21) + +This release comes with an **updated version of the SUNDIALS package (7.1.1)** (https://github.com/AMICI-dev/AMICI/pull/2513). + For C++ users of some of AMICI's internal RAII classes, this may include some + breaking changes. The Python API is not affected. + +*Note regarding **editable** installations (`pip install -e ...`):* +Due to the SUNDIALS update, it will be necessary to clean out some temporary +build directories (at least `ThirdParty/sundials/build/`, +`python/sdist/build/`) before rebuilding the package. + +**Fixes** + +* Fixed a bug that led to program termination if a root-after-reinitialization + error (potentially also others) occurred at an output timepoint + + by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2555 + +* CMake: Fixes compilation errors for models named `model` + + by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2547 + +* Updated CMake export config, making it easier to use AMICI in CMake projects + and fixing some potential issues with interferring packages + + by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2540 + +* CMake: Set policies for CMake 3.31 + + by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2539 + +* Documentation fixes by @FFroehlich, @ChocolateCharlie, @dweindl + +**Full Changelog**: https://github.com/AMICI-dev/AMICI/compare/v0.26.3...v0.27.0 + ### v0.26.3 (2024-10-03) diff --git a/version.txt b/version.txt index 3f45a6442e..1b58cc1018 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.26.3 +0.27.0