Skip to content

Commit

Permalink
fix(python) Fix python model compilation, add to ci, improve hdf5 sea…
Browse files Browse the repository at this point in the history
…rch, python ci in venv (#337)

* fix(python) Rename dsigmaydp -> dsigma_ydp also in extern declaration

* ci(python) Include python-sbml import and simulation in CI (Closes #338)

* fix(*) Replace sigma_* by sigma* in all C++ code to have more uniform naming in python- and matlab-generated code

* Add missing newly created model files

* Fix typo

* ci(python) Set exit status according to test outcome (Fixes #339)

* ci(python) Disable building python package with cmake-generated libraries until they are repaired to work with current setup.py. Use plain setuptools package.

* ci(python) Don't run tests/testSBML.py twice. Is already run as part of scripts/run-codecov.sh -> tests/testCoverage.py

* debug(python) Print info if hdf5 was found

* feature(python) Check for HDF5 in standard location if pkgconfig is unsuccesful

* Fix variable name

* added standard osx include and library dir hints

* Fix hdf5 library path

* Adapt hdf5 library path, be verbose

* ci(): List hdf5 files

* ci() Maybe we can find the static hdf5 library

* ci() List brew hdf5 files

* Adapt hdf5 library path

* c() Add travis macOS hdf5 directories, remove debug output

* fix(cmake) Don't use PYTHON_INCLUDE_PATH which was already deprecated in cmake 3.0.2 or earlier

* cmake() VERSION_GREATER_EQUAL only introduced in cmake 3.7, making this check mostly useless

* cmake() VERSION_GREATER_EQUAL only introduced in cmake 3.7, making this check mostly useless

* Recreate example model code

* Revert mingw ::hypot hypot _hypot fix, since ncluding STL headers before Python.h is discouraged

This is an open python issue and should be fixed there (python/cpython#880). Windows workarounds exist.

* ci(python) Install amici package to virtual environment and run tests there (Closes #342)

* cmake() Add target for python source distribution

* ci() install h5py

* Revert "ci() install h5py"

This reverts commit ea79054.

* Install h5py in venv

* Squashed commit of the following:

commit 985646a
Author: Daniel Weindl <[email protected]>
Date:   Tue Jul 3 13:52:18 2018 +0200

    ci(python) no --user in venv; install wheel

commit f991ce6
Author: Daniel Weindl <[email protected]>
Date:   Tue Jul 3 13:51:35 2018 +0200

    ci(python) no --user in venv; install wheel

commit 62f828b
Author: Daniel Weindl <[email protected]>
Date:   Tue Jul 3 13:30:57 2018 +0200

    ci(python) install pkgconfig

commit b3d37c9
Author: Daniel Weindl <[email protected]>
Date:   Tue Jul 3 13:21:41 2018 +0200

    ci (python) correct package name

commit 039ebb0
Author: Daniel Weindl <[email protected]>
Date:   Tue Jul 3 13:11:55 2018 +0200

    ci (python) venv activate

commit 49d5412
Author: Daniel Weindl <[email protected]>
Date:   Tue Jul 3 13:05:03 2018 +0200

    ci (python) venv activate

commit d1f5824
Author: Daniel Weindl <[email protected]>
Date:   Tue Jul 3 12:57:45 2018 +0200

    ci (python) venv activate

commit 1446015
Author: Daniel Weindl <[email protected]>
Date:   Tue Jul 3 12:49:14 2018 +0200

    ci (python) h5py

commit b88701d
Author: Daniel Weindl <[email protected]>
Date:   Tue Jul 3 12:42:56 2018 +0200

    ci(python) install sdist

commit 220323b
Author: Daniel Weindl <[email protected]>
Date:   Tue Jul 3 12:15:40 2018 +0200

    ci(python) install --user

commit 190a270
Merge: 7adcc83 2e2e445
Author: Fabian Fröhlich <[email protected]>
Date:   Tue Jul 3 10:02:21 2018 +0200

    Merge branch 'master' into feature_venv

* ci(python) python 3.6 venv to find proper symengine wheel on osx?

* ci(python) install python3.6

* ci(python) install python3.6
  • Loading branch information
dweindl authored Jul 3, 2018
1 parent 2e2e445 commit f1e8756
Show file tree
Hide file tree
Showing 62 changed files with 315 additions and 968 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ matrix:
- brew update # without this homebrew can stumble over wrong ruby version
- travis_wait brew install gcc || brew link --overwrite gcc # fix linker warning regarding /usr/local/include/c++
- brew install hdf5 cppcheck swig doxygen ragel graphviz homebrew/cask/mactex
- brew upgrade python
- brew install zoidbergwill/python/python36
after_success:
- cd $BASE_DIR # cd to base dir for correct relative pah in deploy
deploy:
Expand All @@ -65,9 +65,9 @@ install:
- ./scripts/buildAmici.sh

script:
- cd $BASE_DIR/python/sdist
- python3 setup.py sdist --dist-dir=$BASE_DIR/build/python/
- python3 -m pip install $BASE_DIR/build/python/amici-*.tar.gz --verbose
# - cd $BASE_DIR/python/sdist
# - python3 setup.py sdist --dist-dir=$BASE_DIR/build/python/
# - python3 -m pip install $BASE_DIR/build/python/amici-*.tar.gz --verbose
- cd $BASE_DIR
- ./scripts/run-cpputest.sh
- ./scripts/run-cppcheck.sh
Expand Down
16 changes: 8 additions & 8 deletions include/amici/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,14 @@ namespace amici {
void fdeltaqB(const int ie, const realtype t, const AmiVector *x, const AmiVector *xB,
const AmiVector *xdot, const AmiVector *xdot_old);

void fsigma_y(const int it, const ExpData *edata, ReturnData *rdata);
void fsigmay(const int it, const ExpData *edata, ReturnData *rdata);

void fdsigma_ydp(const int it, ReturnData *rdata, const ExpData *edata);
void fdsigmaydp(const int it, ReturnData *rdata, const ExpData *edata);

void fsigma_z(const realtype t, const int ie, const int *nroots,
void fsigmaz(const realtype t, const int ie, const int *nroots,
const ExpData *edata, ReturnData *rdata);

void fdsigma_zdp(const realtype t);
void fdsigmazdp(const realtype t);

void fJy(const int it, ReturnData *rdata, const ExpData *edata);

Expand Down Expand Up @@ -836,7 +836,7 @@ namespace amici {
* @param p parameter vector
* @param k constant vector
**/
virtual void fsigma_y(realtype *sigmay, const realtype t, const realtype *p, const realtype *k) {
virtual void fsigmay(realtype *sigmay, const realtype t, const realtype *p, const realtype *k) {
throw AmiException("Requested functionality is not supported as (%s) is not implemented for this model!",__func__);
}

Expand All @@ -847,7 +847,7 @@ namespace amici {
* @param k constant vector
* @param ip sensitivity index
**/
virtual void fdsigma_ydp(realtype *dsigmaydp, const realtype t, const realtype *p, const realtype *k, const int ip) {
virtual void fdsigmaydp(realtype *dsigmaydp, const realtype t, const realtype *p, const realtype *k, const int ip) {
throw AmiException("Requested functionality is not supported as (%s) is not implemented for this model!",__func__);
}

Expand All @@ -857,7 +857,7 @@ namespace amici {
* @param p parameter vector
* @param k constant vector
**/
virtual void fsigma_z(realtype *sigmaz, const realtype t, const realtype *p, const realtype *k) {
virtual void fsigmaz(realtype *sigmaz, const realtype t, const realtype *p, const realtype *k) {
throw AmiException("Requested functionality is not supported as (%s) is not implemented for this model!",__func__);
}

Expand All @@ -868,7 +868,7 @@ namespace amici {
* @param k constant vector
* @param ip sensitivity index
**/
virtual void fdsigma_zdp(realtype *dsigmazdp, const realtype t, const realtype *p, const realtype *k, const int ip) {
virtual void fdsigmazdp(realtype *dsigmazdp, const realtype t, const realtype *p, const realtype *k, const int ip) {
throw AmiException("Requested functionality is not supported as (%s) is not implemented for this model!",__func__);
}

Expand Down
7 changes: 4 additions & 3 deletions matlab/@amimodel/compileAndLinkModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function compileAndLinkModel(modelname, modelSourceFolder, coptim, debug, funs,

%% Model-specific files
for j=1:length(funs)
baseFileName = [modelname '_' funs{j}];
baseFileName = [modelname '_' strrep(funs{j}, 'sigma_', 'sigma')];
cfun(1).(funs{j}) = sourceNeedsRecompilation(modelSourceFolder, modelObjectFolder, baseFileName, objectFileSuffix);
end

Expand Down Expand Up @@ -114,6 +114,7 @@ function compileAndLinkModel(modelname, modelSourceFolder, coptim, debug, funs,
end
end
funsForRecompile = funs(structfun(@(x) logical(x), cfun(1)));
funsForRecompile = cellfun(@(x) strrep(x, 'sigma_', 'sigma'), funsForRecompile, 'UniformOutput', false);
end

if(numel(funsForRecompile))
Expand All @@ -131,15 +132,15 @@ function compileAndLinkModel(modelname, modelSourceFolder, coptim, debug, funs,

% append model object files
for j=1:length(funs)
filename = fullfile(modelObjectFolder, [modelname '_' funs{j} objectFileSuffix]);
filename = fullfile(modelObjectFolder, [modelname '_' strrep(funs{j}, 'sigma_', 'sigma') objectFileSuffix]);
if(exist(filename,'file'))
objectsstr = strcat(objectsstr,...
' "',filename,'"');
end
end

% compile the wrapfunctions object
fprintf('wrapfunctions | ');
fprintf('wrapfunctions | ');
eval(['mex ' DEBUG COPT ...
' -c -outdir ' modelObjectFolder ' ' ...
fullfile(modelSourceFolder,'wrapfunctions.cpp') ' ' ...
Expand Down
19 changes: 12 additions & 7 deletions matlab/@amimodel/generateC.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function generateC(this)
% write fun ccode

for ifun = this.funs
cppFunctionName = strrep(ifun{1}, 'sigma_', 'sigma');
if(isfield(this.fun,ifun{1}))
bodyNotEmpty = any(this.fun.(ifun{1}).sym(:)~=0);
if(strcmp(ifun{1},'JSparse'))
Expand All @@ -28,7 +29,7 @@ function generateC(this)

if(bodyNotEmpty)
fprintf([ifun{1} ' | ']);
fid = fopen(fullfile(this.wrap_path,'models',this.modelname,[this.modelname '_' ifun{1} '.cpp']),'w');
fid = fopen(fullfile(this.wrap_path,'models',this.modelname,[this.modelname '_' cppFunctionName '.cpp']),'w');
fprintf(fid,'\n');
fprintf(fid,'#include "amici/symbolic_functions.h"\n');
fprintf(fid,'#include "amici/defines.h" //realtype definition\n');
Expand All @@ -44,7 +45,7 @@ function generateC(this)
fprintf(fid,'\n');

% function definition
fprintf(fid,['void ' ifun{1} '_' this.modelname '' this.fun.(ifun{1}).argstr ' {\n']);
fprintf(fid,['void ' cppFunctionName '_' this.modelname '' this.fun.(ifun{1}).argstr ' {\n']);
if(strcmp(ifun{1},'JSparse'))
for i = 1:length(this.rowvals)
fprintf(fid,[' JSparse->indexvals[' num2str(i-1) '] = ' num2str(this.rowvals(i)) ';\n']);
Expand Down Expand Up @@ -132,7 +133,8 @@ function generateC(this)
% access argstr
end
if(checkIfFunctionBodyIsNonEmpty(this,ifun{1}))
fprintf(fid,['extern void ' ifun{1} '_' this.modelname this.fun.(ifun{1}).argstr ';\n']);
cppFunctionName = strrep(ifun{1}, 'sigma_', 'sigma');
fprintf(fid,['extern void ' cppFunctionName '_' this.modelname this.fun.(ifun{1}).argstr ';\n']);
end
end

Expand Down Expand Up @@ -180,9 +182,10 @@ function generateC(this)
fprintf(fid,[' const char* getAmiciVersion() const { return "' getCommitHash(fileparts(fileparts(mfilename('fullpath')))) '"; };\n\n']);

for ifun = this.funs
fprintf(fid,[' virtual void f' ifun{1} this.fun.(ifun{1}).argstr ' override {\n']);
cppFunctionName = strrep(ifun{1}, 'sigma_', 'sigma');
fprintf(fid,[' virtual void f' cppFunctionName this.fun.(ifun{1}).argstr ' override {\n']);
if(checkIfFunctionBodyIsNonEmpty(this,ifun{1}))
fprintf(fid,[' ' ifun{1} '_' this.modelname '' removeTypes(this.fun.(ifun{1}).argstr) ';\n']);
fprintf(fid,[' ' cppFunctionName '_' this.modelname '' removeTypes(this.fun.(ifun{1}).argstr) ';\n']);
end
fprintf(fid,' }\n\n');
end
Expand Down Expand Up @@ -241,7 +244,8 @@ function generateCMakeFile(this)
for j=1:length(this.funs)
funcName = this.funs{j};
if(checkIfFunctionBodyIsNonEmpty(this,funcName))
sourceStr = [ sourceStr, sprintf('${MODEL_DIR}/%s_%s.cpp\n', this.modelname, funcName) ];
cppFunctionName = strrep(funcName, 'sigma_', 'sigma');
sourceStr = [ sourceStr, sprintf('${MODEL_DIR}/%s_%s.cpp\n', this.modelname, cppFunctionName) ];
end
end

Expand Down Expand Up @@ -287,5 +291,6 @@ function generateMainC(this)
function nonempty = checkIfFunctionBodyIsNonEmpty(this,ifun)
% if we don't have symbolic variables, it might have been generated before and symbolic expressions were simply not
% regenerated. any() for empty (no generated) variables is always false.
nonempty = or(exist(fullfile(this.wrap_path,'models',this.modelname,[this.modelname '_' ifun '.cpp']),'file'),any(this.fun.(ifun).sym(:)~=0));
cppFunctionName = strrep(ifun, 'sigma_', 'sigma');
nonempty = or(exist(fullfile(this.wrap_path,'models',this.modelname,[this.modelname '_' cppFunctionName '.cpp']),'file'),any(this.fun.(ifun).sym(:)~=0));
end
4 changes: 2 additions & 2 deletions models/model_dirac/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ${MODEL_DIR}/model_dirac_dxdotdp.cpp
${MODEL_DIR}/model_dirac_dydx.cpp
${MODEL_DIR}/model_dirac_qBdot.cpp
${MODEL_DIR}/model_dirac_root.cpp
${MODEL_DIR}/model_dirac_sigma_y.cpp
${MODEL_DIR}/model_dirac_sigmay.cpp
${MODEL_DIR}/model_dirac_stau.cpp
${MODEL_DIR}/model_dirac_sxdot.cpp
${MODEL_DIR}/model_dirac_xBdot.cpp
Expand Down Expand Up @@ -69,7 +69,7 @@ endif()
## SWIG
option(ENABLE_SWIG "Build swig/python library?" ON)
if(ENABLE_SWIG)
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.8)
if(NOT(${CMAKE_VERSION} VERSION_LESS 3.8))
add_subdirectory(swig)
else()
message(WARNING "Unable to build SWIG interface, upgrade CMake to >=3.8.")
Expand Down
16 changes: 8 additions & 8 deletions models/model_dirac/model_dirac.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef _amici_model_dirac_h
#define _amici_model_dirac_h
/* Generated by amiwrap (R2017b) 32ff5874402bf4335dcd258191c251105e377de4 */
/* Generated by amiwrap (R2017b) 413f6c54d956e878a95406f02808fafd1272c1cd */
#include <cmath>
#include <memory>
#include "amici/defines.h"
Expand Down Expand Up @@ -29,7 +29,7 @@ extern void dxdotdp_model_dirac(realtype *dxdotdp, const realtype t, const realt
extern void dydx_model_dirac(double *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h);
extern void qBdot_model_dirac(realtype *qBdot, const int ip, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *xB, const realtype *w, const realtype *dwdp);
extern void root_model_dirac(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h);
extern void sigma_y_model_dirac(double *sigmay, const realtype t, const realtype *p, const realtype *k);
extern void sigmay_model_dirac(double *sigmay, const realtype t, const realtype *p, const realtype *k);
extern void stau_model_dirac(double *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip, const int ie);
extern void sxdot_model_dirac(realtype *sxdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *sx, const realtype *w, const realtype *dwdx, const realtype *J, const realtype *dxdotdp);
extern void xBdot_model_dirac(realtype *xBdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *xB, const realtype *w, const realtype *dwdx);
Expand Down Expand Up @@ -62,7 +62,7 @@ class Model_model_dirac : public amici::Model_ODE {

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

const char* getAmiciVersion() const { return "32ff5874402bf4335dcd258191c251105e377de4"; };
const char* getAmiciVersion() const { return "413f6c54d956e878a95406f02808fafd1272c1cd"; };

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 {
J_model_dirac(J, t, x, p, k, h, w, dwdx);
Expand Down Expand Up @@ -142,10 +142,10 @@ class Model_model_dirac : public amici::Model_ODE {
virtual void fdrzdx(double *drzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override {
}

virtual void fdsigma_ydp(double *dsigmaydp, const realtype t, const realtype *p, const realtype *k, const int ip) override {
virtual void fdsigmaydp(double *dsigmaydp, const realtype t, const realtype *p, const realtype *k, const int ip) override {
}

virtual void fdsigma_zdp(double *dsigmazdp, const realtype t, const realtype *p, const realtype *k, const int ip) override {
virtual void fdsigmazdp(double *dsigmazdp, const realtype t, const realtype *p, const realtype *k, const int ip) override {
}

virtual void fdwdp(realtype *dwdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override {
Expand Down Expand Up @@ -182,11 +182,11 @@ class Model_model_dirac : public amici::Model_ODE {
virtual void frz(double *rz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override {
}

virtual void fsigma_y(double *sigmay, const realtype t, const realtype *p, const realtype *k) override {
sigma_y_model_dirac(sigmay, t, p, k);
virtual void fsigmay(double *sigmay, const realtype t, const realtype *p, const realtype *k) override {
sigmay_model_dirac(sigmay, t, p, k);
}

virtual void fsigma_z(double *sigmaz, const realtype t, const realtype *p, const realtype *k) override {
virtual void fsigmaz(double *sigmaz, const realtype t, const realtype *p, const realtype *k) override {
}

virtual void fsrz(double *srz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip) override {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ typedef amici::realtype realtype;

using namespace amici;

void sigma_y_model_events(double *sigmay, const realtype t, const realtype *p, const realtype *k) {
void sigmay_model_dirac(double *sigmay, const realtype t, const realtype *p, const realtype *k) {
sigmay[0] = 1.0;
}

2 changes: 1 addition & 1 deletion models/model_dirac/swig/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ find_package(SWIG REQUIRED)
include(${SWIG_USE_FILE})

FIND_PACKAGE(PythonLibs REQUIRED)
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
include_directories(${PYTHON_INCLUDE_DIRS})

SET(CMAKE_SWIG_FLAGS "")
SET_SOURCE_FILES_PROPERTIES(${PROJECT_NAME}.i PROPERTIES CPLUSPLUS ON)
Expand Down
6 changes: 3 additions & 3 deletions models/model_events/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ ${MODEL_DIR}/model_events_dzdx.cpp
${MODEL_DIR}/model_events_qBdot.cpp
${MODEL_DIR}/model_events_root.cpp
${MODEL_DIR}/model_events_rz.cpp
${MODEL_DIR}/model_events_sigma_y.cpp
${MODEL_DIR}/model_events_sigma_z.cpp
${MODEL_DIR}/model_events_sigmay.cpp
${MODEL_DIR}/model_events_sigmaz.cpp
${MODEL_DIR}/model_events_srz.cpp
${MODEL_DIR}/model_events_stau.cpp
${MODEL_DIR}/model_events_sxdot.cpp
Expand Down Expand Up @@ -83,7 +83,7 @@ endif()
## SWIG
option(ENABLE_SWIG "Build swig/python library?" ON)
if(ENABLE_SWIG)
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.8)
if(NOT(${CMAKE_VERSION} VERSION_LESS 3.8))
add_subdirectory(swig)
else()
message(WARNING "Unable to build SWIG interface, upgrade CMake to >=3.8.")
Expand Down
20 changes: 10 additions & 10 deletions models/model_events/model_events.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef _amici_model_events_h
#define _amici_model_events_h
/* Generated by amiwrap (R2017b) 32ff5874402bf4335dcd258191c251105e377de4 */
/* Generated by amiwrap (R2017b) 413f6c54d956e878a95406f02808fafd1272c1cd */
#include <cmath>
#include <memory>
#include "amici/defines.h"
Expand Down Expand Up @@ -38,8 +38,8 @@ extern void dzdx_model_events(double *dzdx, const int ie, const realtype t, cons
extern void qBdot_model_events(realtype *qBdot, const int ip, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *xB, const realtype *w, const realtype *dwdp);
extern void root_model_events(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h);
extern void rz_model_events(double *rz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h);
extern void sigma_y_model_events(double *sigmay, const realtype t, const realtype *p, const realtype *k);
extern void sigma_z_model_events(double *sigmaz, const realtype t, const realtype *p, const realtype *k);
extern void sigmay_model_events(double *sigmay, const realtype t, const realtype *p, const realtype *k);
extern void sigmaz_model_events(double *sigmaz, const realtype t, const realtype *p, const realtype *k);
extern void srz_model_events(double *srz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip);
extern void stau_model_events(double *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip, const int ie);
extern void sxdot_model_events(realtype *sxdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *sx, const realtype *w, const realtype *dwdx, const realtype *J, const realtype *dxdotdp);
Expand Down Expand Up @@ -76,7 +76,7 @@ class Model_model_events : public amici::Model_ODE {

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

const char* getAmiciVersion() const { return "32ff5874402bf4335dcd258191c251105e377de4"; };
const char* getAmiciVersion() const { return "413f6c54d956e878a95406f02808fafd1272c1cd"; };

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 {
J_model_events(J, t, x, p, k, h, w, dwdx);
Expand Down Expand Up @@ -162,10 +162,10 @@ class Model_model_events : public amici::Model_ODE {
drzdx_model_events(drzdx, ie, t, x, p, k, h);
}

virtual void fdsigma_ydp(double *dsigmaydp, const realtype t, const realtype *p, const realtype *k, const int ip) override {
virtual void fdsigmaydp(double *dsigmaydp, const realtype t, const realtype *p, const realtype *k, const int ip) override {
}

virtual void fdsigma_zdp(double *dsigmazdp, const realtype t, const realtype *p, const realtype *k, const int ip) override {
virtual void fdsigmazdp(double *dsigmazdp, const realtype t, const realtype *p, const realtype *k, const int ip) override {
}

virtual void fdwdp(realtype *dwdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override {
Expand Down Expand Up @@ -205,12 +205,12 @@ class Model_model_events : public amici::Model_ODE {
rz_model_events(rz, ie, t, x, p, k, h);
}

virtual void fsigma_y(double *sigmay, const realtype t, const realtype *p, const realtype *k) override {
sigma_y_model_events(sigmay, t, p, k);
virtual void fsigmay(double *sigmay, const realtype t, const realtype *p, const realtype *k) override {
sigmay_model_events(sigmay, t, p, k);
}

virtual void fsigma_z(double *sigmaz, const realtype t, const realtype *p, const realtype *k) override {
sigma_z_model_events(sigmaz, t, p, k);
virtual void fsigmaz(double *sigmaz, const realtype t, const realtype *p, const realtype *k) override {
sigmaz_model_events(sigmaz, t, p, k);
}

virtual void fsrz(double *srz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip) override {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ typedef amici::realtype realtype;

using namespace amici;

void sigma_y_model_dirac(double *sigmay, const realtype t, const realtype *p, const realtype *k) {
void sigmay_model_events(double *sigmay, const realtype t, const realtype *p, const realtype *k) {
sigmay[0] = 1.0;
}

Loading

0 comments on commit f1e8756

Please sign in to comment.