Skip to content

Commit 32ff587

Browse files
authored
Miscellaneous fixes, python packaging and python API improvements (#327)
* fix(swig) Make enums and constants available in python * fix(python) edata is regular pointer, not unique_ptr here * refactor(cmake) * fix(python) Fix linking order. Fix C++ standard. * feature(python) Add verbosity switch for model compilation * feature(python) Add verbosity switch for sbml2amici * fix(python) Make swig aware of enums in time to generate appropriate mappers * doc(python) Extend python API steadystate example. Change to notebook. * fix(python) Check edata type. Here it can be regular or unique pointer * fix(python) Check edata type. Here it can be regular or unique pointer * doc(python) Cleanup notebook * doc(python) Add finite differences sensitivity check to example * feature(python) Allow blas selection for amici base package installation via environment variables #320 * doc(python) Add model info to example * Fix(python) Fix negative log likelihood * Feature(python) Expose std::vector<amici::AMICI_parameter_scaling> as ParameterScalingVector * doc(core) Fix dimension order * ci(python) Run gradient check for example models (don't fail test yet) * ci(travis) Install scipy * build(cmake) CMake cleanup * ci(travis) Test creating and installing sdist on ci server * fix(python) Increase chances of finding swig on OSX #320 * ci(python) Don't use pyenv pip which is broken by recent update File '/opt/pyenv/versions/3.6/bin/pip3', line 7, in <module> from pip import main ImportError: cannot import name 'main' * fix(python) Catch hdf5.cpp not found problem #320 * doc(doxygen) Ignore autogenerated file * fix(python) Set sensitivity flag for dydp (thx FFroehlich) * feature(python) Exception on package setup failure * fix(python) Fix sx summation. Fixes sx gradient check (thx FFroehlich) * fix(python) fix sy computation in python generated models * Fix typo, rewrap models, remove notebook test code
1 parent 17c07e8 commit 32ff587

File tree

25 files changed

+1429
-183
lines changed

25 files changed

+1429
-183
lines changed

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,17 @@ install:
5858
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then pyenv versions; fi
5959
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then pyenv shell 2.7 3.6; fi
6060
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH=/Users/travis/Library/Python/3.6/bin:$PATH; fi
61-
- pip3 install --user --upgrade pip setuptools wheel pkgconfig doxypypy coverage
61+
- pip3 install --user --upgrade pip setuptools wheel pkgconfig doxypypy coverage scipy
6262
- ./scripts/buildSuiteSparse.sh
6363
- ./scripts/buildSundials.sh
6464
- ./scripts/buildCpputest.sh
6565
- ./scripts/buildAmici.sh
6666

6767
script:
68+
- cd $BASE_DIR/python/sdist
69+
- python3 setup.py sdist --dist-dir=$BASE_DIR/build/python/
70+
- python3 -m pip install $BASE_DIR/build/python/amici-*.tar.gz --verbose
71+
- cd $BASE_DIR
6872
- ./scripts/run-cpputest.sh
6973
- ./scripts/run-cppcheck.sh
7074
- cd $BASE_DIR/build && make python-tests && cd $BASE_DIR

include/amici/rdata.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class ReturnData {
8383
/** state (dimension: nt x nx, row-major) */
8484
std::vector<realtype> x;
8585

86-
/** parameter derivative of state (dimension: nt x nx x nplist,
86+
/** parameter derivative of state (dimension: nt x nplist x nx,
8787
* row-major) */
8888
std::vector<realtype> sx;
8989

@@ -93,12 +93,12 @@ class ReturnData {
9393
/** observable standard deviation (dimension: nt x ny, row-major) */
9494
std::vector<realtype> sigmay;
9595

96-
/** parameter derivative of observable (dimension: nt x ny x nplist,
96+
/** parameter derivative of observable (dimension: nt x nplist x ny,
9797
* row-major) */
9898
std::vector<realtype> sy;
9999

100100
/** parameter derivative of observable standard deviation (dimension: nt x
101-
* ny x nplist, row-major) */
101+
* nplist x ny, row-major) */
102102
std::vector<realtype> ssigmay;
103103

104104
/** observable (dimension: nt x ny, row-major) */

matlab/mtoc/config/Doxyfile.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,7 @@ EXCLUDE_PATTERNS = "_SourceDir_/models/*" \
697697
"_SourceDir_/matlab/auxiliary/*" \
698698
"_SourceDir_/matlab/SBMLImporter/*" \
699699
"_SourceDir_/python/test/*" \
700+
"_SourceDir_/python/sdist/*" \
700701
"_SourceDir_/build/*" \
701702
"_SourceDir_/build_xcode/*" \
702703
"_SourceDir_/swig/*"

models/model_dirac/model_dirac.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#ifndef _amici_model_dirac_h
22
#define _amici_model_dirac_h
3-
/* Generated by amiwrap (R2017b) 2632f34b3b684c381e19069e73b4b1277492fcf1 */
3+
/* Generated by amiwrap (R2017b) 53e279f979516a66d9b07a42c171c4fa35b6f26d */
44
#include <cmath>
55
#include <memory>
66
#include "amici/defines.h"
@@ -62,7 +62,7 @@ class Model_model_dirac : public amici::Model_ODE {
6262

6363
virtual amici::Model* clone() const override { return new Model_model_dirac(*this); };
6464

65-
const char* getAmiciVersion() const { return "2632f34b3b684c381e19069e73b4b1277492fcf1"; };
65+
const char* getAmiciVersion() const { return "53e279f979516a66d9b07a42c171c4fa35b6f26d"; };
6666

6767
virtual void fJ(realtype *J, const realtype t, const realtype *x, const double *p, const double *k, const realtype *h, const realtype *w, const realtype *dwdx) override {
6868
J_model_dirac(J, t, x, p, k, h, w, dwdx);

models/model_events/model_events.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#ifndef _amici_model_events_h
22
#define _amici_model_events_h
3-
/* Generated by amiwrap (R2017b) 2632f34b3b684c381e19069e73b4b1277492fcf1 */
3+
/* Generated by amiwrap (R2017b) 53e279f979516a66d9b07a42c171c4fa35b6f26d */
44
#include <cmath>
55
#include <memory>
66
#include "amici/defines.h"
@@ -76,7 +76,7 @@ class Model_model_events : public amici::Model_ODE {
7676

7777
virtual amici::Model* clone() const override { return new Model_model_events(*this); };
7878

79-
const char* getAmiciVersion() const { return "2632f34b3b684c381e19069e73b4b1277492fcf1"; };
79+
const char* getAmiciVersion() const { return "53e279f979516a66d9b07a42c171c4fa35b6f26d"; };
8080

8181
virtual void fJ(realtype *J, const realtype t, const realtype *x, const double *p, const double *k, const realtype *h, const realtype *w, const realtype *dwdx) override {
8282
J_model_events(J, t, x, p, k, h, w, dwdx);

models/model_jakstat_adjoint/model_jakstat_adjoint.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#ifndef _amici_model_jakstat_adjoint_h
22
#define _amici_model_jakstat_adjoint_h
3-
/* Generated by amiwrap (R2017b) 2632f34b3b684c381e19069e73b4b1277492fcf1 */
3+
/* Generated by amiwrap (R2017b) 53e279f979516a66d9b07a42c171c4fa35b6f26d */
44
#include <cmath>
55
#include <memory>
66
#include "amici/defines.h"
@@ -65,7 +65,7 @@ class Model_model_jakstat_adjoint : public amici::Model_ODE {
6565

6666
virtual amici::Model* clone() const override { return new Model_model_jakstat_adjoint(*this); };
6767

68-
const char* getAmiciVersion() const { return "2632f34b3b684c381e19069e73b4b1277492fcf1"; };
68+
const char* getAmiciVersion() const { return "53e279f979516a66d9b07a42c171c4fa35b6f26d"; };
6969

7070
virtual void fJ(realtype *J, const realtype t, const realtype *x, const double *p, const double *k, const realtype *h, const realtype *w, const realtype *dwdx) override {
7171
J_model_jakstat_adjoint(J, t, x, p, k, h, w, dwdx);

models/model_jakstat_adjoint_o2/model_jakstat_adjoint_o2.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#ifndef _amici_model_jakstat_adjoint_o2_h
22
#define _amici_model_jakstat_adjoint_o2_h
3-
/* Generated by amiwrap (R2017b) 2632f34b3b684c381e19069e73b4b1277492fcf1 */
3+
/* Generated by amiwrap (R2017b) 53e279f979516a66d9b07a42c171c4fa35b6f26d */
44
#include <cmath>
55
#include <memory>
66
#include "amici/defines.h"
@@ -65,7 +65,7 @@ class Model_model_jakstat_adjoint_o2 : public amici::Model_ODE {
6565

6666
virtual amici::Model* clone() const override { return new Model_model_jakstat_adjoint_o2(*this); };
6767

68-
const char* getAmiciVersion() const { return "2632f34b3b684c381e19069e73b4b1277492fcf1"; };
68+
const char* getAmiciVersion() const { return "53e279f979516a66d9b07a42c171c4fa35b6f26d"; };
6969

7070
virtual void fJ(realtype *J, const realtype t, const realtype *x, const double *p, const double *k, const realtype *h, const realtype *w, const realtype *dwdx) override {
7171
J_model_jakstat_adjoint_o2(J, t, x, p, k, h, w, dwdx);

models/model_nested_events/model_nested_events.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#ifndef _amici_model_nested_events_h
22
#define _amici_model_nested_events_h
3-
/* Generated by amiwrap (R2017b) 2632f34b3b684c381e19069e73b4b1277492fcf1 */
3+
/* Generated by amiwrap (R2017b) 53e279f979516a66d9b07a42c171c4fa35b6f26d */
44
#include <cmath>
55
#include <memory>
66
#include "amici/defines.h"
@@ -65,7 +65,7 @@ class Model_model_nested_events : public amici::Model_ODE {
6565

6666
virtual amici::Model* clone() const override { return new Model_model_nested_events(*this); };
6767

68-
const char* getAmiciVersion() const { return "2632f34b3b684c381e19069e73b4b1277492fcf1"; };
68+
const char* getAmiciVersion() const { return "53e279f979516a66d9b07a42c171c4fa35b6f26d"; };
6969

7070
virtual void fJ(realtype *J, const realtype t, const realtype *x, const double *p, const double *k, const realtype *h, const realtype *w, const realtype *dwdx) override {
7171
J_model_nested_events(J, t, x, p, k, h, w, dwdx);

models/model_neuron/model_neuron.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#ifndef _amici_model_neuron_h
22
#define _amici_model_neuron_h
3-
/* Generated by amiwrap (R2017b) 2632f34b3b684c381e19069e73b4b1277492fcf1 */
3+
/* Generated by amiwrap (R2017b) 53e279f979516a66d9b07a42c171c4fa35b6f26d */
44
#include <cmath>
55
#include <memory>
66
#include "amici/defines.h"
@@ -79,7 +79,7 @@ class Model_model_neuron : public amici::Model_ODE {
7979

8080
virtual amici::Model* clone() const override { return new Model_model_neuron(*this); };
8181

82-
const char* getAmiciVersion() const { return "2632f34b3b684c381e19069e73b4b1277492fcf1"; };
82+
const char* getAmiciVersion() const { return "53e279f979516a66d9b07a42c171c4fa35b6f26d"; };
8383

8484
virtual void fJ(realtype *J, const realtype t, const realtype *x, const double *p, const double *k, const realtype *h, const realtype *w, const realtype *dwdx) override {
8585
J_model_neuron(J, t, x, p, k, h, w, dwdx);

models/model_neuron_o2/model_neuron_o2.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#ifndef _amici_model_neuron_o2_h
22
#define _amici_model_neuron_o2_h
3-
/* Generated by amiwrap (R2017b) 2632f34b3b684c381e19069e73b4b1277492fcf1 */
3+
/* Generated by amiwrap (R2017b) 53e279f979516a66d9b07a42c171c4fa35b6f26d */
44
#include <cmath>
55
#include <memory>
66
#include "amici/defines.h"
@@ -81,7 +81,7 @@ class Model_model_neuron_o2 : public amici::Model_ODE {
8181

8282
virtual amici::Model* clone() const override { return new Model_model_neuron_o2(*this); };
8383

84-
const char* getAmiciVersion() const { return "2632f34b3b684c381e19069e73b4b1277492fcf1"; };
84+
const char* getAmiciVersion() const { return "53e279f979516a66d9b07a42c171c4fa35b6f26d"; };
8585

8686
virtual void fJ(realtype *J, const realtype t, const realtype *x, const double *p, const double *k, const realtype *h, const realtype *w, const realtype *dwdx) override {
8787
J_model_neuron_o2(J, t, x, p, k, h, w, dwdx);

0 commit comments

Comments
 (0)