Skip to content

Commit

Permalink
Feature swig interface (#279)
Browse files Browse the repository at this point in the history
Implement basic python support via swig, closes #272, fixes #225, fixes #128, fixes #27, closes #72

Individual changes:

* swig interface for edata

* fix names of things

* fix edata swig interface

* add rdata interface

* all necessary interfaces in a single file

* implement model specific swig interface

* update travis to install swig

* require newer swig version and update travis install

* fix unique ptr for swig

* replace most unique_ptrs by regular ptrs

* add hdf5 interface

* brack to unique_ptr wrapping

* add support for vector & string, simulation now working

* adapt to new header naming scheme and enforce cmake build order

* fix swig warnings and compile static libraries as position independent code

* compile sundials as PIC

* fix realtype vector interpretation

* basic SBML import

* prototype implementation python tests

* add default setting for unscaled parameters and according testcase

* first successfull amici call from python after python build

* extract SBML test settings

* write default model parameter into model constructor

* fix Jy code generation

* add test result check

* fix jacobian code generation

* fix djydy and djydsigma

* fix local parameters and switch to CodePrinter

* apply boundary conditions and constant species

* actually install amici as python module

* fix dwdp + dwdx generation and compartments

* automatically flatten localParameters, function definitions and initial assignments

* fix flattening code and add logfile to python sbml tests

* Add documentation to python/model.py

* better error message for unsupported functions

* fixed assignment rule for initial values

* refactor some function names and add documentation

* fix assignment of initial values with species in formula

* refactor symbols and functions

* implement replacement for reserved symbols

* New setup.py.in which allows to use install --user

* CI,py: install amici per-user

* CI,py: install setuptools

* CI: setup python environment

* CI,py: try fix: error: can't combine user with prefix, exec_prefix/home, or install_(plat)base

* Documentation; cleanup

* Fix doxygen configuration; documentation

* fix volume conversion, sbml file errors and error for non-unity stoichiometry

* fix non-unity stoichiometry check

* implement error for species assignment rules

* implement error/support for compartment and parameter assignments

* implement exception for models without species

* Don't produce bloated files with empty lines.

* implement error for nonfloat parameter assignments and implement support for time symbol

* code simplifications

* fix species reference as product/educt

* cleanup filenames and move modelname specification to wrapModel

* refactor computeModelEquations

* Build proper amici-base package. add cmake targets. fix setup.py. cleanup cmake config

* fix for speciesReferences with Stoichiometry

* refactor + fix processReactions

* fix process volume conversion

* implement errors for sbml extensions and bugfixes in processReactions and cleanReservedSymbols

* fix for empty rules ...

* fix merging errors + path cleanup

* implement support for avogadro constant and reaction stoichiometry specification weirdness

* Ensure output folder exists

* refactor(matlab) Keep matlab code contained in matlab/.

Adapt paths. Rename some abused  variables. Clean up paths for doxygen doc.

* refactor(cmake) Change to more readable folder name

* refactor(deps) Move third-party code to ThirdParty/

* refactor(doc) Fix and cleanup doxygen exclude paths. Fix mtoc paths.

* refactor(python) Make sbml import usable without assembling full amici python package.

* refactor(doc) Fix mtoc paths. Cleanup.

* test(python) add python unittesting for pregenerated models

* feature(python) Compile extension using distutils and add all required files to archive.

* feature(python) Allow custom model output directory.

* fix(tests) fix model loading and result checking

* fix(tests) fix for inf values and tweak tolerances

* refactor(python) Extract functions

* feature(python) Generate functional amici-base module and independent model modules.

amici module comes with required headers, templates, ... and cmake-built libs. these are required for subsequently compiling generated models.

* fix(travis) install pkgconfig

* fix(documentation) fix exclude patterns in doxygen configuration

* fix(python) don't try to copy before libamici was created

* fix(python) set c++11 compile flags in setup.py

* fix(ci) Find the right swig version on travisCI

* fix(cmake) Must create targets before adding dependencies

* fix(ci) Find the right swig version on travisCI

* fix(cmake/python) Run setup.py from module directory

* fix(cmake/python) Run setup.py from module directory

* debug(ci) print

* fix/feature(cmake) Set proper target dependencies. Update package files if changed.

* ci(travis) Remove debug output. List all files only upon failure.

* tests(python) Fix path to expected results file

* test(python) Fix module path. Fix "object has no attribute '__getattr__'"

* fix(python) Fix missing amici.py in amici wheel.

* doc(python)

* fix(ci) Enable coverage test with python module

* fix(ci) Enable coverage test with python module

* fix(ci) Enable coverage test with python module

* Cleanup

* Cleanup

* Fix Swig Warning 503

'Can't wrap 'operator ==' unless renamed to a valid identifier.'

* Remove amici-base extension from setup.py

* Fix: import * only allowed at module level

* fix(python) ensure module files are always updated and old files are deleted

* Fix reaction.getFast instead reaction.isSetFast which checks if attribute is set, not if it is true

* fix(python) Fix paths and template substitution

* feature(python) Allow user-specification of observables. Turn AssignmentRules into observables. Add extended steadystate model as python sbml example

* feature(python) Allow user-specification of observables. Turn AssignmentRules into observables. Add extended steadystate model as python sbml example

* feature(python) Turn ReturnData into NDArrays by default. Nicer simulation interface. Adapt test code.

* feature(python.sbml-import) Allow specification of fixed parameters

* feature(python,matlab) Enable mex compilation and creation of matlab wrapper for python generated models. This allows using matlab-amici without having Symbolic toolbox installed.

* refactor(python) Increase readability

* feature(python.sbml) Allow specifying sigma y values or parameters

* fix(python) Fix default arguments (must be iterable). Doc.

* doc(matlab) Function documentation generateMatlabWrapper

* feature(*) Let cmake fetch version number from git. Set PEP440-compatible version number on amici module. Create version header.

* refactor(cmake) cleanup cmake in improve exports

* refactor(cmake) cleanup cmake in improve exports

* refactor(cmake) cleanup cmake in improve exports. build testing models and tests in one single project for automated depedency checking and recompulation. export generated model targets.

* tests(python) Fix path to compiled models

* tests(core) Fix paths test for valgrind

* comments(python) Remove TODOs

* documentation update

* fix(documentation) updated readme.md to better reflect current state of the toolbox
  • Loading branch information
Fabian Fröhlich authored May 22, 2018
1 parent 35098fa commit 902b27b
Show file tree
Hide file tree
Showing 930 changed files with 4,513 additions and 986 deletions.
24 changes: 21 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,13 @@ tests/sbml-test-suite/

tests/sedml-test-suite/

mtoc/config/latexextras.sty-e
matlab/mtoc/config/latexextras.sty-e

mtoc/config/latexextras.sty
matlab/mtoc/config/latexextras.sty

mtoc/config/Doxyfile-e
matlab/mtoc/config/Doxyfile-e

.directory

.project

Expand All @@ -167,3 +169,19 @@ __pycache__

tests/cpputest/writeResults.h5
tests/cpputest/writeResults.h5.bak

tests/sbml-semantic-test-cases/*

python/.idea/misc.xml

python/.idea/modules.xml

python/.idea/python.iml

python/.idea/workspace.xml

*.pyc

python/testSpeedy.py

python/test.txt
14 changes: 12 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ matrix:
- doxygen
- doxygen-latex
- cppcheck
- swig3.0
- libboost-serialization-dev
env: ENABLE_GCOV_COVERAGE=TRUE
before_install:
Expand All @@ -35,21 +36,30 @@ matrix:
before_install:
- brew update # without this homebrew can stumble over wrong ruby version
- (brew install gcc || brew link --overwrite gcc) # fix linker warning regarding /usr/local/include/c++
- brew install hdf5 cppcheck
- brew install hdf5 cppcheck swig
- brew upgrade python

install:
# Python distutils only looks for `swig` and does not find `swig3.0`
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mkdir -p ~/bin/ && ln -s /usr/bin/swig3.0 ~/bin/swig && export PATH=~/bin/:$PATH; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then pyenv versions; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then pyenv shell 2.7 3.6; fi
- pip3 install --user --upgrade pip setuptools wheel pkgconfig
- ./scripts/buildSuiteSparse.sh
- ./scripts/buildSundials.sh
- ./scripts/buildCpputest.sh
- ./scripts/buildAmici.sh
- ./scripts/buildTests.sh

script:
- ./scripts/run-cpputest.sh
- ./scripts/run-cppcheck.sh
- ./scripts/run-python_unittest.sh
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./scripts/run-valgrind.sh; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./scripts/run-doxygen.sh; fi

after_failure:
- ls -alR

notifications:
webhooks:
urls:
Expand Down
8 changes: 0 additions & 8 deletions @amimodel/compileC.m

This file was deleted.

Loading

0 comments on commit 902b27b

Please sign in to comment.