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

Feature 2327 constraints #2339

Closed
wants to merge 23 commits into from

Conversation

dweindl
Copy link
Member

@dweindl dweindl commented Mar 4, 2024

No description provided.

dweindl and others added 23 commits February 26, 2024 10:52
* Refactor DEExporter/DEModel/csc_matrix

Reduce unnecessary coupling:

* `csc_matrix` as free function - removes the need for the codeprinter in DEModel
* Move the codeprinter to `DEExporter` where it's actually needed

* ..
…MICI-dev#2304)

Currently, parameters that are targets of initial assignments don't show up as parameters or expressions in the amici model.
This is rather not what most users would expect.

As a first step: treat all SBML parameters that are initial assignment targets and whose initial assignment evaluates to a number as amici parameters.

Related to AMICI-dev#2150.
Start moving functionality for amici model code generation to a private
subpackage `amici._codegen`. More to follow.
…CI-dev#2317)

Adds an implicit conversion function to SUNMatrixWrapper make things more readable.
Cache remote files for tests locally via pooch, and cache the pooch cache for GitHub actions.

Today, I had dozens of workflow failures due to rate-limiting or unavailability of biomodels. This is avoidable.
* Search for 64bit BLAS if supported by CMake.

* On apple, try accelerate if nothing else was specified.

  Use the new interface (https://developer.apple.com/documentation/accelerate/blas). Fixes AMICI-dev#2286.
Move model compilation to a free function in a separate module.
Easier to test and more reusable for recompilation after initial import.

Related to AMICI-dev#2306
* Upgrade to SuiteSparse 7.6

* Update build scripts

Closes AMICI-dev#2302
…MICI-dev#2305)

Currently, parameters that are targets of initial assignments don't show up as parameters or expressions in the amici model. This is rather not what most users would expect.

Therefore, treat all SBML parameters that are initial assignment targets and whose initial assignment does not evaluate to a number (for those that do, see AMICI-dev#2304) as amici expressions.
Those static expressions will be handled more efficiently after AMICI-dev#2303.

Related to AMICI-dev#2150.

See also AMICI-dev#2304.
`SbmlImporter` should construct a `DEModel`, instead of `DEModel` importing an `SbmlImporter`.

Will allow moving `DEModel` to a separate module. Closes AMICI-dev#2308.
Split expressions in `w` and its derivatives into dynamic (explicitly or implicitly time-dependent) and static ones.
Evaluate static ones only when needed, i.e. after (re)initializing x_rdata or parameters.

See AMICI-dev#1269
…#2323)

... to make space to move `amici.de_export.DEModel` to `amici.de_model`

Related to AMICI-dev#2306.
…MICI-dev#2321)

Move everything related to information on C++ model functions to a separate module.

Related to AMICI-dev#2306.

No changes in functionality.
Move functionality for generating the ``amici::Model`` subclass code to a separate file.

Related to AMICI-dev#2306
* Refactor de_export, extract DEModel

Move `de_export.DEModel` to `de_model`.

Closes AMICI-dev#2306. de_export is now down to 1.5K lines, from previously 4K+.
Some further cleanup would be good, but it's a start.

* ..

* ..
Previously, the wrong array was checked 🙈:

```python
amici_model.setAllStatesNonNegative()
amici_model.setStateIsNonNegative([])
amici_model.setAllStatesNonNegative()

Traceback (most recent call last):
  File "<ipython-input-22-d7056e8e4e3f>", line 1, in <module>
    amici_model.setAllStatesNonNegative()
  File "python/sdist/amici/amici.py", line 2243, in setAllStatesNonNegative
    return _amici.ModelPtr_setAllStatesNonNegative(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Dimension of input stateIsNonNegative (0) does not agree with number of state variables (2)
```
Finally works with Python3.12 without DeprecationWarnings
Previously, an exception during `ReturnData::processSimulationObjects` would result in program termination.

Fixes AMICI-dev#1882.
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](https://sundials.readthedocs.io/en/latest/cvode/Usage/index.html#c.CVodeSetConstraints) for details.

Related to AMICI-dev#2327.
@dweindl dweindl closed this Mar 4, 2024
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.

None yet

1 participant