diff --git a/models/model_calvetti/model_calvetti.h b/models/model_calvetti/model_calvetti.h index 4728837cab..54f600d783 100644 --- a/models/model_calvetti/model_calvetti.h +++ b/models/model_calvetti/model_calvetti.h @@ -1,6 +1,6 @@ #ifndef _amici_model_calvetti_h #define _amici_model_calvetti_h -/* Generated by amiwrap (R2017b) b04ab2326fb34f3721a15806d9783ff22b6a015a */ +/* Generated by amiwrap (R2017b) b61abb6cf09df7b484efe45bb8e378ac07d2b33b */ #include #include #include "amici/defines.h" @@ -70,7 +70,7 @@ class Model_model_calvetti : public amici::Model_DAE { amici::Model* clone() const override { return new Model_model_calvetti(*this); }; - std::string getAmiciCommit() const override { return "b04ab2326fb34f3721a15806d9783ff22b6a015a"; }; + std::string getAmiciCommit() const override { return "b61abb6cf09df7b484efe45bb8e378ac07d2b33b"; }; void fJSparse(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype cj, const realtype *dx, const realtype *w, const realtype *dwdx) override { JSparse_model_calvetti(JSparse, t, x, p, k, h, cj, dx, w, dwdx); diff --git a/models/model_calvetti/swig/CMakeLists.txt b/models/model_calvetti/swig/CMakeLists.txt index 6642236fda..0c4136b816 100644 --- a/models/model_calvetti/swig/CMakeLists.txt +++ b/models/model_calvetti/swig/CMakeLists.txt @@ -23,6 +23,8 @@ if(${CMAKE_VERSION} VERSION_LESS "3.12.0") include_directories(${PYTHON_INCLUDE_DIRS}) set(Python3_LIBRARIES ${PYTHON_LIBRARIES}) else() + # We don't need "Interpreter" here, but without that, FindPython3 will + # ignore the Python version selected via $Python3_EXECUTABLE find_package(Python3 COMPONENTS Interpreter Development) include_directories(${Python3_INCLUDE_DIRS}) endif() diff --git a/models/model_calvetti/swig/model_calvetti.i b/models/model_calvetti/swig/model_calvetti.i index 29a288c129..a904745877 100644 --- a/models/model_calvetti/swig/model_calvetti.i +++ b/models/model_calvetti/swig/model_calvetti.i @@ -10,5 +10,13 @@ using namespace amici; %} +// Make model module accessible from the model +%feature("pythonappend") amici::generic_model::getModel %{ + if '.' in __name__: + import sys + val.module = sys.modules['.'.join(__name__.split('.')[:-1])] +%} + + // Process symbols in header %include "wrapfunctions.h" diff --git a/models/model_dirac/model_dirac.h b/models/model_dirac/model_dirac.h index 18260ba5cc..0a83886f43 100644 --- a/models/model_dirac/model_dirac.h +++ b/models/model_dirac/model_dirac.h @@ -1,6 +1,6 @@ #ifndef _amici_model_dirac_h #define _amici_model_dirac_h -/* Generated by amiwrap (R2017b) b04ab2326fb34f3721a15806d9783ff22b6a015a */ +/* Generated by amiwrap (R2017b) b61abb6cf09df7b484efe45bb8e378ac07d2b33b */ #include #include #include "amici/defines.h" @@ -70,7 +70,7 @@ class Model_model_dirac : public amici::Model_ODE { amici::Model* clone() const override { return new Model_model_dirac(*this); }; - std::string getAmiciCommit() const override { return "b04ab2326fb34f3721a15806d9783ff22b6a015a"; }; + std::string getAmiciCommit() const override { return "b61abb6cf09df7b484efe45bb8e378ac07d2b33b"; }; void fJSparse(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override { JSparse_model_dirac(JSparse, t, x, p, k, h, w, dwdx); diff --git a/models/model_dirac/swig/CMakeLists.txt b/models/model_dirac/swig/CMakeLists.txt index 6642236fda..0c4136b816 100644 --- a/models/model_dirac/swig/CMakeLists.txt +++ b/models/model_dirac/swig/CMakeLists.txt @@ -23,6 +23,8 @@ if(${CMAKE_VERSION} VERSION_LESS "3.12.0") include_directories(${PYTHON_INCLUDE_DIRS}) set(Python3_LIBRARIES ${PYTHON_LIBRARIES}) else() + # We don't need "Interpreter" here, but without that, FindPython3 will + # ignore the Python version selected via $Python3_EXECUTABLE find_package(Python3 COMPONENTS Interpreter Development) include_directories(${Python3_INCLUDE_DIRS}) endif() diff --git a/models/model_dirac/swig/model_dirac.i b/models/model_dirac/swig/model_dirac.i index 908c43b490..928a883496 100644 --- a/models/model_dirac/swig/model_dirac.i +++ b/models/model_dirac/swig/model_dirac.i @@ -10,5 +10,13 @@ using namespace amici; %} +// Make model module accessible from the model +%feature("pythonappend") amici::generic_model::getModel %{ + if '.' in __name__: + import sys + val.module = sys.modules['.'.join(__name__.split('.')[:-1])] +%} + + // Process symbols in header %include "wrapfunctions.h" diff --git a/models/model_events/model_events.h b/models/model_events/model_events.h index d8c4c12ffb..c3b6bf3d32 100644 --- a/models/model_events/model_events.h +++ b/models/model_events/model_events.h @@ -1,6 +1,6 @@ #ifndef _amici_model_events_h #define _amici_model_events_h -/* Generated by amiwrap (R2017b) b04ab2326fb34f3721a15806d9783ff22b6a015a */ +/* Generated by amiwrap (R2017b) b61abb6cf09df7b484efe45bb8e378ac07d2b33b */ #include #include #include "amici/defines.h" @@ -84,7 +84,7 @@ class Model_model_events : public amici::Model_ODE { amici::Model* clone() const override { return new Model_model_events(*this); }; - std::string getAmiciCommit() const override { return "b04ab2326fb34f3721a15806d9783ff22b6a015a"; }; + std::string getAmiciCommit() const override { return "b61abb6cf09df7b484efe45bb8e378ac07d2b33b"; }; void fJSparse(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override { JSparse_model_events(JSparse, t, x, p, k, h, w, dwdx); diff --git a/models/model_events/swig/CMakeLists.txt b/models/model_events/swig/CMakeLists.txt index 6642236fda..0c4136b816 100644 --- a/models/model_events/swig/CMakeLists.txt +++ b/models/model_events/swig/CMakeLists.txt @@ -23,6 +23,8 @@ if(${CMAKE_VERSION} VERSION_LESS "3.12.0") include_directories(${PYTHON_INCLUDE_DIRS}) set(Python3_LIBRARIES ${PYTHON_LIBRARIES}) else() + # We don't need "Interpreter" here, but without that, FindPython3 will + # ignore the Python version selected via $Python3_EXECUTABLE find_package(Python3 COMPONENTS Interpreter Development) include_directories(${Python3_INCLUDE_DIRS}) endif() diff --git a/models/model_events/swig/model_events.i b/models/model_events/swig/model_events.i index e62e99d55f..e4a556aa15 100644 --- a/models/model_events/swig/model_events.i +++ b/models/model_events/swig/model_events.i @@ -10,5 +10,13 @@ using namespace amici; %} +// Make model module accessible from the model +%feature("pythonappend") amici::generic_model::getModel %{ + if '.' in __name__: + import sys + val.module = sys.modules['.'.join(__name__.split('.')[:-1])] +%} + + // Process symbols in header %include "wrapfunctions.h" diff --git a/models/model_jakstat_adjoint/model_jakstat_adjoint.h b/models/model_jakstat_adjoint/model_jakstat_adjoint.h index 38b8b9e2e1..e4f9224531 100644 --- a/models/model_jakstat_adjoint/model_jakstat_adjoint.h +++ b/models/model_jakstat_adjoint/model_jakstat_adjoint.h @@ -1,6 +1,6 @@ #ifndef _amici_model_jakstat_adjoint_h #define _amici_model_jakstat_adjoint_h -/* Generated by amiwrap (R2017b) b04ab2326fb34f3721a15806d9783ff22b6a015a */ +/* Generated by amiwrap (R2017b) b61abb6cf09df7b484efe45bb8e378ac07d2b33b */ #include #include #include "amici/defines.h" @@ -73,7 +73,7 @@ class Model_model_jakstat_adjoint : public amici::Model_ODE { amici::Model* clone() const override { return new Model_model_jakstat_adjoint(*this); }; - std::string getAmiciCommit() const override { return "b04ab2326fb34f3721a15806d9783ff22b6a015a"; }; + std::string getAmiciCommit() const override { return "b61abb6cf09df7b484efe45bb8e378ac07d2b33b"; }; void fJSparse(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override { JSparse_model_jakstat_adjoint(JSparse, t, x, p, k, h, w, dwdx); diff --git a/models/model_jakstat_adjoint/swig/CMakeLists.txt b/models/model_jakstat_adjoint/swig/CMakeLists.txt index 6642236fda..0c4136b816 100644 --- a/models/model_jakstat_adjoint/swig/CMakeLists.txt +++ b/models/model_jakstat_adjoint/swig/CMakeLists.txt @@ -23,6 +23,8 @@ if(${CMAKE_VERSION} VERSION_LESS "3.12.0") include_directories(${PYTHON_INCLUDE_DIRS}) set(Python3_LIBRARIES ${PYTHON_LIBRARIES}) else() + # We don't need "Interpreter" here, but without that, FindPython3 will + # ignore the Python version selected via $Python3_EXECUTABLE find_package(Python3 COMPONENTS Interpreter Development) include_directories(${Python3_INCLUDE_DIRS}) endif() diff --git a/models/model_jakstat_adjoint/swig/model_jakstat_adjoint.i b/models/model_jakstat_adjoint/swig/model_jakstat_adjoint.i index 3f0f1374fe..a986a6a5d2 100644 --- a/models/model_jakstat_adjoint/swig/model_jakstat_adjoint.i +++ b/models/model_jakstat_adjoint/swig/model_jakstat_adjoint.i @@ -10,5 +10,13 @@ using namespace amici; %} +// Make model module accessible from the model +%feature("pythonappend") amici::generic_model::getModel %{ + if '.' in __name__: + import sys + val.module = sys.modules['.'.join(__name__.split('.')[:-1])] +%} + + // Process symbols in header %include "wrapfunctions.h" diff --git a/models/model_jakstat_adjoint_o2/model_jakstat_adjoint_o2.h b/models/model_jakstat_adjoint_o2/model_jakstat_adjoint_o2.h index 642afbb3ba..a54f8329f6 100644 --- a/models/model_jakstat_adjoint_o2/model_jakstat_adjoint_o2.h +++ b/models/model_jakstat_adjoint_o2/model_jakstat_adjoint_o2.h @@ -1,6 +1,6 @@ #ifndef _amici_model_jakstat_adjoint_o2_h #define _amici_model_jakstat_adjoint_o2_h -/* Generated by amiwrap (R2017b) b04ab2326fb34f3721a15806d9783ff22b6a015a */ +/* Generated by amiwrap (R2017b) b61abb6cf09df7b484efe45bb8e378ac07d2b33b */ #include #include #include "amici/defines.h" @@ -73,7 +73,7 @@ class Model_model_jakstat_adjoint_o2 : public amici::Model_ODE { amici::Model* clone() const override { return new Model_model_jakstat_adjoint_o2(*this); }; - std::string getAmiciCommit() const override { return "b04ab2326fb34f3721a15806d9783ff22b6a015a"; }; + std::string getAmiciCommit() const override { return "b61abb6cf09df7b484efe45bb8e378ac07d2b33b"; }; void fJSparse(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override { JSparse_model_jakstat_adjoint_o2(JSparse, t, x, p, k, h, w, dwdx); diff --git a/models/model_jakstat_adjoint_o2/swig/CMakeLists.txt b/models/model_jakstat_adjoint_o2/swig/CMakeLists.txt index 6642236fda..0c4136b816 100644 --- a/models/model_jakstat_adjoint_o2/swig/CMakeLists.txt +++ b/models/model_jakstat_adjoint_o2/swig/CMakeLists.txt @@ -23,6 +23,8 @@ if(${CMAKE_VERSION} VERSION_LESS "3.12.0") include_directories(${PYTHON_INCLUDE_DIRS}) set(Python3_LIBRARIES ${PYTHON_LIBRARIES}) else() + # We don't need "Interpreter" here, but without that, FindPython3 will + # ignore the Python version selected via $Python3_EXECUTABLE find_package(Python3 COMPONENTS Interpreter Development) include_directories(${Python3_INCLUDE_DIRS}) endif() diff --git a/models/model_jakstat_adjoint_o2/swig/model_jakstat_adjoint_o2.i b/models/model_jakstat_adjoint_o2/swig/model_jakstat_adjoint_o2.i index 97b5161c84..50591d090c 100644 --- a/models/model_jakstat_adjoint_o2/swig/model_jakstat_adjoint_o2.i +++ b/models/model_jakstat_adjoint_o2/swig/model_jakstat_adjoint_o2.i @@ -10,5 +10,13 @@ using namespace amici; %} +// Make model module accessible from the model +%feature("pythonappend") amici::generic_model::getModel %{ + if '.' in __name__: + import sys + val.module = sys.modules['.'.join(__name__.split('.')[:-1])] +%} + + // Process symbols in header %include "wrapfunctions.h" diff --git a/models/model_nested_events/model_nested_events.h b/models/model_nested_events/model_nested_events.h index 0c8e55c7c9..432efdb678 100644 --- a/models/model_nested_events/model_nested_events.h +++ b/models/model_nested_events/model_nested_events.h @@ -1,6 +1,6 @@ #ifndef _amici_model_nested_events_h #define _amici_model_nested_events_h -/* Generated by amiwrap (R2017b) b04ab2326fb34f3721a15806d9783ff22b6a015a */ +/* Generated by amiwrap (R2017b) b61abb6cf09df7b484efe45bb8e378ac07d2b33b */ #include #include #include "amici/defines.h" @@ -73,7 +73,7 @@ class Model_model_nested_events : public amici::Model_ODE { amici::Model* clone() const override { return new Model_model_nested_events(*this); }; - std::string getAmiciCommit() const override { return "b04ab2326fb34f3721a15806d9783ff22b6a015a"; }; + std::string getAmiciCommit() const override { return "b61abb6cf09df7b484efe45bb8e378ac07d2b33b"; }; void fJSparse(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override { JSparse_model_nested_events(JSparse, t, x, p, k, h, w, dwdx); diff --git a/models/model_nested_events/swig/CMakeLists.txt b/models/model_nested_events/swig/CMakeLists.txt index 6642236fda..0c4136b816 100644 --- a/models/model_nested_events/swig/CMakeLists.txt +++ b/models/model_nested_events/swig/CMakeLists.txt @@ -23,6 +23,8 @@ if(${CMAKE_VERSION} VERSION_LESS "3.12.0") include_directories(${PYTHON_INCLUDE_DIRS}) set(Python3_LIBRARIES ${PYTHON_LIBRARIES}) else() + # We don't need "Interpreter" here, but without that, FindPython3 will + # ignore the Python version selected via $Python3_EXECUTABLE find_package(Python3 COMPONENTS Interpreter Development) include_directories(${Python3_INCLUDE_DIRS}) endif() diff --git a/models/model_nested_events/swig/model_nested_events.i b/models/model_nested_events/swig/model_nested_events.i index 3c12b36d5f..bec3ccac55 100644 --- a/models/model_nested_events/swig/model_nested_events.i +++ b/models/model_nested_events/swig/model_nested_events.i @@ -10,5 +10,13 @@ using namespace amici; %} +// Make model module accessible from the model +%feature("pythonappend") amici::generic_model::getModel %{ + if '.' in __name__: + import sys + val.module = sys.modules['.'.join(__name__.split('.')[:-1])] +%} + + // Process symbols in header %include "wrapfunctions.h" diff --git a/models/model_neuron/model_neuron.h b/models/model_neuron/model_neuron.h index 0c54682f0d..323f42d94d 100644 --- a/models/model_neuron/model_neuron.h +++ b/models/model_neuron/model_neuron.h @@ -1,6 +1,6 @@ #ifndef _amici_model_neuron_h #define _amici_model_neuron_h -/* Generated by amiwrap (R2017b) b04ab2326fb34f3721a15806d9783ff22b6a015a */ +/* Generated by amiwrap (R2017b) b61abb6cf09df7b484efe45bb8e378ac07d2b33b */ #include #include #include "amici/defines.h" @@ -87,7 +87,7 @@ class Model_model_neuron : public amici::Model_ODE { amici::Model* clone() const override { return new Model_model_neuron(*this); }; - std::string getAmiciCommit() const override { return "b04ab2326fb34f3721a15806d9783ff22b6a015a"; }; + std::string getAmiciCommit() const override { return "b61abb6cf09df7b484efe45bb8e378ac07d2b33b"; }; void fJSparse(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override { JSparse_model_neuron(JSparse, t, x, p, k, h, w, dwdx); diff --git a/models/model_neuron/swig/CMakeLists.txt b/models/model_neuron/swig/CMakeLists.txt index 6642236fda..0c4136b816 100644 --- a/models/model_neuron/swig/CMakeLists.txt +++ b/models/model_neuron/swig/CMakeLists.txt @@ -23,6 +23,8 @@ if(${CMAKE_VERSION} VERSION_LESS "3.12.0") include_directories(${PYTHON_INCLUDE_DIRS}) set(Python3_LIBRARIES ${PYTHON_LIBRARIES}) else() + # We don't need "Interpreter" here, but without that, FindPython3 will + # ignore the Python version selected via $Python3_EXECUTABLE find_package(Python3 COMPONENTS Interpreter Development) include_directories(${Python3_INCLUDE_DIRS}) endif() diff --git a/models/model_neuron/swig/model_neuron.i b/models/model_neuron/swig/model_neuron.i index 4511c79a44..856ba04978 100644 --- a/models/model_neuron/swig/model_neuron.i +++ b/models/model_neuron/swig/model_neuron.i @@ -10,5 +10,13 @@ using namespace amici; %} +// Make model module accessible from the model +%feature("pythonappend") amici::generic_model::getModel %{ + if '.' in __name__: + import sys + val.module = sys.modules['.'.join(__name__.split('.')[:-1])] +%} + + // Process symbols in header %include "wrapfunctions.h" diff --git a/models/model_neuron_o2/model_neuron_o2.h b/models/model_neuron_o2/model_neuron_o2.h index bb8f565576..f6ce0186f4 100644 --- a/models/model_neuron_o2/model_neuron_o2.h +++ b/models/model_neuron_o2/model_neuron_o2.h @@ -1,6 +1,6 @@ #ifndef _amici_model_neuron_o2_h #define _amici_model_neuron_o2_h -/* Generated by amiwrap (R2017b) b04ab2326fb34f3721a15806d9783ff22b6a015a */ +/* Generated by amiwrap (R2017b) b61abb6cf09df7b484efe45bb8e378ac07d2b33b */ #include #include #include "amici/defines.h" @@ -89,7 +89,7 @@ class Model_model_neuron_o2 : public amici::Model_ODE { amici::Model* clone() const override { return new Model_model_neuron_o2(*this); }; - std::string getAmiciCommit() const override { return "b04ab2326fb34f3721a15806d9783ff22b6a015a"; }; + std::string getAmiciCommit() const override { return "b61abb6cf09df7b484efe45bb8e378ac07d2b33b"; }; void fJSparse(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override { JSparse_model_neuron_o2(JSparse, t, x, p, k, h, w, dwdx); diff --git a/models/model_neuron_o2/swig/CMakeLists.txt b/models/model_neuron_o2/swig/CMakeLists.txt index 6642236fda..0c4136b816 100644 --- a/models/model_neuron_o2/swig/CMakeLists.txt +++ b/models/model_neuron_o2/swig/CMakeLists.txt @@ -23,6 +23,8 @@ if(${CMAKE_VERSION} VERSION_LESS "3.12.0") include_directories(${PYTHON_INCLUDE_DIRS}) set(Python3_LIBRARIES ${PYTHON_LIBRARIES}) else() + # We don't need "Interpreter" here, but without that, FindPython3 will + # ignore the Python version selected via $Python3_EXECUTABLE find_package(Python3 COMPONENTS Interpreter Development) include_directories(${Python3_INCLUDE_DIRS}) endif() diff --git a/models/model_neuron_o2/swig/model_neuron_o2.i b/models/model_neuron_o2/swig/model_neuron_o2.i index 978b2ffb14..6c9c51ddb2 100644 --- a/models/model_neuron_o2/swig/model_neuron_o2.i +++ b/models/model_neuron_o2/swig/model_neuron_o2.i @@ -10,5 +10,13 @@ using namespace amici; %} +// Make model module accessible from the model +%feature("pythonappend") amici::generic_model::getModel %{ + if '.' in __name__: + import sys + val.module = sys.modules['.'.join(__name__.split('.')[:-1])] +%} + + // Process symbols in header %include "wrapfunctions.h" diff --git a/models/model_robertson/model_robertson.h b/models/model_robertson/model_robertson.h index 85ef3fb920..76544f7724 100644 --- a/models/model_robertson/model_robertson.h +++ b/models/model_robertson/model_robertson.h @@ -1,6 +1,6 @@ #ifndef _amici_model_robertson_h #define _amici_model_robertson_h -/* Generated by amiwrap (R2017b) b04ab2326fb34f3721a15806d9783ff22b6a015a */ +/* Generated by amiwrap (R2017b) b61abb6cf09df7b484efe45bb8e378ac07d2b33b */ #include #include #include "amici/defines.h" @@ -71,7 +71,7 @@ class Model_model_robertson : public amici::Model_DAE { amici::Model* clone() const override { return new Model_model_robertson(*this); }; - std::string getAmiciCommit() const override { return "b04ab2326fb34f3721a15806d9783ff22b6a015a"; }; + std::string getAmiciCommit() const override { return "b61abb6cf09df7b484efe45bb8e378ac07d2b33b"; }; void fJSparse(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype cj, const realtype *dx, const realtype *w, const realtype *dwdx) override { JSparse_model_robertson(JSparse, t, x, p, k, h, cj, dx, w, dwdx); diff --git a/models/model_robertson/swig/CMakeLists.txt b/models/model_robertson/swig/CMakeLists.txt index 6642236fda..0c4136b816 100644 --- a/models/model_robertson/swig/CMakeLists.txt +++ b/models/model_robertson/swig/CMakeLists.txt @@ -23,6 +23,8 @@ if(${CMAKE_VERSION} VERSION_LESS "3.12.0") include_directories(${PYTHON_INCLUDE_DIRS}) set(Python3_LIBRARIES ${PYTHON_LIBRARIES}) else() + # We don't need "Interpreter" here, but without that, FindPython3 will + # ignore the Python version selected via $Python3_EXECUTABLE find_package(Python3 COMPONENTS Interpreter Development) include_directories(${Python3_INCLUDE_DIRS}) endif() diff --git a/models/model_robertson/swig/model_robertson.i b/models/model_robertson/swig/model_robertson.i index 1027282a23..a6b8705783 100644 --- a/models/model_robertson/swig/model_robertson.i +++ b/models/model_robertson/swig/model_robertson.i @@ -10,5 +10,13 @@ using namespace amici; %} +// Make model module accessible from the model +%feature("pythonappend") amici::generic_model::getModel %{ + if '.' in __name__: + import sys + val.module = sys.modules['.'.join(__name__.split('.')[:-1])] +%} + + // Process symbols in header %include "wrapfunctions.h" diff --git a/models/model_steadystate/model_steadystate.h b/models/model_steadystate/model_steadystate.h index 6694fc6b36..db560228b2 100644 --- a/models/model_steadystate/model_steadystate.h +++ b/models/model_steadystate/model_steadystate.h @@ -1,6 +1,6 @@ #ifndef _amici_model_steadystate_h #define _amici_model_steadystate_h -/* Generated by amiwrap (R2017b) b04ab2326fb34f3721a15806d9783ff22b6a015a */ +/* Generated by amiwrap (R2017b) b61abb6cf09df7b484efe45bb8e378ac07d2b33b */ #include #include #include "amici/defines.h" @@ -70,7 +70,7 @@ class Model_model_steadystate : public amici::Model_ODE { amici::Model* clone() const override { return new Model_model_steadystate(*this); }; - std::string getAmiciCommit() const override { return "b04ab2326fb34f3721a15806d9783ff22b6a015a"; }; + std::string getAmiciCommit() const override { return "b61abb6cf09df7b484efe45bb8e378ac07d2b33b"; }; void fJSparse(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override { JSparse_model_steadystate(JSparse, t, x, p, k, h, w, dwdx); diff --git a/models/model_steadystate/swig/CMakeLists.txt b/models/model_steadystate/swig/CMakeLists.txt index 6642236fda..0c4136b816 100644 --- a/models/model_steadystate/swig/CMakeLists.txt +++ b/models/model_steadystate/swig/CMakeLists.txt @@ -23,6 +23,8 @@ if(${CMAKE_VERSION} VERSION_LESS "3.12.0") include_directories(${PYTHON_INCLUDE_DIRS}) set(Python3_LIBRARIES ${PYTHON_LIBRARIES}) else() + # We don't need "Interpreter" here, but without that, FindPython3 will + # ignore the Python version selected via $Python3_EXECUTABLE find_package(Python3 COMPONENTS Interpreter Development) include_directories(${Python3_INCLUDE_DIRS}) endif() diff --git a/models/model_steadystate/swig/model_steadystate.i b/models/model_steadystate/swig/model_steadystate.i index f8f6865dac..e96f7db31d 100644 --- a/models/model_steadystate/swig/model_steadystate.i +++ b/models/model_steadystate/swig/model_steadystate.i @@ -10,5 +10,13 @@ using namespace amici; %} +// Make model module accessible from the model +%feature("pythonappend") amici::generic_model::getModel %{ + if '.' in __name__: + import sys + val.module = sys.modules['.'.join(__name__.split('.')[:-1])] +%} + + // Process symbols in header %include "wrapfunctions.h" diff --git a/swig/modelname.template.i b/swig/modelname.template.i index 33804a1800..69015dc793 100644 --- a/swig/modelname.template.i +++ b/swig/modelname.template.i @@ -12,8 +12,9 @@ using namespace amici; // Make model module accessible from the model %feature("pythonappend") amici::generic_model::getModel %{ - import sys - val.module = sys.modules['.'.join(__name__.split('.')[:-1])] + if '.' in __name__: + import sys + val.module = sys.modules['.'.join(__name__.split('.')[:-1])] %}