AMICI-dev / AMICI

Advanced Multilanguage Interface to CVODES and IDAS
https://amici.readthedocs.io/
Other
108 stars 30 forks source link

Enable setting constraints on state variables #2340

Closed dweindl closed 6 months ago

dweindl commented 6 months ago

In addition to the current Model.setStateIsNonNegative, this adds the option to set additional (non)negativity/positivity constraints to be enforced by the solver.

See CVodeSetConstraints for details.

Related to #2327.

codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 90.00000% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 77.70%. Comparing base (3dded5c) to head (897e9d1).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2340/graphs/tree.svg?width=650&height=150&src=pr&token=1bt9lbspzk&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev)](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2340?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev) ```diff @@ Coverage Diff @@ ## develop #2340 +/- ## =========================================== + Coverage 77.66% 77.70% +0.04% =========================================== Files 324 324 Lines 20824 20864 +40 Branches 1454 1458 +4 =========================================== + Hits 16173 16213 +40 Misses 4648 4648 Partials 3 3 ``` | [Flag](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2340/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev) | Coverage Δ | | |---|---|---| | [cpp](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2340/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev) | `73.48% <90.00%> (+0.05%)` | :arrow_up: | | [cpp_python](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2340/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev) | `34.23% <22.50%> (-0.03%)` | :arrow_down: | | [petab](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2340/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev) | `36.82% <20.00%> (-0.04%)` | :arrow_down: | | [python](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2340/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev) | `72.25% <77.50%> (+0.02%)` | :arrow_up: | | [sbmlsuite](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2340/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev) | `?` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2340?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev) | Coverage Δ | | |---|---|---| | [include/amici/serialization.h](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2340?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev#diff-aW5jbHVkZS9hbWljaS9zZXJpYWxpemF0aW9uLmg=) | `96.78% <100.00%> (+0.12%)` | :arrow_up: | | [include/amici/solver.h](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2340?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev#diff-aW5jbHVkZS9hbWljaS9zb2x2ZXIuaA==) | `100.00% <100.00%> (ø)` | | | [include/amici/solver\_cvodes.h](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2340?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev#diff-aW5jbHVkZS9hbWljaS9zb2x2ZXJfY3ZvZGVzLmg=) | `100.00% <ø> (ø)` | | | [include/amici/solver\_idas.h](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2340?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev#diff-aW5jbHVkZS9hbWljaS9zb2x2ZXJfaWRhcy5o) | `100.00% <ø> (ø)` | | | [include/amici/vector.h](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2340?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev#diff-aW5jbHVkZS9hbWljaS92ZWN0b3IuaA==) | `83.33% <ø> (ø)` | | | [src/hdf5.cpp](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2340?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev#diff-c3JjL2hkZjUuY3Bw) | `89.98% <100.00%> (+0.07%)` | :arrow_up: | | [src/solver\_cvodes.cpp](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2340?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev#diff-c3JjL3NvbHZlcl9jdm9kZXMuY3Bw) | `69.91% <83.33%> (+0.14%)` | :arrow_up: | | [src/solver\_idas.cpp](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2340?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev#diff-c3JjL3NvbHZlcl9pZGFzLmNwcA==) | `37.69% <83.33%> (+0.48%)` | :arrow_up: | | [src/solver.cpp](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2340?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev#diff-c3JjL3NvbHZlci5jcHA=) | `75.71% <84.61%> (+0.13%)` | :arrow_up: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2340/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev)