Skip to content

Commit

Permalink
Merge branch 'develop' into jax_export
Browse files Browse the repository at this point in the history
  • Loading branch information
FFroehlich authored Oct 23, 2024
2 parents 82a01ba + 638c3ee commit 7c3aef9
Show file tree
Hide file tree
Showing 12 changed files with 121 additions and 18 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/test_python_ver_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
32 changes: 32 additions & 0 deletions documentation/amici_refs.bib
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
21 changes: 20 additions & 1 deletion documentation/references.md
Original file line number Diff line number Diff line change
@@ -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).
Expand All @@ -15,13 +15,32 @@ If you applied AMICI in your work and your publication is missing, please let us
<h1 class="unnumbered" id="section">2024</h1>
<div id="refs" class="references csl-bib-body hanging-indent"
role="list">
<div id="ref-ArmisteadHoe2024" class="csl-entry" role="listitem">
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. <span>“A
Sphingolipid Rheostat Controls Apoptosis Versus Apical Cell Extrusion as
Alternative Tumour-Suppressive Mechanisms.”</span> <em>Cell Death &amp;
Disease</em> 15 (10). <a
href="https://doi.org/10.1038/s41419-024-07134-2">https://doi.org/10.1038/s41419-024-07134-2</a>.
</div>
<div id="ref-BaltussenJon2024" class="csl-entry" role="listitem">
Baltussen, Mathieu G., Thijs J. de Jong, Quentin Duez, William E.
Robinson, and Wilhelm T. S. Huck. 2024. <span>“Chemical Reservoir
Computation in a Self-Organizing Reaction Network.”</span>
<em>Nature</em>, June. <a
href="https://doi.org/10.1038/s41586-024-07567-x">https://doi.org/10.1038/s41586-024-07567-x</a>.
</div>
<div id="ref-BarthelKun2024" class="csl-entry" role="listitem">
Barthel, Lars, Philipp Kunz, Rudibert King, and Vera Meyer. 2024.
<span>“Harnessing Genetic and Microfluidic Approaches to Model Shear
Stress Response in Cell Wall Mutants of the Filamentous Cell Factory
Aspergillus Niger.”</span> In <em>Dispersity, Structure and Phase
Changes of Proteins and Bio Agglomerates in Biotechnological
Processes</em>, edited by Arno Kwade and Ingo Kampen, 467–90. Cham:
Springer Nature Switzerland. <a
href="https://doi.org/10.1007/978-3-031-63164-1_15">https://doi.org/10.1007/978-3-031-63164-1_15</a>.
</div>
<div id="ref-DoresicGre2024" class="csl-entry" role="listitem">
Dorešić, Domagoj, Stephan Grein, and Jan Hasenauer. 2024.
<span>“Efficient Parameter Estimation for ODE Models of Cellular
Expand Down
17 changes: 15 additions & 2 deletions include/amici/forwardproblem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
};

Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion include/amici/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ struct LogItem {
)
: severity(severity)
, identifier(identifier)
, message(message){};
, message(message) {};

/** Severity level */
LogSeverity severity = LogSeverity::error;
Expand Down
2 changes: 1 addition & 1 deletion scripts/run-valgrind-cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions src/rdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 {
Expand All @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions src/solver_cvodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
);

/*
Expand Down
3 changes: 1 addition & 2 deletions src/solver_idas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
);

/*
Expand Down
5 changes: 2 additions & 3 deletions tests/cpp/unittests/testMisc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,9 @@ TEST_F(SolverTest, SettersGettersWithSetup)
ASSERT_EQ(static_cast<int>(solver.getSensitivityMethod()),
static_cast<int>(sensi_meth));

sundials::Context sunctx;
auto rdata = std::make_unique<ReturnData>(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<realtype>{ 0 });

Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.26.3
0.27.0

0 comments on commit 7c3aef9

Please sign in to comment.