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.31.0 #2649

Merged
merged 18 commits into from
Feb 18, 2025
Merged

Release 0.31.0 #2649

merged 18 commits into from
Feb 18, 2025

Conversation

dweindl
Copy link
Member

@dweindl dweindl commented Feb 18, 2025

No description provided.

dweindl and others added 18 commits December 16, 2024 11:19
Add RDataReporting::observables_likelihood for computing observables, likelihood and the respective sensitivities. Closes AMICI-dev#2625.

Fixes allocating sllh despite SensitivityMethod::none.
* update diffrax, remove ts_init

* fix petab simulate

* Update pyproject.toml

* Update pytest.ini
* add event check in equilibration, add test

* Update test_jax.py

* Update model.py

* Update model.py

* decrease integration tols

* decrease integration tols

* decrease integration tols

* decrease integration tols

* revert scaling factor, add ss event API

* Update test_jax.py

* Update ExampleJaxPEtab.ipynb

* Update petab.py
Fixes AMICI-dev#2627. ReturnData.sllh was always NaN because it wasn't 0-initialized.
* pre-commit autoupdate

* pre-commit autoupdate

`pre-commit autoupdate` and fix/ignore pyupgrade issues.
Reduce parameter mapping time for Froehlich_CellSystems2018 by 88% (1774s -> 216s).
* fix vectorisation

* decorators, preequilibration

* add documentation

* fix petab_simulate

* fix notebook

* update/fix doc?

* fix rtd

* fix docstring

* Update python/sdist/amici/jax/petab.py

Co-authored-by: Daniel Weindl <[email protected]>

---------

Co-authored-by: Daniel Weindl <[email protected]>
* fix AMICI-dev#2642

* fixup

* fixup

* add issue as regression test

* fix path
* first working implementation

* bugfixes

* vectorisation go brrrrr

* add doc, workaround Zhao_QuantBiol2020

* fixup

* fixup

* fixup

* fixup

* Update ExampleJaxPEtab.ipynb

* fix notebook

* fix pysb

* fixup

* fixup petab 0006 jax

* fix noise parameters

* fixup noise model

* fixup

* fixup sigma

* remove workaround

* Apply suggestions from code review

Co-authored-by: Daniel Weindl <[email protected]>

* Update de_model.py

* Update pytest.ini

* Update de_model.py

* Update pysb_import.py

* fixup

---------

Co-authored-by: Daniel Weindl <[email protected]>
Avoid repeated lookups. Saves just a few seconds for Froehlich_CellSystems2018, but better than nothing...
* LakrisenkoPat2024

* SmithMal2025
amici wants to avoid sundials' checkpointing, that's we set `steps` (the number of integration steps at which a checkpoint is created) for `CVodeAdjInit` to the maximum number of integration steps (`mxsteps`) for the forward problem.

However, the checkpoint is created at step `steps`, not at step `steps + 1`.

Therefore, if the forward integration takes exactly `mxsteps`, a checkpoint is still created.

This is not a problem per se, but it may trigger segfaults under circumstances not fully understood (-> LLNL/sundials#49).
Although unlikely, it still occasionally crashes long running optimizations.

This change should make sure that checkpointing never occurs.
Update valgrind suppressions and fix `run-valgrind-py.sh` for arguments containing spaces.
…dev#2647)

Due to LLNL/sundials#82, we can get exceptions from `CVodeSolver::getSens`, escaping `FinalStateStorer::~FinalStateStorer`, that will result in crashes. This is fixed here.

The issue is semi-producible with [Boehm_JProteomeRes2014](https://github.com/Benchmarking-Initiative/Benchmark-Models-PEtab/tree/15b4f78aff1121870537ad3e1a6b902cb8f73930/Benchmark-Models/Boehm_JProteomeRes2014) with forward sensitivities:

Program output:

```
2025-02-17 14:44:33.988 - amici.swig_wrappers - DEBUG - [model1_data1][cvodes:CVode:WARNING] python/sdist/amici/ThirdParty/sundials/src/cvodes/cvodes.c:3482: Internal t = 0 and h = 0 are such that t + h = t on the next step. The solver will continue anyway. (99)
2025-02-17 14:44:33.988 - amici.swig_wrappers - DEBUG - [model1_data1][cvodes:CVodeGetDky:BAD_T] python/sdist/amici/ThirdParty/sundials/src/cvodes/cvodes.c:3783: Illegal value for t.t = 2.5 is not between tcur - hu = 0 and tcur = 0. (-25)
2025-02-17 14:44:33.988 - amici.swig_wrappers - DEBUG - [model1_data1][cvodes:CVodeGetDky:BAD_T] python/sdist/amici/ThirdParty/sundials/src/cvodes/cvodes.c:3783: Illegal value for t.t = 5 is not between tcur - hu = 0 and tcur = 0. (-25)
2025-02-17 14:44:33.988 - amici.swig_wrappers - DEBUG - [model1_data1][cvodes:CVode:ILL_INPUT] python/sdist/amici/ThirdParty/sundials/src/cvodes/cvodes.c:3328: Trouble interpolating at tout = 5. tout too far back in direction of integration (-22)
2025-02-17 14:44:33.988 - amici.swig_wrappers - ERROR - [model1_data1][FORWARD_FAILURE] AMICI forward simulation failed at t = 5: AMICI failed to integrate the forward problem
terminate called after throwing an instance of 'amici::CvodeException'
  what():  CVODE routine CVodeGetSens failed with error code -25.

Thread 1 "python" received signal SIGABRT, Aborted.
```

Stack trace:

```
AMICI-dev#10 0x00007ffff70811f1 in _Unwind_RaiseException (exc=0x6d5ff10) at ../../../src/libgcc/unwind.inc:136
AMICI-dev#11 0x00007ffff48bb384 in __cxxabiv1::__cxa_throw (obj=<optimized out>, tinfo=0x7fff5c6d6aa8 <typeinfo for amici::CvodeException>, dest=0x7fff5c5476c4 <amici::CvodeException::~CvodeException()>)
    at ../../../../src/libstdc++-v3/libsupc++/eh_throw.cc:93
AMICI-dev#12 0x00007fff5c5bdb64 in amici::CVodeSolver::getSens (this=0x6d130d0) at python/sdist/amici/src/solver_cvodes.cpp:663
AMICI-dev#13 0x00007fffbc5709e8 in amici::Solver::getStateSensitivity (this=0x6d130d0, t=2.5) at python/sdist/amici/src/solver.cpp:1340
AMICI-dev#14 0x00007fffbc570750 in amici::Solver::writeSolution (this=0x6d130d0, t=0x6d26db0, x=..., dx=..., sx=..., xQ=...) at python/sdist/amici/src/solver.cpp:1303
AMICI-dev#15 0x00007fffbc5d376d in amici::ForwardProblem::getSimulationState (this=0x6d26c90) at python/sdist/amici/src/forwardproblem.cpp:421
AMICI-dev#16 0x00007fffbc5d45df in amici::FinalStateStorer::~FinalStateStorer (this=0x7fffffffb308, __in_chrg=<optimized out>) at include/amici/forwardproblem.h:450
AMICI-dev#17 0x00007fffbc5d2285 in amici::ForwardProblem::workForwardProblem (this=0x6d26c90) at python/sdist/amici/src/forwardproblem.cpp:203
AMICI-dev#18 0x00007fffbc54fbf9 in amici::runAmiciSimulation (solver=..., edata=0x5078010, model=..., rethrow=false) at python/sdist/amici/src/amici.cpp:108
```
Copy link

codecov bot commented Feb 18, 2025

Codecov Report

Attention: Patch coverage is 95.03817% with 13 lines in your changes missing coverage. Please review.

Project coverage is 77.30%. Comparing base (64bbd80) to head (bc350cf).
Report is 19 commits behind head on master.

Files with missing lines Patch % Lines
python/sdist/amici/pysb_import.py 85.18% 4 Missing ⚠️
python/sdist/amici/jax/petab.py 98.31% 2 Missing ⚠️
python/sdist/amici/petab/pysb_import.py 91.30% 2 Missing ⚠️
python/sdist/amici/sbml_utils.py 0.00% 2 Missing ⚠️
python/sdist/amici/splines.py 0.00% 2 Missing ⚠️
python/sdist/amici/jax/model.py 95.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2649      +/-   ##
==========================================
+ Coverage   77.00%   77.30%   +0.29%     
==========================================
  Files         332      332              
  Lines       22970    23142     +172     
  Branches     1479     1480       +1     
==========================================
+ Hits        17688    17889     +201     
+ Misses       5271     5242      -29     
  Partials       11       11              
Flag Coverage Δ
cpp 76.44% <75.50%> (+2.50%) ⬆️
cpp_python 33.38% <23.29%> (-0.11%) ⬇️
petab 39.40% <88.30%> (+0.50%) ⬆️
python 72.36% <81.60%> (+0.28%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
include/amici/rdata.h 100.00% <ø> (ø)
python/sdist/amici/_codegen/model_class.py 100.00% <100.00%> (ø)
python/sdist/amici/constants.py 100.00% <100.00%> (ø)
python/sdist/amici/cxxcodeprinter.py 92.17% <100.00%> (ø)
python/sdist/amici/de_model.py 90.30% <100.00%> (+0.14%) ⬆️
python/sdist/amici/de_model_components.py 89.61% <100.00%> (+0.42%) ⬆️
python/sdist/amici/import_utils.py 89.36% <100.00%> (ø)
python/sdist/amici/jax/ode_export.py 96.87% <100.00%> (ø)
python/sdist/amici/logging.py 79.76% <ø> (ø)
python/sdist/amici/numpy.py 83.33% <100.00%> (ø)
... and 13 more

... and 4 files with indirect coverage changes

@dweindl dweindl marked this pull request as ready for review February 18, 2025 13:20
@dweindl dweindl requested a review from a team as a code owner February 18, 2025 13:20
@dweindl dweindl merged commit f742e48 into AMICI-dev:master Feb 18, 2025
34 checks passed
@dweindl dweindl deleted the release_0.31.0 branch February 18, 2025 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants