diff --git a/CMakeLists.txt b/CMakeLists.txt index 0608664109..cf40b33264 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}) diff --git a/README.md b/README.md index 750fc1b2c6..efac331da8 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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 @@ -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 @@ -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 @@ -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 @@ -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) @@ -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. diff --git a/documentation/README.md b/documentation/README.md index 8108891f5e..bc491d0d4d 100644 --- a/documentation/README.md +++ b/documentation/README.md @@ -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 @@ -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. diff --git a/documentation/development.md b/documentation/development.md index eedfeb5d88..f8b951bc91 100644 --- a/documentation/development.md +++ b/documentation/development.md @@ -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 @@ -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* diff --git a/include/amici/misc.h b/include/amici/misc.h index 8b6a20cead..72f536acbd 100644 --- a/include/amici/misc.h +++ b/include/amici/misc.h @@ -11,7 +11,7 @@ #include namespace amici { - + /** * @brief creates a slice from existing data * @@ -20,9 +20,9 @@ namespace amici { * @param size slice size * @return span of the slice */ - - gsl::span slice(std::vector &data, const int index, - const unsigned size); + + gsl::span slice(std::vector &data, int index, + unsigned size); /** * @brief Checks the values in an array for NaNs and Infs diff --git a/include/amici/model.h b/include/amici/model.h index 542abb971c..2f77b152e0 100644 --- a/include/amici/model.h +++ b/include/amici/model.h @@ -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 diff --git a/python/sdist/setup.py b/python/sdist/setup.py index ba239f3534..fe6356d6e9 100755 --- a/python/sdist/setup.py +++ b/python/sdist/setup.py @@ -163,7 +163,7 @@ def main(): 'develop': my_develop, }, version=__version__, - description='Advanced multi-language Interface to CVODES and IDAS (%s)', + description='Advanced multi-language Interface to CVODES and IDAS', long_description=long_description, long_description_content_type="text/markdown", url='https://github.com/ICB-DCM/AMICI', diff --git a/src/interface_matlab.cpp b/src/interface_matlab.cpp index bd39951644..34a056c96b 100644 --- a/src/interface_matlab.cpp +++ b/src/interface_matlab.cpp @@ -2,8 +2,8 @@ * @file interface_matlab.cpp * @brief core routines for mex interface * - * This file defines the fuction mexFunction which is executed upon calling the - * mex file from matlab + * This file defines the function `mexFunction` which is executed upon calling + * the `.mex` file from Matlab. */ #include "amici/interface_matlab.h" @@ -23,7 +23,7 @@ namespace amici { int dbl2int(const double x); /** - * @brief The mexFunctionArguments enum takes care of the ordering of mex file + * @brief The mexRhsArguments enum takes care of the ordering of mex file * arguments (indexing in prhs) */ enum mexRhsArguments { @@ -41,8 +41,7 @@ enum mexRhsArguments { /*! - * amici_blasCBlasTransToBlasTrans translates AMICI_BLAS_TRANSPOSE values to - * CBlas readable strings + * Translates AMICI_BLAS_TRANSPOSE values to CBLAS readable strings * * @param trans flag indicating transposition and complex conjugation * @@ -480,7 +479,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { std::unique_ptr edata; if (nrhs > amici::RHS_DATA && mxGetPr(prhs[amici::RHS_DATA])) { try { - edata = std::move(amici::expDataFromMatlabCall(prhs, *model)); + edata = amici::expDataFromMatlabCall(prhs, *model); } catch (amici::AmiException const& ex) { amici::errMsgIdAndTxt("AMICI:mex:setup","Failed to read experimental data:\n%s",ex.what()); } diff --git a/src/main.template.cpp b/src/main.template.cpp index 6d6caf54a8..07ff62a322 100644 --- a/src/main.template.cpp +++ b/src/main.template.cpp @@ -10,8 +10,7 @@ #include "wrapfunctions.h" /* model-provided functions */ /* This is a scaffold for a stand-alone AMICI simulation executable - * demonstrating - * use of the AMICI C++ API. + * demonstrating the use of the AMICI C++ API. * * This program reads AMICI options from an HDF5 file, prints some results * and writes additional results to an HDF5 file. The name of the HDF5 file