Skip to content

Commit

Permalink
Update AMICI to v0.26.3-26-g9f562667 (#396)
Browse files Browse the repository at this point in the history
This should fix the random test failures (AMICI-dev/AMICI#2491).

```
git subrepo clone --branch=9f562667ba74d1dfdd86514f89155644daeec4ba --force [email protected]:dweindl/AMICI.git deps/AMICI

subrepo:
  subdir:   "deps/AMICI"
  merged:   "9f562667"
upstream:
  origin:   "[email protected]:dweindl/AMICI.git"
  branch:   "9f562667ba74d1dfdd86514f89155644daeec4ba"
  commit:   "9f562667"
git-subrepo:
  version:  "0.4.8"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "3a53c20"
```
  • Loading branch information
dweindl authored Oct 20, 2024
1 parent 6326260 commit 58b0a13
Show file tree
Hide file tree
Showing 11 changed files with 127 additions and 112 deletions.
18 changes: 10 additions & 8 deletions deps/AMICI/.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']
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 All @@ -53,12 +60,7 @@ jobs:
# install pysb before sympy to allow for sympy>=1.12 (https://github.com/pysb/pysb/commit/e83937cb8c74afc9b2fa96595b68464946745f33)
- run: source venv/bin/activate && pip3 install git+https://github.com/pysb/pysb

# until sympy>1.12 is released
- run: source venv/bin/activate && pip3 install git+https://github.com/sympy/sympy.git@master
if: matrix.python-version == '3.12'

- run: source venv/bin/activate && pip3 install "sympy>=1.12.1"
if: matrix.python-version != '3.12'
- run: source venv/bin/activate && pip3 install "sympy>1.12"

- name: Get Pooch Cache Directory
id: get-pooch-cache
Expand Down
8 changes: 4 additions & 4 deletions deps/AMICI/.gitrepo
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
;
[subrepo]
remote = [email protected]:ICB-DCM/AMICI.git
branch = 8253a97d413cbbcfec335fb50fd1355107804e9e
commit = 8253a97d413cbbcfec335fb50fd1355107804e9e
parent = 4b6205d1b4661c227beee7039416c516d47e91f9
cmdver = 0.4.6
branch = 9f562667ba74d1dfdd86514f89155644daeec4ba
commit = 9f562667ba74d1dfdd86514f89155644daeec4ba
parent = 63262608a702ccbca96980c4058c2d29895658a8
cmdver = 0.4.8
method = merge
17 changes: 15 additions & 2 deletions deps/AMICI/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 deps/AMICI/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
Loading

0 comments on commit 58b0a13

Please sign in to comment.