Skip to content

Commit

Permalink
Merge pull request #1159 from ICB-DCM/release_0_11_12
Browse files Browse the repository at this point in the history
Release 0.11.2
  • Loading branch information
FFroehlich authored Jul 17, 2020
2 parents ffb5f33 + 40575bc commit d220128
Show file tree
Hide file tree
Showing 98 changed files with 4,864 additions and 1,386 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy_sdist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run: |
cd python/sdist && /usr/bin/python3 setup.py sdist
- name: Archive sdist
- name: "Upload artifact: sdist"
uses: actions/upload-artifact@v1
with:
name: sdist
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/sbml-semantic-test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ on:
- master
pull_request:
paths:
- python/amici/sbml_import.py
- .github/workflows/sbml-semantic-test-suite.yml
- python/amici/ode_export.py
- python/amici/sbml_import.py
- scripts/run-SBMLTestsuite.sh
- tests/testSBMLSuite.py
check_suite:
Expand All @@ -30,3 +31,9 @@ jobs:
&& sudo ln -s /usr/bin/swig3.0 /usr/bin/swig
- run: AMICI_PARALLEL_COMPILE=2 ./scripts/installAmiciSource.sh
- run: AMICI_PARALLEL_COMPILE=2 ./scripts/run-SBMLTestsuite.sh

- name: "Upload artifact: SBML semantic test suite results"
uses: actions/upload-artifact@v1
with:
name: amici-semantic-results
path: tests/amici-semantic-results
7 changes: 6 additions & 1 deletion .github/workflows/test-large-model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
branches:
- develop
- master
- fix_sx0_zeros

pull_request:
branches:
Expand Down Expand Up @@ -59,6 +58,12 @@ jobs:
-y 'FroehlichKes2018/PEtab/FroehlichKes2018.yaml' \
--no-compile
- name: "Upload artifact: CS_Signalling_ERBB_RAS_AKT_petab"
uses: actions/upload-artifact@v1
with:
name: CS_Signalling_ERBB_RAS_AKT
path: CS_Signalling_ERBB_RAS_AKT/CS_Signalling_ERBB_RAS_AKT_petab

# install model package
- name: Install test model
run: |
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/test_cplusplus_osx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: C++ testsuite / OSX
on: [push]

jobs:
build:
name: tests_osx

runs-on: macos-latest

env:
ENABLE_GCOV_COVERAGE: FALSE
CI_SONARCLOUD: FALSE

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

- run: echo "::set-env name=AMICI_DIR::$(pwd)"
- run: echo "::set-env name=BNGPATH::${AMICI_DIR}/ThirdParty/BioNetGen-2.3.2"

# install amici dependencies
- name: homebrew
run: |
brew install hdf5 swig gcc cppcheck libomp
- name: Build suitesparse
run: |
scripts/buildSuiteSparse.sh
- name: Build sundials
run: |
scripts/buildSundials.sh
- name: Build cpputest
run: |
scripts/buildCpputest.sh
- name: Build cpputest
run: |
scripts/buildBNGL.sh
- name: Build AMICI
run: |
scripts/buildAmici.sh
- name: Install python archive
run: |
scripts/installAmiciArchive.sh
- name: Install python package
run: |
scripts/installAmiciSource.sh
- name: cppcheck
run: |
scripts/run-cppcheck.sh
- name: notebooks
run: |
scripts/runNotebook.sh python/examples/example_*/
- name: Python tests
run: |
scripts/run-python-tests.sh
- name: C++ tests
run: |
scripts/run-cpputest.sh
- name: sphinx
run: |
scripts/run-sphinx.sh
2 changes: 0 additions & 2 deletions .github/workflows/test_cplusplus_valgrind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ on:
branches:
- develop
- master
- feature_1053_sonarcloud


jobs:
build:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ petab_test_suite
python/examples/example_steadystate/model_steadystate_scaled/*
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/sdist/amici.egg-info/*
python/sdist/amici/version.txt
Expand Down
26 changes: 0 additions & 26 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,32 +69,6 @@ matrix:
- CI_PYTHON=TRUE
- CI_NOTEBOOK=TRUE

- os: osx
osx_image: xcode11
language: minimal
compiler: clang
env:
- CI_BUILD=TRUE
- CI_CPPUTEST=TRUE
- CI_ARCHIVE=TRUE
- CI_CPPCHECK=TRUE
- CI_PYTHON=TRUE
- CI_NOTEBOOK=TRUE
addons:
homebrew:
packages:
- hdf5
- swig
- gcc
- cppcheck
update: true
before_install:
- travis_wait brew link --overwrite gcc # fix linker warning regarding /usr/local/include/c++
- brew link --overwrite python # https://github.com/ICB-DCM/AMICI/issues/894
- export -f travis_fold travis_nanoseconds travis_time_start travis_time_finish
after_success:
- cd $BASE_DIR # cd to base dir for correct relative path in deploy

- os: osx
osx_image: xcode11
language: minimal
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions include/amici/abstract_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,39 @@ class AbstractModel {
const AmiVector &dx, int ip, const AmiVector &sx,
const AmiVector &sdx, AmiVector &sxdot) = 0;

/**
* @brief Residual function backward when running in steady state mode
* @param t time
* @param xB adjoint state
* @param dxB time derivative of state (DAE only)
* @param xBdot array to which values of the residual function will be
* written
*/
virtual void fxBdot_ss(const realtype t, const AmiVector &xB,
const AmiVector &dxB, AmiVector &xBdot) = 0;

/**
* @brief Sparse Jacobian function backward, steady state case
* @param JB sparse matrix to which values of the Jacobian will be written
*/
virtual void fJSparseB_ss(SUNMatrix JB) = 0;

/**
* @brief Computes the sparse backward Jacobian for steadystate integration
* and writes it to the model member
* @param t timepoint
* @param cj scalar in Jacobian
* @param x Vector with the states
* @param dx Vector with the derivative states
* @param xB Vector with the adjoint states
* @param dxB Vector with the adjoint derivative states
* @param xBdot Vector with the adjoint state right hand side
*/
virtual void writeSteadystateJB(const realtype t, realtype cj,
const AmiVector &x, const AmiVector &dx,
const AmiVector &xB, const AmiVector &dxB,
const AmiVector &xBdot) = 0;

/**
* @brief Dense Jacobian function
* @param t time
Expand All @@ -81,6 +114,22 @@ class AbstractModel {
const AmiVector &dx, const AmiVector &xdot,
SUNMatrix J) = 0;

/**
* @brief Dense Jacobian function
* @param t time
* @param cj scaling factor (inverse of timestep, DAE only)
* @param x state
* @param dx time derivative of state (DAE only)
* @param xB Vector with the adjoint states
* @param dxB Vector with the adjoint derivative states
* @param xBdot Vector with the adjoint right hand side (unused)
* @param JB dense matrix to which values of the jacobian will be written
*/
virtual void fJB(const realtype t, realtype cj, const AmiVector &x,
const AmiVector &dx, const AmiVector &xB,
const AmiVector &dxB, const AmiVector &xBdot,
SUNMatrix JB) = 0;

/**
* @brief Sparse Jacobian function
* @param t time
Expand All @@ -94,6 +143,22 @@ class AbstractModel {
const AmiVector &dx, const AmiVector &xdot,
SUNMatrix J) = 0;

/**
* @brief Sparse Jacobian function
* @param t time
* @param cj scaling factor (inverse of timestep, DAE only)
* @param x state
* @param dx time derivative of state (DAE only)
* @param xB Vector with the adjoint states
* @param dxB Vector with the adjoint derivative states
* @param xBdot Vector with the adjoint right hand side (unused)
* @param JB dense matrix to which values of the jacobian will be written
*/
virtual void fJSparseB(const realtype t, realtype cj, const AmiVector &x,
const AmiVector &dx, const AmiVector &xB,
const AmiVector &dxB, const AmiVector &xBdot,
SUNMatrix JB) = 0;

/**
* @brief Diagonal Jacobian function
* @param t time
Expand Down
4 changes: 2 additions & 2 deletions include/amici/amici.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ class AmiciApplication {
* @param format string with warning message printf-style format
* @param ... arguments to be formatted
*/
void warningF(const char *identifier, const char *format, ...);
void warningF(const char *identifier, const char *format, ...) const;

/**
* @brief printf interface to error()
* @param identifier warning identifier
* @param format string with error message printf-style format
* @param ... arguments to be formatted
*/
void errorF(const char *identifier, const char *format, ...);
void errorF(const char *identifier, const char *format, ...) const;

/**
* @brief Checks the values in an array for NaNs and Infs
Expand Down
22 changes: 17 additions & 5 deletions include/amici/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ constexpr int AMICI_ERR_FAILURE= -3;
constexpr int AMICI_CONV_FAILURE= -4;
constexpr int AMICI_ILL_INPUT= -22;
constexpr int AMICI_ERROR= -99;
constexpr int AMICI_NO_STEADY_STATE= -81;
constexpr int AMICI_DAMPING_FACTOR_ERROR= -86;
constexpr int AMICI_SINGULAR_JACOBIAN= -807;
constexpr int AMICI_NOT_IMPLEMENTED= -999;
constexpr int AMICI_SUCCESS= 0;
Expand Down Expand Up @@ -136,11 +138,21 @@ enum class SteadyStateSensitivityMode {
};

/** State in which the steady state computation finished */
enum class NewtonStatus {
failed=-1,
newt=1,
newt_sim=2,
newt_sim_newt=3,
enum class SteadyStateStatus {
failed_too_long_simulation = -5,
failed_damping = -4,
failed_factorization = -3,
failed_convergence = -2,
failed = -1,
not_run = 0,
success = 1
};

/** Context for which the sensitivity flag should be computed */
enum class SteadyStateContext {
newtonSensi = 0,
sensiStorage = 1,
solverCreation = 2
};

/** Damping factor flag for the Newton method */
Expand Down
13 changes: 7 additions & 6 deletions include/amici/exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "amici/defines.h" // necessary for realtype

#include <exception>
#include <array>

namespace amici {

Expand All @@ -19,13 +20,13 @@ class AmiException : public std::exception {
* @param fmt error message with printf format
* @param ... printf formating variables
*/
AmiException(char const* fmt, ...);
explicit AmiException(char const* fmt, ...);

/**
* @brief Copy constructor
* @param old object to copy from
* @brief Move constructor
* @param old object to move from
*/
AmiException(const AmiException& old);
AmiException(AmiException&& old) noexcept;

/**
* @brief Override of default error message function
Expand All @@ -46,8 +47,8 @@ class AmiException : public std::exception {
void storeBacktrace(int nMaxFrames);

private:
char msg[500]{};
char trace[500]{};
std::array<char, 500> msg;
std::array<char, 500> trace;
};


Expand Down
Loading

0 comments on commit d220128

Please sign in to comment.