Skip to content

Commit

Permalink
Release 0.11.11 (#1363)
Browse files Browse the repository at this point in the history
* Fix: Don't require code context for call stack (fixes #1347) (#1348)

* Fix Intel compiler warnings (#1349)

'type qualifier on return type is meaningless'

Closes #1346

* Avoid segfault in CVODES CVAdataStore (#1351)

Does not fix the root cause of occassional segfaults, but turns them into exceptions / integration failues.

* CI: Move windows tests from TravisCI to GitHub Actions (#1354)

Closes #1350

Removes obsolete .travis.yml

* Fix cxxcode import for SymPy 1.6 (#1356)

* Piecewise to heaviside (#1352)

* parse piecewise into heaviside functions

* Add Events as model quantity, parse Heavisides slightly differently

* bugfix

* rename symbols of root to h and switch order of functions to make sure h is known when dxdotdx_explicit is generated, to have the header file of h included

* rename root symbols to HeavisideFunction_ to have things more indicative

* tell AMICI about root, stau, and deltasx functions

* heavisides without sensitivities should be working

* need to change generation of stau to generration via inverse function theorem

* compute stau via inverse function theorem

* added functionality for deltasx, but segfaulting

* bugfixing

* remove debug output

* get indentations right

* Update python/amici/ode_export.py

Co-authored-by: Fabian Fröhlich <[email protected]>

* Update python/amici/ode_export.py

Co-authored-by: Fabian Fröhlich <[email protected]>

* Update python/amici/ode_export.py

Co-authored-by: Fabian Fröhlich <[email protected]>

* Update python/amici/ode_export.py

Co-authored-by: Fabian Fröhlich <[email protected]>

* Update python/amici/ode_export.py

Co-authored-by: Fabian Fröhlich <[email protected]>

* Update python/amici/sbml_import.py

Co-authored-by: Fabian Fröhlich <[email protected]>

* add a test for trajectories

* fix sroot and test

* cosmetic

* add analytical expressions for sensitivities

* add test for a complex condition

* add test for many conditions

* fix test

* improve documentation

* rename tests and refactor test for iterated piecewise, to check SBML piecewise logic a bit further

* cleanup for code review

* further cleanup

* quarter way done with parsing heavisides into piecewise

* fix logic parsing

* monkeypatch sympy printer

* enable more tests

* implement denesting of piecewise

* fix SBML nonsense

* fix boolean triggers

* simplify logic checks

* fix code smells

* add events to variable prototypes

* cleanup

* report details for skipped tests durin GHA run

* better skip printing

* resubstitution of non-optimized RHS into stau

* add sensitivity tests

* refactor tests

* remove skipping display code

* update test stats

* Update python/amici/ode_export.py

* Apply suggestions from code review

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

* document and simplify _collect_heaviside_roots

* address review comments

* reduce complexity

* misplaced docstrings

Co-authored-by: Fabian Fröhlich <[email protected]>
Co-authored-by: dilpath <[email protected]>
Co-authored-by: Daniel Weindl <[email protected]>

* restore support for species references (#1358)

* restore support for species references

* fixup and improve error message

* extend support for sbml functions (#1357)

* add more function mappings

* fixup min/max

* fix rem

* add Mod to unsupported functions

* more trigonometric functions

* more functions, fix xref

* fix xref with init assignment

* extend unsupported functions

* fix plus with empty arguments, update statistics

* update test stats

* fix stats

* Refactor: introduce import_utils.py (#1361)

* Refactor: introduce import_utils.py

To collect format-independent functions for model import.

* add additional file to SBML Testsuite path check

* Include new module in doc

Co-authored-by: Fabian Fröhlich <[email protected]>

* CI: Show all compiler warnings and treat as error (#1362)

* CI: Show all compiler errors and treat as error

Closes #1167

* Fix unused arguments

* Fix deprecated-copy

* Fix NVector (non-)const mess

* Fix CMake deprecation warning

* Fix doxygen

* Fix some typos

* Simplify / reduce number of const_casts

* Add support for different noise models for PySB import (#1360)

* Add support for different noise models for PySB import

.. as already the case for SBML import.

Closes #1176

* Respect noise model selection for PySB-PEtab import (#1339)

* doc, import

* Respect observable transformation for PySB-PEtab import (Fixes #1339)

* Set ODEModel._has_quadratic_nllh

Co-authored-by: Fabian Fröhlich <[email protected]>

* version bump

* fix some code smells to trigger GHA builds again?

* update docker to 20.04

* pin breathe

Co-authored-by: Daniel Weindl <[email protected]>
Co-authored-by: Lorenzo Contento <[email protected]>
Co-authored-by: Paul Stapor <[email protected]>
Co-authored-by: dilpath <[email protected]>
  • Loading branch information
5 people authored Dec 15, 2020
1 parent 275e599 commit a5c679b
Show file tree
Hide file tree
Showing 58 changed files with 1,980 additions and 863 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test_sbml_semantic_test_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- .github/workflows/test_sbml_semantic_test_suite.yml
- python/amici/ode_export.py
- python/amici/sbml_import.py
- python/amici/import_utils.py
- scripts/run-SBMLTestsuite.sh
- tests/testSBMLSuite.py
check_suite:
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/test_windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Windows Tests
on: [push, pull_request, workflow_dispatch]

jobs:
build:
name: Tests Windows

runs-on: windows-2019

env:
AMICI_SKIP_CMAKE_TESTS: "TRUE"
openBLAS_version: "0.3.12"

steps:
- uses: actions/checkout@master
- run: git fetch --prune --unshallow

- shell: bash
run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV
- shell: bash
run: echo "C:\\BLAS\\bin" >> $GITHUB_PATH
- shell: bash
run: echo "BLAS_LIBS=/LIBPATH:C:/BLAS/lib openblas.lib" >> $GITHUB_ENV
- shell: bash
run: echo "BLAS_CFLAGS=-IC:/BLAS/OpenBLAS-${openBLAS_version}/OpenBLAS-${openBLAS_version}" >> $GITHUB_ENV

# Developer Command Prompt for Microsoft Visual C++
- uses: ilammy/msvc-dev-cmd@v1

- name: Install deps
shell: bash
run: |
python -m pip install --upgrade pip \
&& pip install pytest petab \
&& choco install -y ninja \
&& choco install -y swig --version=4.0.1
- name: Install OpenBLAS
shell: powershell
run: scripts/installOpenBLAS

- name: Create sdist
working-directory: python/sdist
run: python setup.py sdist

- name: Install sdist
working-directory: python/sdist
shell: bash
run: pip install -v $(ls -t dist/amici-*.tar.gz | head -1)

- name: Run Python tests
run: python -m pytest --ignore-glob=*petab* --ignore-glob=*special* python/tests
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ python/examples/example_presimulation/model_presimulation/*
python/examples/example_presimulation/model_presimulation_re/*
python/examples/example_constant_species/model_constant_species_reduced/*
python/examples/example_constant_species/model_constant_species/*
python/tests/sbml_test_models/*

python/sdist/amici.egg-info/*
python/sdist/amici/version.txt
Expand Down Expand Up @@ -191,3 +192,4 @@ tests/performance/CS_Signalling_ERBB_RAS_AKT_petab/*
coverage_SBMLSuite.xml
Benchmark-Models-PEtab/


50 changes: 0 additions & 50 deletions .travis.yml

This file was deleted.

3 changes: 3 additions & 0 deletions ThirdParty/sundials/src/cvodes/cvodea.c
Original file line number Diff line number Diff line change
Expand Up @@ -2026,6 +2026,9 @@ static int CVAdataStore(CVodeMem cv_mem, CkpntMem ck_mem)
/* Run CVode to set following structures in dt_mem[i] */
i = 1;
do {
// Modified for AMICI
// (dt_mem has dimension ca_mem->ca_nsteps)
if (i > ca_mem->ca_nsteps) return(CV_FWD_FAIL);

flag = CVode(cv_mem, ck_mem->ck_t1, ca_mem->ca_ytmp, &t, CV_ONE_STEP);
if (flag < 0) return(CV_FWD_FAIL);
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:19.10
FROM ubuntu:20.04

RUN apt update \
&& apt-get install -y \
Expand Down
3 changes: 1 addition & 2 deletions documentation/python_interface.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ AMICI can import :term:`SBML` models via the
Status of SBML support in Python-AMICI
++++++++++++++++++++++++++++++++++++++

Python-AMICI currently **passes 850 out of the 1780 (~48%) test cases** from
Python-AMICI currently **passes 862 out of the 1780 (~48%) test cases** from
the semantic
`SBML Test Suite <https://github.com/sbmlteam/sbml-test-suite/>`_
(`current status <https://github.com/AMICI-dev/AMICI/actions>`_).
Expand All @@ -35,7 +35,6 @@ In addition, we currently plan to add support for the following features

- Events (currently Matlab-only)
- Algebraic rules
- Models without species

contributions are welcome.

Expand Down
1 change: 1 addition & 0 deletions documentation/python_modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ AMICI Python API
amici.petab_import
amici.petab_import_pysb
amici.petab_objective
amici.import_utils
amici.ode_export
amici.plotting
amici.pandas
Expand Down
2 changes: 1 addition & 1 deletion documentation/rtd_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sphinx-autodoc-typehints>=1.10.3
git+https://github.com/readthedocs/sphinx-hoverxref@master
prompt-toolkit<=3.0.0
ipython>=7.17.0
breathe>=4.20.0
breathe==4.24.1
#exhale>=0.2.3
git+https://github.com/dweindl/exhale@ea77a313777c1382a7830ce9ee6c405ce47f5f3b#egg=exhale
# Newer versions cause trouble with including notebooks:
Expand Down
6 changes: 3 additions & 3 deletions include/amici/abstract_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ class AbstractModel {
virtual void fdJydy(realtype *dJydy, int iy, const realtype *p,
const realtype *k, const realtype *y,
const realtype *sigmay, const realtype *my);

/**
* @brief Model-specific implementation of fdJydy colptrs
* @param dJydy sparse matrix to which colptrs will be written
Expand Down Expand Up @@ -800,15 +800,15 @@ class AbstractModel {
* @param dwdx sparse matrix to which rowvals will be written
*/
virtual void fdwdx_rowvals(SUNMatrixWrapper &dwdx);

/**
* @brief Model specific implementation of fdwdw, no w chainrule (Py)
* @param dwdw partial derivative w wrt w
* @param t timepoint
* @param x Vector with the states
* @param p parameter vector
* @param k constants vector
* @param h heavyside vector
* @param h Heaviside vector
* @param w vector with helper variables
* @param tcl Total abundances for conservation laws
*/
Expand Down
2 changes: 1 addition & 1 deletion include/amici/edata.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class ExpData {
* @brief set function that copies observed data for specific observable
*
* @param observedData observed data (dimension: nt)
* @param iy oberved data index
* @param iy observed data index
*/
void setObservedData(const std::vector<realtype> &observedData, int iy);

Expand Down
2 changes: 1 addition & 1 deletion include/amici/hdf5.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ void createAndWriteDouble3DDataset(H5::H5File const &file,
/**
* @brief Read scalar native double attribute from HDF5 object.
* @param file HDF5 file
* @param optionsObject Object to read attribute frin
* @param optionsObject Object to read attribute from
* @param attributeName Name of attribute to read
* @return Attribute value
*/
Expand Down
24 changes: 12 additions & 12 deletions include/amici/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class Model : public AbstractModel {
using AbstractModel::fx0_fixedParameters;
using AbstractModel::fy;
using AbstractModel::fz;

/**
* @brief Initialize model properties.
* @param x Reference to state variables
Expand Down Expand Up @@ -597,7 +597,7 @@ class Model : public AbstractModel {
* @return Observable IDs
*/
virtual std::vector<std::string> getObservableIds() const;

/**
* @brief Checks whether the defined noise model is gaussian, i.e., the nllh is quadratic
* @return boolean flag
Expand Down Expand Up @@ -1298,13 +1298,13 @@ class Model : public AbstractModel {

/** Flag indicating Matlab- or Python-based model generation */
bool pythonGenerated;

/**
* @brief getter for dxdotdp (matlab generated)
* @return dxdotdp
*/
const AmiVectorArray &get_dxdotdp() const;

/**
* @brief getter for dxdotdp (python generated)
* @return dxdotdp
Expand Down Expand Up @@ -1642,7 +1642,7 @@ class Model : public AbstractModel {
* @param x Array with the states
*/
void fdwdx(realtype t, const realtype *x);

/**
* @brief Compute self derivative for recurring terms in xdot.
* @param t Timepoint
Expand Down Expand Up @@ -1736,7 +1736,7 @@ class Model : public AbstractModel {
* @return State vector with negative values replaced by `0` according to
* stateIsNonNegative
*/
N_Vector computeX_pos(const_N_Vector x);
const_N_Vector computeX_pos(const_N_Vector x);

/** All variables necessary for function evaluation */
ModelState state_;
Expand All @@ -1752,13 +1752,13 @@ class Model : public AbstractModel {

/** Sparse dwdx temporary storage (dimension: `ndwdx`) */
mutable SUNMatrixWrapper dwdx_;

/** Sparse dwdp temporary storage (dimension: `ndwdp`) */
mutable SUNMatrixWrapper dwdp_;

/** Dense Mass matrix (dimension: `nx_solver` x `nx_solver`) */
mutable SUNMatrixWrapper M_;

/**
* Temporary storage of `dxdotdp_full` data across functions (Python only)
* (dimension: `nplist` x `nx_solver`, nnz: dynamic,
Expand All @@ -1780,7 +1780,7 @@ class Model : public AbstractModel {
* type `CSC_MAT`)
*/
mutable SUNMatrixWrapper dxdotdp_implicit;

/**
* Temporary storage of `dxdotdx_explicit` data across functions (Python only)
* (dimension: `nplist` x `nx_solver`, nnz: 'nxdotdotdx_explicit',
Expand Down Expand Up @@ -2005,10 +2005,10 @@ class Model : public AbstractModel {

/** Sparse dwdw temporary storage (dimension: `ndwdw`) */
mutable SUNMatrixWrapper dwdw_;

/** Sparse dwdx implicit temporary storage (dimension: `ndwdx`) */
mutable std::vector<SUNMatrixWrapper> dwdx_hierarchical_;

/** Recursion */
int w_recursion_depth_ {0};
};
Expand Down
Loading

0 comments on commit a5c679b

Please sign in to comment.