Skip to content

Commit

Permalink
Release 0.10.12
Browse files Browse the repository at this point in the history
Merge pull request #817 from ICB-DCM/develop
  • Loading branch information
dweindl authored Sep 28, 2019
2 parents 50313ad + 3ee5e16 commit 8875a64
Show file tree
Hide file tree
Showing 18 changed files with 189 additions and 157 deletions.
1 change: 1 addition & 0 deletions .cppcheck-exitcode-suppressions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alloca:*:*
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ add_custom_target(
swig/CMakeLists_model.cmake
swig/modelname.template.i
)
set_target_properties(fileTemplates
PROPERTIES INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/include/")


if($ENV{ENABLE_GCOV_COVERAGE})
Expand Down
42 changes: 25 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ AMICI provides a multi-language (Python, C++, Matlab) interface for the
[IDAS](https://computing.llnl.gov/projects/sundials/idas)
(for algebraic differential equations). AMICI allows the user to read
differential equation models specified as [SBML](http://sbml.org/)
and automatically compiles such models as `.mex` simulation files
or [PySB](http://pysb.org/)
and automatically compiles such models into `.mex` simulation files
(Matlab), C++ executables or Python modules.

In contrast to the (no longer maintained)
Expand All @@ -17,7 +18,7 @@ C++ code, which allows for a significantly faster simulation.

Beyond forward integration, the compiled simulation file also allows for
forward sensitivity analysis, steady state sensitivity analysis and
adjoint sensitivity analysis for likelihood based output functions.
adjoint sensitivity analysis for likelihood-based output functions.

The interface was designed to provide routines for efficient gradient
computation in parameter estimation of biochemical reaction models but
Expand All @@ -28,6 +29,7 @@ constrained optimization problems.
## Features

* SBML import (see details below)
* PySB import
* Generation of C++ code for model simulation and sensitivity
computation
* Access to and high customizability of CVODES and IDAS solver
Expand All @@ -40,7 +42,7 @@ constrained optimization problems.
* Pre-equilibration and pre-simulation conditions
* Support for
[discrete events and logical operations](https://academic.oup.com/bioinformatics/article/33/7/1049/2769435)

(Matlab-only)

## Interfaces & workflow

Expand All @@ -55,21 +57,21 @@ is then used for model simulation.

## Getting started

AMICI installation instructions are provided
[here](http://icb-dcm.github.io/AMICI/md__i_n_s_t_a_l_l.html).
The AMICI source code is available at https://github.com/ICB-DCM/AMICI/.
To install AMICI, first read the
[installation instructions](http://icb-dcm.github.io/AMICI/md__i_n_s_t_a_l_l.html).

To get you started with Python-AMICI the best way might be this
To get you started with Python-AMICI, the best way might be checking out this
[Jupyter notebook](https://github.com/ICB-DCM/AMICI/blob/master/python/examples/example_steadystate/ExampleSteadystate.ipynb).

For Matlab, various examples are available
[here](https://github.com/ICB-DCM/AMICI/tree/master/matlab/examples).

To get started with Matlab-AMICI, various examples are available
in [matlab/examples/](https://github.com/ICB-DCM/AMICI/tree/master/matlab/examples).

Comprehensive documentation on installation and usage of AMICI is available
online at [http://icb-dcm.github.io/AMICI/](http://icb-dcm.github.io/AMICI/).

Any contributions to AMICI are welcome, read more contributing
[here](http://icb-dcm.github.io/AMICI/md__c_o_n_t_r_i_b_u_t_i_n_g.html).
Any [contributions](http://icb-dcm.github.io/AMICI/md__c_o_n_t_r_i_b_u_t_i_n_g.html)
to AMICI are welcome (code, bug reports, suggestions for improvements, ...).


### Getting help
Expand All @@ -88,18 +90,25 @@ If you used AMICI in your work, we are happy to include
your project, please let us know via a Github issue.

When using AMICI in your project, please cite
* [Fröhlich, F., Kaltenbacher, B., Theis, F. J., & Hasenauer, J. (2017). Scalable Parameter Estimation for Genome-Scale Biochemical Reaction Networks. Plos Computational Biology, 13(1), e1005331. doi: 10.1371/journal.pcbi.1005331](https://doi.org/10.1371/journal.pcbi.1005331)
* Fröhlich, F., Kaltenbacher, B., Theis, F. J., & Hasenauer, J. (2017).
Scalable Parameter Estimation for Genome-Scale Biochemical Reaction Networks.
Plos Computational Biology, 13(1), e1005331.
doi:[10.1371/journal.pcbi.1005331](https://doi.org/10.1371/journal.pcbi.1005331)
and/or
* [Fröhlich, F., Theis, F. J., Rädler, J. O., & Hasenauer, J. (2017). Parameter estimation for dynamical systems with discrete events and logical operations. Bioinformatics, 33(7), 1049-1056. doi: 10.1093/bioinformatics/btw764](https://doi.org/10.1093/bioinformatics/btw764)
* Fröhlich, F., Theis, F. J., Rädler, J. O., & Hasenauer, J. (2017).
Parameter estimation for dynamical systems with discrete events and logical
operations. Bioinformatics, 33(7), 1049-1056.
doi:[10.1093/bioinformatics/btw764](https://doi.org/10.1093/bioinformatics/btw764)


## Status of SBML support in Python-AMICI

Python-AMICI currently passes 494 out of the 1780 (~28%) test cases from
Python-AMICI currently passes 500 out of the 1780 (~28%) test cases from
the semantic
[SBML Test Suite](https://github.com/sbmlteam/sbml-test-suite/).
[SBML Test Suite](https://github.com/sbmlteam/sbml-test-suite/)
([current status](https://github.com/ICB-DCM/AMICI/actions)).

In additional, we currently plan to add support for the following features
In addition, we currently plan to add support for the following features
(see corresponding issues for details and progress):

- Events (currently Matlab-only)
Expand All @@ -108,7 +117,6 @@ In additional, we currently plan to add support for the following features
- Species assignment rules
- Compartment assignment rules
- Models without species
- Logical operators

contributions are welcome.

Expand Down
9 changes: 3 additions & 6 deletions documentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,8 @@ This is configured in `matlab/mtoc/config`.

## Python documentation

Python documentation is processed by doxygen using the script and filters
in `scripts/`.

**NOTE:** Unfortunately, the current doxygen Python filter is unable to deal
with Python type hints (https://github.com/ICB-DCM/AMICI/issues/613).
Python documentation is processed by doxygen and doxypypy using the script and
filters in `scripts/`.


## Out-of-source documentation
Expand All @@ -60,7 +57,7 @@ Some guidelines:

* Please stick to the limit of 80 characters per line for readability of raw
Markdown files where possible.

However, note that some Markdown interpreters can handle line breaks within
links and headings, whereas others cannot. Here, compatibility is preferred
over linebreaks.
Expand Down
5 changes: 4 additions & 1 deletion documentation/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ and deploy a new release on [PyPI](https://pypi.org/project/amici/).

We try to keep a clean git history. Therefore, feature pull requests are
squash-merged to `develop`. Merging of release branches to master is done via
merge commits.
merge commits.


## When starting to work on some issue
Expand Down Expand Up @@ -127,6 +127,9 @@ described below:

* We want to maintain compatibility with g++, clang and the Intel C++ compiler

* For code formatting, we use the settings from `.clang-format` in the root
directory

* *Details to be defined*


Expand Down
8 changes: 4 additions & 4 deletions include/amici/misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <gsl/gsl-lite.hpp>

namespace amici {

/**
* @brief creates a slice from existing data
*
Expand All @@ -20,9 +20,9 @@ namespace amici {
* @param size slice size
* @return span of the slice
*/
gsl::span<realtype> slice(std::vector<realtype> &data, const int index,
const unsigned size);

gsl::span<realtype> slice(std::vector<realtype> &data, int index,
unsigned size);

/**
* @brief Checks the values in an array for NaNs and Infs
Expand Down
6 changes: 3 additions & 3 deletions include/amici/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,15 @@ class Model : public AbstractModel {
* @param sx pointer to state variable sensititivies
* @param x pointer to state variables
*/
void initializeStateSensitivities(AmiVectorArray &sx, AmiVector &x);
void initializeStateSensitivities(AmiVectorArray &sx, const AmiVector &x);

/**
* Initialises the heaviside variables h at the intial time t0
* heaviside variables activate/deactivate on event occurences
* @param x pointer to state variables
* @param dx pointer to time derivative of states (DAE only)
*/
void initHeaviside(AmiVector &x, AmiVector &dx);
void initHeaviside(const AmiVector &x, const AmiVector &dx);

/**
* @brief Number of parameters wrt to which sensitivities are computed
Expand Down Expand Up @@ -524,7 +524,7 @@ class Model : public AbstractModel {
* @param it time index
* @return t timepoint
*/
realtype getTimepoint(const int it) const;
realtype getTimepoint(int it) const;

/**
* @brief Set the timepoint vector
Expand Down
61 changes: 35 additions & 26 deletions python/amici/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,38 @@
import sys
from contextlib import suppress


def _get_amici_path():
"""
Determine package installation path, or, if used directly from git
repository, get repository root
"""
basedir = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
if os.path.exists(os.path.join(basedir, '.git')):
return os.path.abspath(basedir)
return os.path.dirname(__file__)


def _get_commit_hash():
"""Get commit hash from file"""
basedir = os.path.dirname(os.path.dirname(os.path.dirname(amici_path)))
commitfile = next(
(
file for file in [
os.path.join(basedir, '.git', 'FETCH_HEAD'),
os.path.join(basedir, '.git', 'ORIG_HEAD'),
]
if os.path.isfile(file)
),
None
)

if commitfile:
with open(commitfile) as f:
return str(re.search(r'^([\w]*)', f.read().strip()).group())
return 'unknown'


# redirect C/C++ stdout to python stdout if python stdout is redirected,
# e.g. in ipython notebook
capture_cstdout = suppress
Expand All @@ -57,14 +89,8 @@
except (ImportError, ModuleNotFoundError, AttributeError):
pass

# determine package installation path, or, if used directly from git
# repository, get repository root
if os.path.exists(os.path.join(os.path.dirname(__file__), '..', '..', '.git')):
amici_path = os.path.abspath(os.path.join(
os.path.dirname(__file__), '..', '..'))
else:
amici_path = os.path.dirname(__file__)

# Initialize AMICI paths
amici_path = _get_amici_path()
amiciSwigPath = os.path.join(amici_path, 'swig')
amiciSrcPath = os.path.join(amici_path, 'src')
amiciModulePath = os.path.dirname(__file__)
Expand All @@ -73,24 +99,7 @@
with open(os.path.join(amici_path, 'version.txt')) as f:
__version__ = f.read().strip()

# get commit hash from file
_commitfile = next(
(
file for file in [
os.path.join(amici_path, '..', '..', '..', '.git', 'FETCH_HEAD'),
os.path.join(amici_path, '..', '..', '..', '.git', 'ORIG_HEAD'),
]
if os.path.isfile(file)
),
None
)

if _commitfile:
with open(_commitfile) as f:
__commit__ = str(re.search(r'^([\w]*)', f.read().strip()).group())
else:
__commit__ = 'unknown'

__commit__ = _get_commit_hash()

try:
# These module require the swig interface and other dependencies which will
Expand Down
Loading

0 comments on commit 8875a64

Please sign in to comment.