Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion models/model_calvetti_py/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ cmake_policy(VERSION 3.22...3.31)

project(model_calvetti_py)

message(STATUS "CMAKE_CURRENT_SOURCE_DIR: ${CMAKE_CURRENT_SOURCE_DIR}")
message(STATUS "CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR}")
message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
message(STATUS "CMAKE_VERSION: ${CMAKE_VERSION}")
message(STATUS "CMAKE_COMMAND: ${CMAKE_COMMAND}")

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
Expand All @@ -30,7 +36,7 @@ if(DEFINED ENV{AMICI_LDFLAGS})
link_libraries("$ENV{AMICI_LDFLAGS}")
endif()

find_package(Amici 0.34.1 REQUIRED HINTS
find_package(Amici 0.34.2 REQUIRED HINTS
${CMAKE_CURRENT_LIST_DIR}/../../build)
message(STATUS "Found AMICI ${Amici_DIR}")
set_target_properties(Upstream::amici PROPERTIES
Expand Down
4 changes: 2 additions & 2 deletions models/model_calvetti_py/model_calvetti_py.h
Original file line number Diff line number Diff line change
Expand Up @@ -549,15 +549,15 @@ class Model_model_calvetti_py : public amici::Model_DAE {
* @return AMICI version string
*/
std::string get_amici_version() const override {
return "0.34.1";
return "0.34.2";
}

/**
* @brief returns the amici version that was used to generate the model
* @return AMICI git commit hash
*/
std::string get_amici_commit() const override {
return "f005fac9e2de7c3c90be2ac55d4ad165471ed1e7";
return "b0b2684b4b67db9eadf5e47d4f87f8fe74dd9070";
}

bool has_quadratic_llh() const override {
Expand Down
4 changes: 2 additions & 2 deletions models/model_calvetti_py/setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""AMICI model package setup"""

import importlib.metadata
import os
import sys
from pathlib import Path
Expand All @@ -8,7 +9,6 @@
from amici.custom_commands import AmiciBuildCMakeExtension
from cmake_build_extension import CMakeExtension
from setuptools import find_namespace_packages, setup
import importlib.metadata


def get_extension() -> CMakeExtension:
Expand Down Expand Up @@ -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.34.1"],
install_requires=["amici==0.34.2"],
python_requires=">=3.11",
package_data={},
zip_safe=False,
Expand Down
31 changes: 28 additions & 3 deletions models/model_calvetti_py/swig/model_calvetti_py.i
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ import sysconfig
from pathlib import Path

ext_suffix = sysconfig.get_config_var('EXT_SUFFIX')
extension_path = Path(__file__).parent / f'_model_calvetti_py{ext_suffix}'
_model_calvetti_py = amici._module_from_path(
'model_calvetti_py._model_calvetti_py' if __package__ or '.' in __name__
else '_model_calvetti_py',
Path(__file__).parent / f'_model_calvetti_py{ext_suffix}',
extension_path,
)

def _get_import_time():
Expand All @@ -36,6 +37,28 @@ if t_imported < t_modified:

%module(package="model_calvetti_py",moduleimport=MODULEIMPORT) model_calvetti_py

// store swig version
%constant int SWIG_VERSION_MAJOR = (SWIG_VERSION >> 16);
%constant int SWIG_VERSION_MINOR = ((SWIG_VERSION >> 8) & 0xff);
%constant int SWIG_VERSION_PATCH = (SWIG_VERSION & 0xff);

%pythoncode %{
# SWIG version used to build the model extension as `(major, minor, patch)`
_SWIG_VERSION = (SWIG_VERSION_MAJOR, SWIG_VERSION_MINOR, SWIG_VERSION_PATCH)

if (amici_swig := amici.amici._SWIG_VERSION) != (model_swig := _SWIG_VERSION):
import warnings
warnings.warn(
f"SWIG version mismatch between amici ({amici_swig}) and model "
f"({model_swig}). This may lead to unexpected behavior. "
"In that case, please recompile the model with swig=="
f"{amici_swig[0]}.{amici_swig[1]}.{amici_swig[2]} or rebuild amici "
f"with swig=={model_swig[0]}.{model_swig[1]}.{model_swig[2]}.",
RuntimeWarning,
stacklevel=2,
)
%}

%pythoncode %{
# the model-package __init__.py module (will be set during import)
_model_module = None
Expand All @@ -56,7 +79,7 @@ using namespace amici;
// store the time a module was imported
%{
#include <chrono>
static std::chrono::time_point<std::chrono::system_clock> _module_import_time;
static std::chrono::time_point<std::chrono::system_clock> _module_import_time = std::chrono::system_clock::now();

static double _get_import_time() {
auto epoch = _module_import_time.time_since_epoch();
Expand All @@ -67,7 +90,9 @@ static double _get_import_time() {
static double _get_import_time();

%init %{
_module_import_time = std::chrono::system_clock::now();
// NOTE: from SWIG 4.4.0 onwards, %init code is executed every time the
// module is executed - not only on first import
// This code ends up in `SWIG_mod_exec`.
%}


Expand Down
8 changes: 7 additions & 1 deletion models/model_dirac_py/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ cmake_policy(VERSION 3.22...3.31)

project(model_dirac_py)

message(STATUS "CMAKE_CURRENT_SOURCE_DIR: ${CMAKE_CURRENT_SOURCE_DIR}")
message(STATUS "CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR}")
message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
message(STATUS "CMAKE_VERSION: ${CMAKE_VERSION}")
message(STATUS "CMAKE_COMMAND: ${CMAKE_COMMAND}")

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
Expand All @@ -30,7 +36,7 @@ if(DEFINED ENV{AMICI_LDFLAGS})
link_libraries("$ENV{AMICI_LDFLAGS}")
endif()

find_package(Amici 0.34.1 REQUIRED HINTS
find_package(Amici 0.34.2 REQUIRED HINTS
${CMAKE_CURRENT_LIST_DIR}/../../build)
message(STATUS "Found AMICI ${Amici_DIR}")
set_target_properties(Upstream::amici PROPERTIES
Expand Down
4 changes: 2 additions & 2 deletions models/model_dirac_py/model_dirac_py.h
Original file line number Diff line number Diff line change
Expand Up @@ -536,15 +536,15 @@ class Model_model_dirac_py : public amici::Model_ODE {
* @return AMICI version string
*/
std::string get_amici_version() const override {
return "0.34.1";
return "0.34.2";
}

/**
* @brief returns the amici version that was used to generate the model
* @return AMICI git commit hash
*/
std::string get_amici_commit() const override {
return "f005fac9e2de7c3c90be2ac55d4ad165471ed1e7";
return "b0b2684b4b67db9eadf5e47d4f87f8fe74dd9070";
}

bool has_quadratic_llh() const override {
Expand Down
24 changes: 22 additions & 2 deletions models/model_dirac_py/model_dirac_py/model_dirac_py.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file was automatically generated by SWIG (https://www.swig.org).
# Version 4.3.1
# Version 4.4.0
#
# Do not make changes to this file unless you know what you are doing - modify
# the SWIG interface file instead.
Expand All @@ -14,10 +14,11 @@
from pathlib import Path

ext_suffix = sysconfig.get_config_var('EXT_SUFFIX')
extension_path = Path(__file__).parent / f'_model_dirac_py{ext_suffix}'
_model_dirac_py = amici._module_from_path(
'model_dirac_py._model_dirac_py' if __package__ or '.' in __name__
else '_model_dirac_py',
Path(__file__).parent / f'_model_dirac_py{ext_suffix}',
extension_path,
)

def _get_import_time():
Expand Down Expand Up @@ -86,6 +87,25 @@ class _SwigNonDynamicMeta(type):
__setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)


SWIG_VERSION_MAJOR = _model_dirac_py.SWIG_VERSION_MAJOR
SWIG_VERSION_MINOR = _model_dirac_py.SWIG_VERSION_MINOR
SWIG_VERSION_PATCH = _model_dirac_py.SWIG_VERSION_PATCH

# SWIG version used to build the model extension as `(major, minor, patch)`
_SWIG_VERSION = (SWIG_VERSION_MAJOR, SWIG_VERSION_MINOR, SWIG_VERSION_PATCH)

if (amici_swig := amici.amici._SWIG_VERSION) != (model_swig := _SWIG_VERSION):
import warnings
warnings.warn(
f"SWIG version mismatch between amici ({amici_swig}) and model "
f"({model_swig}). This may lead to unexpected behavior. "
"In that case, please recompile the model with swig=="
f"{amici_swig[0]}.{amici_swig[1]}.{amici_swig[2]} or rebuild amici "
f"with swig=={model_swig[0]}.{model_swig[1]}.{model_swig[2]}.",
RuntimeWarning,
stacklevel=2,
)


# the model-package __init__.py module (will be set during import)
_model_module = None
Expand Down
4 changes: 2 additions & 2 deletions models/model_dirac_py/setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""AMICI model package setup"""

import importlib.metadata
import os
import sys
from pathlib import Path
Expand All @@ -8,7 +9,6 @@
from amici.custom_commands import AmiciBuildCMakeExtension
from cmake_build_extension import CMakeExtension
from setuptools import find_namespace_packages, setup
import importlib.metadata


def get_extension() -> CMakeExtension:
Expand Down Expand Up @@ -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.34.1"],
install_requires=["amici==0.34.2"],
python_requires=">=3.11",
package_data={},
zip_safe=False,
Expand Down
31 changes: 28 additions & 3 deletions models/model_dirac_py/swig/model_dirac_py.i
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ import sysconfig
from pathlib import Path

ext_suffix = sysconfig.get_config_var('EXT_SUFFIX')
extension_path = Path(__file__).parent / f'_model_dirac_py{ext_suffix}'
_model_dirac_py = amici._module_from_path(
'model_dirac_py._model_dirac_py' if __package__ or '.' in __name__
else '_model_dirac_py',
Path(__file__).parent / f'_model_dirac_py{ext_suffix}',
extension_path,
)

def _get_import_time():
Expand All @@ -36,6 +37,28 @@ if t_imported < t_modified:

%module(package="model_dirac_py",moduleimport=MODULEIMPORT) model_dirac_py

// store swig version
%constant int SWIG_VERSION_MAJOR = (SWIG_VERSION >> 16);
%constant int SWIG_VERSION_MINOR = ((SWIG_VERSION >> 8) & 0xff);
%constant int SWIG_VERSION_PATCH = (SWIG_VERSION & 0xff);

%pythoncode %{
# SWIG version used to build the model extension as `(major, minor, patch)`
_SWIG_VERSION = (SWIG_VERSION_MAJOR, SWIG_VERSION_MINOR, SWIG_VERSION_PATCH)

if (amici_swig := amici.amici._SWIG_VERSION) != (model_swig := _SWIG_VERSION):
import warnings
warnings.warn(
f"SWIG version mismatch between amici ({amici_swig}) and model "
f"({model_swig}). This may lead to unexpected behavior. "
"In that case, please recompile the model with swig=="
f"{amici_swig[0]}.{amici_swig[1]}.{amici_swig[2]} or rebuild amici "
f"with swig=={model_swig[0]}.{model_swig[1]}.{model_swig[2]}.",
RuntimeWarning,
stacklevel=2,
)
%}

%pythoncode %{
# the model-package __init__.py module (will be set during import)
_model_module = None
Expand All @@ -56,7 +79,7 @@ using namespace amici;
// store the time a module was imported
%{
#include <chrono>
static std::chrono::time_point<std::chrono::system_clock> _module_import_time;
static std::chrono::time_point<std::chrono::system_clock> _module_import_time = std::chrono::system_clock::now();

static double _get_import_time() {
auto epoch = _module_import_time.time_since_epoch();
Expand All @@ -67,7 +90,9 @@ static double _get_import_time() {
static double _get_import_time();

%init %{
_module_import_time = std::chrono::system_clock::now();
// NOTE: from SWIG 4.4.0 onwards, %init code is executed every time the
// module is executed - not only on first import
// This code ends up in `SWIG_mod_exec`.
%}


Expand Down
8 changes: 7 additions & 1 deletion models/model_events_py/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ cmake_policy(VERSION 3.22...3.31)

project(model_events_py)

message(STATUS "CMAKE_CURRENT_SOURCE_DIR: ${CMAKE_CURRENT_SOURCE_DIR}")
message(STATUS "CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR}")
message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
message(STATUS "CMAKE_VERSION: ${CMAKE_VERSION}")
message(STATUS "CMAKE_COMMAND: ${CMAKE_COMMAND}")

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
Expand All @@ -30,7 +36,7 @@ if(DEFINED ENV{AMICI_LDFLAGS})
link_libraries("$ENV{AMICI_LDFLAGS}")
endif()

find_package(Amici 0.34.1 REQUIRED HINTS
find_package(Amici 0.34.2 REQUIRED HINTS
${CMAKE_CURRENT_LIST_DIR}/../../build)
message(STATUS "Found AMICI ${Amici_DIR}")
set_target_properties(Upstream::amici PROPERTIES
Expand Down
4 changes: 2 additions & 2 deletions models/model_events_py/model_events_py.h
Original file line number Diff line number Diff line change
Expand Up @@ -571,15 +571,15 @@ class Model_model_events_py : public amici::Model_ODE {
* @return AMICI version string
*/
std::string get_amici_version() const override {
return "0.34.1";
return "0.34.2";
}

/**
* @brief returns the amici version that was used to generate the model
* @return AMICI git commit hash
*/
std::string get_amici_commit() const override {
return "f005fac9e2de7c3c90be2ac55d4ad165471ed1e7";
return "b0b2684b4b67db9eadf5e47d4f87f8fe74dd9070";
}

bool has_quadratic_llh() const override {
Expand Down
4 changes: 2 additions & 2 deletions models/model_events_py/setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""AMICI model package setup"""

import importlib.metadata
import os
import sys
from pathlib import Path
Expand All @@ -8,7 +9,6 @@
from amici.custom_commands import AmiciBuildCMakeExtension
from cmake_build_extension import CMakeExtension
from setuptools import find_namespace_packages, setup
import importlib.metadata


def get_extension() -> CMakeExtension:
Expand Down Expand Up @@ -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.34.1"],
install_requires=["amici==0.34.2"],
python_requires=">=3.11",
package_data={},
zip_safe=False,
Expand Down
Loading
Loading