diff --git a/CHANGELOG.md b/CHANGELOG.md index 268b055198..408034d3ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,76 @@ See also our [versioning policy](https://amici.readthedocs.io/en/latest/versioni ## v0.X Series +### v0.34.0 (2025-07-29) + +This will probably be the last release to include the MATLAB interface. + +**Fixes** + +* **Breaking changes** Events are now also handled during pre-equilibration, + presimulation, and post-equilibration. + This may be a breaking change, as it may lead to different results for models + with events that may trigger during these periods. This change is + considered a bugfix, as it was not intended to ignore events during these + periods. + + (by @dweindl in #2777, #2780, #2859, #2881, #2889, #2920, #2921, #2925) +* Fixed various issues related to adjoint sensitivity analysis for models with + events. + While many cases are now supported, it is still highly recommended to + check the ASA results for models with events against forward sensitivities + or finite differences. + * Adjoint sensitivities for Python-imported models with events + (by @paulstapor & @dweindl in https://github.com/AMICI-dev/AMICI/pull/1539) + * Fix Model::addAdjointQuadratureEventUpdate + (by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2787) + * Fix indexing errors for adjoint quadratures during event updates + (by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2796) + * Fix deltaxB dimensions (by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2803) + * Fix (some) ASA event handling (by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2797) +* Fixed a number of issues related to the handling of events or discontinuities + in general: + * Fixed import of DAE models with events (by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2897) + * Fixed root functions for events with initialValue=trigger=false (by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2910) + * Fixed check for sign change, fix Heaviside update (by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2927) +* Fixed sign of residuals (by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2896) +* Updated the steady state notebook to match the current implementation + (by @plakrisenko & @dweindl in https://github.com/AMICI-dev/AMICI/pull/2891) +* Improved sigma<=0 error reporting (by @FFroehlich in https://github.com/AMICI-dev/AMICI/pull/2829) +* Fixed sensitivities for the total abundances of conservation laws + (only relevant if `AMICI_EXPERIMENTAL_SBML_NONCONST_CLS` is enabled) + (by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2782) +* Fix sensitivities w.r.t. unused log-scaled NaN parameters (by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2903) + +**Features** + +* AMICI should now be pip-installable without pre-installing SWIG or BLAS + (by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2774, + https://github.com/AMICI-dev/AMICI/pull/2772) +* Event/discontinuity handling for JAX models + * Track discontinuities in JAX & fix gradient for models with parameter + dependent roots (by @FFroehlich in https://github.com/AMICI-dev/AMICI/pull/2815) + * Improve JAX event integration (by @FFroehlich in https://github.com/AMICI-dev/AMICI/pull/2841) + * mask event functions in jax (by @FFroehlich in https://github.com/AMICI-dev/AMICI/pull/2863) +* Handle state-independent, parameter-dependent event triggers without root-finding + (by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2913) +* Presimulation is now also supported in combination with adjoint sensitivities + (by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2786) +* It is now possible to set a separate $t_0$ for pre-equilibration and main + simulation (by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2793) +* Sensitivity analysis for `AlgebraicRule` / DAE models is now also supported + for Python-imported models + (by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2101) +* An optional random generator seed can now be passed to + `ExpData::ExpData(ReturnData const&, ...)` when generating synthetic + measurements (by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2802) +* Added `ReturnData::plist` (by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2874) + +... and extended tests, documentation, and many changes under the hood. + +**Full Changelog**: https://github.com/AMICI-dev/AMICI/compare/v0.33.0...v0.34.0 + + ### v0.33.0 (2025-06-11) Note that this release requires Python >= 3.11. diff --git a/models/model_calvetti_py/CMakeLists.txt b/models/model_calvetti_py/CMakeLists.txt index 0f97d655a2..86a65c5442 100644 --- a/models/model_calvetti_py/CMakeLists.txt +++ b/models/model_calvetti_py/CMakeLists.txt @@ -30,7 +30,7 @@ if(DEFINED ENV{AMICI_LDFLAGS}) link_libraries("$ENV{AMICI_LDFLAGS}") endif() -find_package(Amici 0.33.0 REQUIRED HINTS +find_package(Amici 0.34.0 REQUIRED HINTS ${CMAKE_CURRENT_LIST_DIR}/../../build) message(STATUS "Found AMICI ${Amici_DIR}") set_target_properties(Upstream::amici PROPERTIES diff --git a/models/model_calvetti_py/model_calvetti_py.cpp b/models/model_calvetti_py/model_calvetti_py.cpp index 7c60d40e8f..b20e15e782 100644 --- a/models/model_calvetti_py/model_calvetti_py.cpp +++ b/models/model_calvetti_py/model_calvetti_py.cpp @@ -1,9 +1,7 @@ #include #include -namespace amici { - -namespace model_model_calvetti_py { +namespace amici::model_model_calvetti_py { // clang-format off @@ -124,6 +122,4 @@ std::array stateIdxsSolver = { // clang-format on -} // namespace model_model_calvetti_py - -} // namespace amici +} // namespace amici::model_model_calvetti_py diff --git a/models/model_calvetti_py/model_calvetti_py.h b/models/model_calvetti_py/model_calvetti_py.h index 2c9876f0ff..55f63d810f 100644 --- a/models/model_calvetti_py/model_calvetti_py.h +++ b/models/model_calvetti_py/model_calvetti_py.h @@ -550,7 +550,7 @@ class Model_model_calvetti_py : public amici::Model_DAE { * @return AMICI version string */ std::string getAmiciVersion() const override { - return "0.33.0"; + return "0.34.0"; } /** @@ -558,7 +558,7 @@ class Model_model_calvetti_py : public amici::Model_DAE { * @return AMICI git commit hash */ std::string getAmiciCommit() const override { - return "d587a622b8295dff051b8cb45d009d9b037f7012"; + return "08d0c9533715453de60b684970751c6de07ffd9b"; } bool hasQuadraticLLH() const override { diff --git a/models/model_calvetti_py/setup.py b/models/model_calvetti_py/setup.py index 64c08d16c4..8cfb7c56ce 100644 --- a/models/model_calvetti_py/setup.py +++ b/models/model_calvetti_py/setup.py @@ -87,7 +87,7 @@ def get_extension() -> CMakeExtension: author_email="model-author-todo", ext_modules=[MODEL_EXT], packages=find_namespace_packages(), - install_requires=["amici==0.33.0"], + install_requires=["amici==0.34.0"], python_requires=">=3.11", package_data={}, zip_safe=False, diff --git a/models/model_calvetti_py/wrapfunctions.h b/models/model_calvetti_py/wrapfunctions.h index 33c8a9d819..e7ba14ce79 100644 --- a/models/model_calvetti_py/wrapfunctions.h +++ b/models/model_calvetti_py/wrapfunctions.h @@ -5,9 +5,7 @@ #include "amici/model.h" -namespace amici { -namespace generic_model { - +namespace amici::generic_model { /** * @brief Wrapper function to instantiate the linked Amici model without knowing @@ -16,10 +14,7 @@ namespace generic_model { */ std::unique_ptr getModel(); - -} // namespace generic_model - -} // namespace amici +} // namespace amici::generic_model #endif /* _amici_wrapfunctions_h */ diff --git a/models/model_dirac_py/CMakeLists.txt b/models/model_dirac_py/CMakeLists.txt index fcb4addf05..ddeb462b7e 100644 --- a/models/model_dirac_py/CMakeLists.txt +++ b/models/model_dirac_py/CMakeLists.txt @@ -30,7 +30,7 @@ if(DEFINED ENV{AMICI_LDFLAGS}) link_libraries("$ENV{AMICI_LDFLAGS}") endif() -find_package(Amici 0.33.0 REQUIRED HINTS +find_package(Amici 0.34.0 REQUIRED HINTS ${CMAKE_CURRENT_LIST_DIR}/../../build) message(STATUS "Found AMICI ${Amici_DIR}") set_target_properties(Upstream::amici PROPERTIES diff --git a/models/model_dirac_py/model_dirac_py.cpp b/models/model_dirac_py/model_dirac_py.cpp index b12c0da08a..59776a1266 100644 --- a/models/model_dirac_py/model_dirac_py.cpp +++ b/models/model_dirac_py/model_dirac_py.cpp @@ -1,9 +1,7 @@ #include #include -namespace amici { - -namespace model_model_dirac_py { +namespace amici::model_model_dirac_py { // clang-format off @@ -65,6 +63,4 @@ std::array stateIdxsSolver = { // clang-format on -} // namespace model_model_dirac_py - -} // namespace amici +} // namespace amici::model_model_dirac_py diff --git a/models/model_dirac_py/model_dirac_py.h b/models/model_dirac_py/model_dirac_py.h index 3d9ef2d9f8..a554a47f2d 100644 --- a/models/model_dirac_py/model_dirac_py.h +++ b/models/model_dirac_py/model_dirac_py.h @@ -537,7 +537,7 @@ class Model_model_dirac_py : public amici::Model_ODE { * @return AMICI version string */ std::string getAmiciVersion() const override { - return "0.33.0"; + return "0.34.0"; } /** @@ -545,7 +545,7 @@ class Model_model_dirac_py : public amici::Model_ODE { * @return AMICI git commit hash */ std::string getAmiciCommit() const override { - return "d587a622b8295dff051b8cb45d009d9b037f7012"; + return "08d0c9533715453de60b684970751c6de07ffd9b"; } bool hasQuadraticLLH() const override { diff --git a/models/model_dirac_py/setup.py b/models/model_dirac_py/setup.py index 00648926a6..82990687e6 100644 --- a/models/model_dirac_py/setup.py +++ b/models/model_dirac_py/setup.py @@ -87,7 +87,7 @@ def get_extension() -> CMakeExtension: author_email="model-author-todo", ext_modules=[MODEL_EXT], packages=find_namespace_packages(), - install_requires=["amici==0.33.0"], + install_requires=["amici==0.34.0"], python_requires=">=3.11", package_data={}, zip_safe=False, diff --git a/models/model_dirac_py/wrapfunctions.h b/models/model_dirac_py/wrapfunctions.h index 33c8a9d819..e7ba14ce79 100644 --- a/models/model_dirac_py/wrapfunctions.h +++ b/models/model_dirac_py/wrapfunctions.h @@ -5,9 +5,7 @@ #include "amici/model.h" -namespace amici { -namespace generic_model { - +namespace amici::generic_model { /** * @brief Wrapper function to instantiate the linked Amici model without knowing @@ -16,10 +14,7 @@ namespace generic_model { */ std::unique_ptr getModel(); - -} // namespace generic_model - -} // namespace amici +} // namespace amici::generic_model #endif /* _amici_wrapfunctions_h */ diff --git a/models/model_events_py/CMakeLists.txt b/models/model_events_py/CMakeLists.txt index c3f53e961d..aac7f01360 100644 --- a/models/model_events_py/CMakeLists.txt +++ b/models/model_events_py/CMakeLists.txt @@ -30,7 +30,7 @@ if(DEFINED ENV{AMICI_LDFLAGS}) link_libraries("$ENV{AMICI_LDFLAGS}") endif() -find_package(Amici 0.33.0 REQUIRED HINTS +find_package(Amici 0.34.0 REQUIRED HINTS ${CMAKE_CURRENT_LIST_DIR}/../../build) message(STATUS "Found AMICI ${Amici_DIR}") set_target_properties(Upstream::amici PROPERTIES diff --git a/models/model_events_py/model_events_py.cpp b/models/model_events_py/model_events_py.cpp index 730ab8bcac..bec1ccacfb 100644 --- a/models/model_events_py/model_events_py.cpp +++ b/models/model_events_py/model_events_py.cpp @@ -1,9 +1,7 @@ #include #include -namespace amici { - -namespace model_model_events_py { +namespace amici::model_model_events_py { // clang-format off @@ -73,6 +71,4 @@ std::array stateIdxsSolver = { // clang-format on -} // namespace model_model_events_py - -} // namespace amici +} // namespace amici::model_model_events_py diff --git a/models/model_events_py/model_events_py.h b/models/model_events_py/model_events_py.h index 00d6a2272c..305ff09fde 100644 --- a/models/model_events_py/model_events_py.h +++ b/models/model_events_py/model_events_py.h @@ -572,7 +572,7 @@ class Model_model_events_py : public amici::Model_ODE { * @return AMICI version string */ std::string getAmiciVersion() const override { - return "0.33.0"; + return "0.34.0"; } /** @@ -580,7 +580,7 @@ class Model_model_events_py : public amici::Model_ODE { * @return AMICI git commit hash */ std::string getAmiciCommit() const override { - return "d587a622b8295dff051b8cb45d009d9b037f7012"; + return "08d0c9533715453de60b684970751c6de07ffd9b"; } bool hasQuadraticLLH() const override { diff --git a/models/model_events_py/setup.py b/models/model_events_py/setup.py index 7676372a14..2a16c2a2f2 100644 --- a/models/model_events_py/setup.py +++ b/models/model_events_py/setup.py @@ -87,7 +87,7 @@ def get_extension() -> CMakeExtension: author_email="model-author-todo", ext_modules=[MODEL_EXT], packages=find_namespace_packages(), - install_requires=["amici==0.33.0"], + install_requires=["amici==0.34.0"], python_requires=">=3.11", package_data={}, zip_safe=False, diff --git a/models/model_events_py/wrapfunctions.h b/models/model_events_py/wrapfunctions.h index 33c8a9d819..e7ba14ce79 100644 --- a/models/model_events_py/wrapfunctions.h +++ b/models/model_events_py/wrapfunctions.h @@ -5,9 +5,7 @@ #include "amici/model.h" -namespace amici { -namespace generic_model { - +namespace amici::generic_model { /** * @brief Wrapper function to instantiate the linked Amici model without knowing @@ -16,10 +14,7 @@ namespace generic_model { */ std::unique_ptr getModel(); - -} // namespace generic_model - -} // namespace amici +} // namespace amici::generic_model #endif /* _amici_wrapfunctions_h */ diff --git a/models/model_jakstat_adjoint_py/CMakeLists.txt b/models/model_jakstat_adjoint_py/CMakeLists.txt index f6106314a3..1f9cd62dda 100644 --- a/models/model_jakstat_adjoint_py/CMakeLists.txt +++ b/models/model_jakstat_adjoint_py/CMakeLists.txt @@ -30,7 +30,7 @@ if(DEFINED ENV{AMICI_LDFLAGS}) link_libraries("$ENV{AMICI_LDFLAGS}") endif() -find_package(Amici 0.33.0 REQUIRED HINTS +find_package(Amici 0.34.0 REQUIRED HINTS ${CMAKE_CURRENT_LIST_DIR}/../../build) message(STATUS "Found AMICI ${Amici_DIR}") set_target_properties(Upstream::amici PROPERTIES diff --git a/models/model_jakstat_adjoint_py/model_jakstat_adjoint_py.cpp b/models/model_jakstat_adjoint_py/model_jakstat_adjoint_py.cpp index e31e5cd7ec..781de99002 100644 --- a/models/model_jakstat_adjoint_py/model_jakstat_adjoint_py.cpp +++ b/models/model_jakstat_adjoint_py/model_jakstat_adjoint_py.cpp @@ -1,9 +1,7 @@ #include #include -namespace amici { - -namespace model_model_jakstat_adjoint_py { +namespace amici::model_model_jakstat_adjoint_py { // clang-format off @@ -115,6 +113,4 @@ std::array stateIdxsSolver = { // clang-format on -} // namespace model_model_jakstat_adjoint_py - -} // namespace amici +} // namespace amici::model_model_jakstat_adjoint_py diff --git a/models/model_jakstat_adjoint_py/model_jakstat_adjoint_py.h b/models/model_jakstat_adjoint_py/model_jakstat_adjoint_py.h index 35681de3e1..1a6eaefb58 100644 --- a/models/model_jakstat_adjoint_py/model_jakstat_adjoint_py.h +++ b/models/model_jakstat_adjoint_py/model_jakstat_adjoint_py.h @@ -545,7 +545,7 @@ class Model_model_jakstat_adjoint_py : public amici::Model_ODE { * @return AMICI version string */ std::string getAmiciVersion() const override { - return "0.33.0"; + return "0.34.0"; } /** @@ -553,7 +553,7 @@ class Model_model_jakstat_adjoint_py : public amici::Model_ODE { * @return AMICI git commit hash */ std::string getAmiciCommit() const override { - return "d587a622b8295dff051b8cb45d009d9b037f7012"; + return "08d0c9533715453de60b684970751c6de07ffd9b"; } bool hasQuadraticLLH() const override { diff --git a/models/model_jakstat_adjoint_py/setup.py b/models/model_jakstat_adjoint_py/setup.py index 767a3dfe88..95ec992582 100644 --- a/models/model_jakstat_adjoint_py/setup.py +++ b/models/model_jakstat_adjoint_py/setup.py @@ -87,7 +87,7 @@ def get_extension() -> CMakeExtension: author_email="model-author-todo", ext_modules=[MODEL_EXT], packages=find_namespace_packages(), - install_requires=["amici==0.33.0"], + install_requires=["amici==0.34.0"], python_requires=">=3.11", package_data={}, zip_safe=False, diff --git a/models/model_jakstat_adjoint_py/wrapfunctions.h b/models/model_jakstat_adjoint_py/wrapfunctions.h index 33c8a9d819..e7ba14ce79 100644 --- a/models/model_jakstat_adjoint_py/wrapfunctions.h +++ b/models/model_jakstat_adjoint_py/wrapfunctions.h @@ -5,9 +5,7 @@ #include "amici/model.h" -namespace amici { -namespace generic_model { - +namespace amici::generic_model { /** * @brief Wrapper function to instantiate the linked Amici model without knowing @@ -16,10 +14,7 @@ namespace generic_model { */ std::unique_ptr getModel(); - -} // namespace generic_model - -} // namespace amici +} // namespace amici::generic_model #endif /* _amici_wrapfunctions_h */ diff --git a/models/model_nested_events_py/CMakeLists.txt b/models/model_nested_events_py/CMakeLists.txt index 45629d6d44..869b44e495 100644 --- a/models/model_nested_events_py/CMakeLists.txt +++ b/models/model_nested_events_py/CMakeLists.txt @@ -30,7 +30,7 @@ if(DEFINED ENV{AMICI_LDFLAGS}) link_libraries("$ENV{AMICI_LDFLAGS}") endif() -find_package(Amici 0.33.0 REQUIRED HINTS +find_package(Amici 0.34.0 REQUIRED HINTS ${CMAKE_CURRENT_LIST_DIR}/../../build) message(STATUS "Found AMICI ${Amici_DIR}") set_target_properties(Upstream::amici PROPERTIES diff --git a/models/model_nested_events_py/model_nested_events_py.cpp b/models/model_nested_events_py/model_nested_events_py.cpp index 5fef2fada0..fea822d2e6 100644 --- a/models/model_nested_events_py/model_nested_events_py.cpp +++ b/models/model_nested_events_py/model_nested_events_py.cpp @@ -1,9 +1,7 @@ #include #include -namespace amici { - -namespace model_model_nested_events_py { +namespace amici::model_model_nested_events_py { // clang-format off @@ -65,6 +63,4 @@ std::array stateIdxsSolver = { // clang-format on -} // namespace model_model_nested_events_py - -} // namespace amici +} // namespace amici::model_model_nested_events_py diff --git a/models/model_nested_events_py/model_nested_events_py.h b/models/model_nested_events_py/model_nested_events_py.h index 8670f38e53..ef1e36a67d 100644 --- a/models/model_nested_events_py/model_nested_events_py.h +++ b/models/model_nested_events_py/model_nested_events_py.h @@ -545,7 +545,7 @@ class Model_model_nested_events_py : public amici::Model_ODE { * @return AMICI version string */ std::string getAmiciVersion() const override { - return "0.33.0"; + return "0.34.0"; } /** @@ -553,7 +553,7 @@ class Model_model_nested_events_py : public amici::Model_ODE { * @return AMICI git commit hash */ std::string getAmiciCommit() const override { - return "d587a622b8295dff051b8cb45d009d9b037f7012"; + return "08d0c9533715453de60b684970751c6de07ffd9b"; } bool hasQuadraticLLH() const override { diff --git a/models/model_nested_events_py/setup.py b/models/model_nested_events_py/setup.py index d42f740789..f9af7829de 100644 --- a/models/model_nested_events_py/setup.py +++ b/models/model_nested_events_py/setup.py @@ -87,7 +87,7 @@ def get_extension() -> CMakeExtension: author_email="model-author-todo", ext_modules=[MODEL_EXT], packages=find_namespace_packages(), - install_requires=["amici==0.33.0"], + install_requires=["amici==0.34.0"], python_requires=">=3.11", package_data={}, zip_safe=False, diff --git a/models/model_nested_events_py/wrapfunctions.h b/models/model_nested_events_py/wrapfunctions.h index 33c8a9d819..e7ba14ce79 100644 --- a/models/model_nested_events_py/wrapfunctions.h +++ b/models/model_nested_events_py/wrapfunctions.h @@ -5,9 +5,7 @@ #include "amici/model.h" -namespace amici { -namespace generic_model { - +namespace amici::generic_model { /** * @brief Wrapper function to instantiate the linked Amici model without knowing @@ -16,10 +14,7 @@ namespace generic_model { */ std::unique_ptr getModel(); - -} // namespace generic_model - -} // namespace amici +} // namespace amici::generic_model #endif /* _amici_wrapfunctions_h */ diff --git a/models/model_neuron_py/CMakeLists.txt b/models/model_neuron_py/CMakeLists.txt index 290fb965f6..84f809898f 100644 --- a/models/model_neuron_py/CMakeLists.txt +++ b/models/model_neuron_py/CMakeLists.txt @@ -30,7 +30,7 @@ if(DEFINED ENV{AMICI_LDFLAGS}) link_libraries("$ENV{AMICI_LDFLAGS}") endif() -find_package(Amici 0.33.0 REQUIRED HINTS +find_package(Amici 0.34.0 REQUIRED HINTS ${CMAKE_CURRENT_LIST_DIR}/../../build) message(STATUS "Found AMICI ${Amici_DIR}") set_target_properties(Upstream::amici PROPERTIES diff --git a/models/model_neuron_py/model_neuron_py.cpp b/models/model_neuron_py/model_neuron_py.cpp index 64312c9884..87a5b1701d 100644 --- a/models/model_neuron_py/model_neuron_py.cpp +++ b/models/model_neuron_py/model_neuron_py.cpp @@ -1,9 +1,7 @@ #include #include -namespace amici { - -namespace model_model_neuron_py { +namespace amici::model_model_neuron_py { // clang-format off @@ -67,6 +65,4 @@ std::array stateIdxsSolver = { // clang-format on -} // namespace model_model_neuron_py - -} // namespace amici +} // namespace amici::model_model_neuron_py diff --git a/models/model_neuron_py/model_neuron_py.h b/models/model_neuron_py/model_neuron_py.h index 385bf1a150..3a8ae3fc06 100644 --- a/models/model_neuron_py/model_neuron_py.h +++ b/models/model_neuron_py/model_neuron_py.h @@ -567,7 +567,7 @@ class Model_model_neuron_py : public amici::Model_ODE { * @return AMICI version string */ std::string getAmiciVersion() const override { - return "0.33.0"; + return "0.34.0"; } /** @@ -575,7 +575,7 @@ class Model_model_neuron_py : public amici::Model_ODE { * @return AMICI git commit hash */ std::string getAmiciCommit() const override { - return "d587a622b8295dff051b8cb45d009d9b037f7012"; + return "08d0c9533715453de60b684970751c6de07ffd9b"; } bool hasQuadraticLLH() const override { diff --git a/models/model_neuron_py/setup.py b/models/model_neuron_py/setup.py index b3679e3142..f13fd72d33 100644 --- a/models/model_neuron_py/setup.py +++ b/models/model_neuron_py/setup.py @@ -87,7 +87,7 @@ def get_extension() -> CMakeExtension: author_email="model-author-todo", ext_modules=[MODEL_EXT], packages=find_namespace_packages(), - install_requires=["amici==0.33.0"], + install_requires=["amici==0.34.0"], python_requires=">=3.11", package_data={}, zip_safe=False, diff --git a/models/model_neuron_py/wrapfunctions.h b/models/model_neuron_py/wrapfunctions.h index 33c8a9d819..e7ba14ce79 100644 --- a/models/model_neuron_py/wrapfunctions.h +++ b/models/model_neuron_py/wrapfunctions.h @@ -5,9 +5,7 @@ #include "amici/model.h" -namespace amici { -namespace generic_model { - +namespace amici::generic_model { /** * @brief Wrapper function to instantiate the linked Amici model without knowing @@ -16,10 +14,7 @@ namespace generic_model { */ std::unique_ptr getModel(); - -} // namespace generic_model - -} // namespace amici +} // namespace amici::generic_model #endif /* _amici_wrapfunctions_h */ diff --git a/models/model_robertson_py/CMakeLists.txt b/models/model_robertson_py/CMakeLists.txt index 56cdbdf22b..90b22dd4e0 100644 --- a/models/model_robertson_py/CMakeLists.txt +++ b/models/model_robertson_py/CMakeLists.txt @@ -30,7 +30,7 @@ if(DEFINED ENV{AMICI_LDFLAGS}) link_libraries("$ENV{AMICI_LDFLAGS}") endif() -find_package(Amici 0.33.0 REQUIRED HINTS +find_package(Amici 0.34.0 REQUIRED HINTS ${CMAKE_CURRENT_LIST_DIR}/../../build) message(STATUS "Found AMICI ${Amici_DIR}") set_target_properties(Upstream::amici PROPERTIES diff --git a/models/model_robertson_py/model_robertson_py.cpp b/models/model_robertson_py/model_robertson_py.cpp index 58f8914f02..a3a61b2018 100644 --- a/models/model_robertson_py/model_robertson_py.cpp +++ b/models/model_robertson_py/model_robertson_py.cpp @@ -1,9 +1,7 @@ #include #include -namespace amici { - -namespace model_model_robertson_py { +namespace amici::model_model_robertson_py { // clang-format off @@ -71,6 +69,4 @@ std::array stateIdxsSolver = { // clang-format on -} // namespace model_model_robertson_py - -} // namespace amici +} // namespace amici::model_model_robertson_py diff --git a/models/model_robertson_py/model_robertson_py.h b/models/model_robertson_py/model_robertson_py.h index 7c7d021a74..d46970792e 100644 --- a/models/model_robertson_py/model_robertson_py.h +++ b/models/model_robertson_py/model_robertson_py.h @@ -529,7 +529,7 @@ class Model_model_robertson_py : public amici::Model_DAE { * @return AMICI version string */ std::string getAmiciVersion() const override { - return "0.33.0"; + return "0.34.0"; } /** @@ -537,7 +537,7 @@ class Model_model_robertson_py : public amici::Model_DAE { * @return AMICI git commit hash */ std::string getAmiciCommit() const override { - return "d587a622b8295dff051b8cb45d009d9b037f7012"; + return "08d0c9533715453de60b684970751c6de07ffd9b"; } bool hasQuadraticLLH() const override { diff --git a/models/model_robertson_py/setup.py b/models/model_robertson_py/setup.py index b60d29dc40..b201a0616b 100644 --- a/models/model_robertson_py/setup.py +++ b/models/model_robertson_py/setup.py @@ -87,7 +87,7 @@ def get_extension() -> CMakeExtension: author_email="model-author-todo", ext_modules=[MODEL_EXT], packages=find_namespace_packages(), - install_requires=["amici==0.33.0"], + install_requires=["amici==0.34.0"], python_requires=">=3.11", package_data={}, zip_safe=False, diff --git a/models/model_robertson_py/wrapfunctions.h b/models/model_robertson_py/wrapfunctions.h index 33c8a9d819..e7ba14ce79 100644 --- a/models/model_robertson_py/wrapfunctions.h +++ b/models/model_robertson_py/wrapfunctions.h @@ -5,9 +5,7 @@ #include "amici/model.h" -namespace amici { -namespace generic_model { - +namespace amici::generic_model { /** * @brief Wrapper function to instantiate the linked Amici model without knowing @@ -16,10 +14,7 @@ namespace generic_model { */ std::unique_ptr getModel(); - -} // namespace generic_model - -} // namespace amici +} // namespace amici::generic_model #endif /* _amici_wrapfunctions_h */ diff --git a/models/model_steadystate_py/CMakeLists.txt b/models/model_steadystate_py/CMakeLists.txt index 14347328de..315be705ba 100644 --- a/models/model_steadystate_py/CMakeLists.txt +++ b/models/model_steadystate_py/CMakeLists.txt @@ -30,7 +30,7 @@ if(DEFINED ENV{AMICI_LDFLAGS}) link_libraries("$ENV{AMICI_LDFLAGS}") endif() -find_package(Amici 0.33.0 REQUIRED HINTS +find_package(Amici 0.34.0 REQUIRED HINTS ${CMAKE_CURRENT_LIST_DIR}/../../build) message(STATUS "Found AMICI ${Amici_DIR}") set_target_properties(Upstream::amici PROPERTIES diff --git a/models/model_steadystate_py/model_steadystate_py.cpp b/models/model_steadystate_py/model_steadystate_py.cpp index 02962c732f..631841e06c 100644 --- a/models/model_steadystate_py/model_steadystate_py.cpp +++ b/models/model_steadystate_py/model_steadystate_py.cpp @@ -1,9 +1,7 @@ #include #include -namespace amici { - -namespace model_model_steadystate_py { +namespace amici::model_model_steadystate_py { // clang-format off @@ -81,6 +79,4 @@ std::array stateIdxsSolver = { // clang-format on -} // namespace model_model_steadystate_py - -} // namespace amici +} // namespace amici::model_model_steadystate_py diff --git a/models/model_steadystate_py/model_steadystate_py.h b/models/model_steadystate_py/model_steadystate_py.h index 0b3f8d89c3..989937c1db 100644 --- a/models/model_steadystate_py/model_steadystate_py.h +++ b/models/model_steadystate_py/model_steadystate_py.h @@ -529,7 +529,7 @@ class Model_model_steadystate_py : public amici::Model_ODE { * @return AMICI version string */ std::string getAmiciVersion() const override { - return "0.33.0"; + return "0.34.0"; } /** @@ -537,7 +537,7 @@ class Model_model_steadystate_py : public amici::Model_ODE { * @return AMICI git commit hash */ std::string getAmiciCommit() const override { - return "d587a622b8295dff051b8cb45d009d9b037f7012"; + return "08d0c9533715453de60b684970751c6de07ffd9b"; } bool hasQuadraticLLH() const override { diff --git a/models/model_steadystate_py/model_steadystate_py/__init__.py b/models/model_steadystate_py/model_steadystate_py/__init__.py new file mode 100644 index 0000000000..fad121c291 --- /dev/null +++ b/models/model_steadystate_py/model_steadystate_py/__init__.py @@ -0,0 +1,48 @@ +"""AMICI-generated module for model model_steadystate_py""" + +import sys +from pathlib import Path +import amici +import warnings + +# Ensure we are binary-compatible, see #556 +if "0.34.0" != amici.__version__: + raise amici.AmiciVersionError( + f"Cannot use model `model_steadystate_py` in {Path(__file__).parent}, " + "generated with amici==0.34.0, " + f"together with amici=={amici.__version__} " + "which is currently installed. To use this model, install " + "amici==0.34.0 or re-import the model with the amici " + "version currently installed." + ) + +# prevent segfaults under pytest +# see also: +# https://github.com/swig/swig/issues/2881 +# https://github.com/AMICI-dev/AMICI/issues/2565 +with warnings.catch_warnings(): + warnings.filterwarnings( + "ignore", + category=DeprecationWarning, + message="builtin type .* has no __module__ attribute", + ) + + model_steadystate_py = amici._module_from_path( + "model_steadystate_py.model_steadystate_py", + Path(__file__).parent / "model_steadystate_py.py", + ) + +for var in dir(model_steadystate_py): + if not var.startswith("_"): + globals()[var] = getattr(model_steadystate_py, var) +get_model = model_steadystate_py.getModel + +try: + # _self: this module; will be set during import + # via amici.import_model_module + model_steadystate_py._model_module = _self # noqa: F821 +except NameError: + # when the model package is imported via `import` + model_steadystate_py._model_module = sys.modules[__name__] + +__version__ = "0.1.0" diff --git a/models/model_steadystate_py/setup.py b/models/model_steadystate_py/setup.py index 5d55a98edc..d517ffeab5 100644 --- a/models/model_steadystate_py/setup.py +++ b/models/model_steadystate_py/setup.py @@ -87,7 +87,7 @@ def get_extension() -> CMakeExtension: author_email="model-author-todo", ext_modules=[MODEL_EXT], packages=find_namespace_packages(), - install_requires=["amici==0.33.0"], + install_requires=["amici==0.34.0"], python_requires=">=3.11", package_data={}, zip_safe=False, diff --git a/models/model_steadystate_py/wrapfunctions.h b/models/model_steadystate_py/wrapfunctions.h index 33c8a9d819..e7ba14ce79 100644 --- a/models/model_steadystate_py/wrapfunctions.h +++ b/models/model_steadystate_py/wrapfunctions.h @@ -5,9 +5,7 @@ #include "amici/model.h" -namespace amici { -namespace generic_model { - +namespace amici::generic_model { /** * @brief Wrapper function to instantiate the linked Amici model without knowing @@ -16,10 +14,7 @@ namespace generic_model { */ std::unique_ptr getModel(); - -} // namespace generic_model - -} // namespace amici +} // namespace amici::generic_model #endif /* _amici_wrapfunctions_h */ diff --git a/version.txt b/version.txt index be386c9ede..85e60ed180 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.33.0 +0.34.0