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
10 changes: 9 additions & 1 deletion cmake/version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,13 @@ endif()
# get project root directory
get_filename_component(CMAKE_PARENT_LIST_DIR ${CMAKE_CURRENT_LIST_DIR}
DIRECTORY)
file(STRINGS "${CMAKE_PARENT_LIST_DIR}/version.txt" PROJECT_VERSION)
file(STRINGS "${CMAKE_PARENT_LIST_DIR}/version.txt" PROJECT_VERSION_RAW)

# try to extract major.minor.patch
# (ignore any Python .dev, .post, etc. suffixes)
string(REGEX MATCH "([0-9]+\\.[0-9]+\\.[0-9]+)" PROJECT_VERSION "${PROJECT_VERSION_RAW}")
if(NOT PROJECT_VERSION)
message(FATAL_ERROR "Could not extract version number from version.txt")
endif()

message(DEBUG "Version number: ${PROJECT_VERSION}")
8 changes: 8 additions & 0 deletions doc/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@ To create a new release, please follow these steps:
create and deploy the new release on Zenodo and PyPI.
Verify that this was successful.

7. Bump the version number in `version.txt` back to a development
version (e.g., after release "1.1.0", set the version to "1.2.0-dev")
and commit this change to ``main``.
This ensures that documentation at https://amici.readthedocs.io/en/latest/
will show the correct development version and won't be confused with the
latest release, and that models imported with a development version
will be marked as such.

In rare cases, it might be necessary to create a hotfix release for a
critical bug in an existing release. In this case, create a new branch
from the respective tag, apply the fix (usually a backport from ``main``),
Expand Down
2 changes: 1 addition & 1 deletion models/model_calvetti_py/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if(DEFINED ENV{AMICI_LDFLAGS})
link_libraries("$ENV{AMICI_LDFLAGS}")
endif()

find_package(Amici 0.34.2 REQUIRED HINTS
find_package(Amici 1.0.0 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.2";
return "1.0.0.dev";
}

/**
* @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 "c4a395b6462dc1f26ad1472e6b2fa71fe0d54382";
return "a8dfd6e0963f32c1ce4647a652e93a271b14a053";
}

bool has_quadratic_llh() const override {
Expand Down
2 changes: 1 addition & 1 deletion models/model_calvetti_py/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def get_extension() -> CMakeExtension:
author_email="model-author-todo",
ext_modules=[MODEL_EXT],
packages=find_namespace_packages(),
install_requires=["amici==0.34.2"],
install_requires=["amici==1.0.0.dev"],
python_requires=">=3.11",
package_data={},
zip_safe=False,
Expand Down
2 changes: 1 addition & 1 deletion models/model_dirac_py/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if(DEFINED ENV{AMICI_LDFLAGS})
link_libraries("$ENV{AMICI_LDFLAGS}")
endif()

find_package(Amici 0.34.2 REQUIRED HINTS
find_package(Amici 1.0.0 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.2";
return "1.0.0.dev";
}

/**
* @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 "c4a395b6462dc1f26ad1472e6b2fa71fe0d54382";
return "a8dfd6e0963f32c1ce4647a652e93a271b14a053";
}

bool has_quadratic_llh() const override {
Expand Down
2 changes: 1 addition & 1 deletion models/model_dirac_py/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def get_extension() -> CMakeExtension:
author_email="model-author-todo",
ext_modules=[MODEL_EXT],
packages=find_namespace_packages(),
install_requires=["amici==0.34.2"],
install_requires=["amici==1.0.0.dev"],
python_requires=">=3.11",
package_data={},
zip_safe=False,
Expand Down
2 changes: 1 addition & 1 deletion models/model_events_py/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if(DEFINED ENV{AMICI_LDFLAGS})
link_libraries("$ENV{AMICI_LDFLAGS}")
endif()

find_package(Amici 0.34.2 REQUIRED HINTS
find_package(Amici 1.0.0 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.2";
return "1.0.0.dev";
}

/**
* @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 "c4a395b6462dc1f26ad1472e6b2fa71fe0d54382";
return "a8dfd6e0963f32c1ce4647a652e93a271b14a053";
}

bool has_quadratic_llh() const override {
Expand Down
2 changes: 1 addition & 1 deletion models/model_events_py/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def get_extension() -> CMakeExtension:
author_email="model-author-todo",
ext_modules=[MODEL_EXT],
packages=find_namespace_packages(),
install_requires=["amici==0.34.2"],
install_requires=["amici==1.0.0.dev"],
python_requires=">=3.11",
package_data={},
zip_safe=False,
Expand Down
2 changes: 1 addition & 1 deletion models/model_jakstat_adjoint_py/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if(DEFINED ENV{AMICI_LDFLAGS})
link_libraries("$ENV{AMICI_LDFLAGS}")
endif()

find_package(Amici 0.34.2 REQUIRED HINTS
find_package(Amici 1.0.0 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_jakstat_adjoint_py/model_jakstat_adjoint_py.h
Original file line number Diff line number Diff line change
Expand Up @@ -544,15 +544,15 @@ class Model_model_jakstat_adjoint_py : public amici::Model_ODE {
* @return AMICI version string
*/
std::string get_amici_version() const override {
return "0.34.2";
return "1.0.0.dev";
}

/**
* @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 "c4a395b6462dc1f26ad1472e6b2fa71fe0d54382";
return "a8dfd6e0963f32c1ce4647a652e93a271b14a053";
}

bool has_quadratic_llh() const override {
Expand Down
2 changes: 1 addition & 1 deletion models/model_jakstat_adjoint_py/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def get_extension() -> CMakeExtension:
author_email="model-author-todo",
ext_modules=[MODEL_EXT],
packages=find_namespace_packages(),
install_requires=["amici==0.34.2"],
install_requires=["amici==1.0.0.dev"],
python_requires=">=3.11",
package_data={},
zip_safe=False,
Expand Down
2 changes: 1 addition & 1 deletion models/model_nested_events_py/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if(DEFINED ENV{AMICI_LDFLAGS})
link_libraries("$ENV{AMICI_LDFLAGS}")
endif()

find_package(Amici 0.34.2 REQUIRED HINTS
find_package(Amici 1.0.0 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_nested_events_py/model_nested_events_py.h
Original file line number Diff line number Diff line change
Expand Up @@ -544,15 +544,15 @@ class Model_model_nested_events_py : public amici::Model_ODE {
* @return AMICI version string
*/
std::string get_amici_version() const override {
return "0.34.2";
return "1.0.0.dev";
}

/**
* @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 "c4a395b6462dc1f26ad1472e6b2fa71fe0d54382";
return "a8dfd6e0963f32c1ce4647a652e93a271b14a053";
}

bool has_quadratic_llh() const override {
Expand Down
2 changes: 1 addition & 1 deletion models/model_nested_events_py/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def get_extension() -> CMakeExtension:
author_email="model-author-todo",
ext_modules=[MODEL_EXT],
packages=find_namespace_packages(),
install_requires=["amici==0.34.2"],
install_requires=["amici==1.0.0.dev"],
python_requires=">=3.11",
package_data={},
zip_safe=False,
Expand Down
2 changes: 1 addition & 1 deletion models/model_neuron_py/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if(DEFINED ENV{AMICI_LDFLAGS})
link_libraries("$ENV{AMICI_LDFLAGS}")
endif()

find_package(Amici 0.34.2 REQUIRED HINTS
find_package(Amici 1.0.0 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_neuron_py/model_neuron_py.h
Original file line number Diff line number Diff line change
Expand Up @@ -566,15 +566,15 @@ class Model_model_neuron_py : public amici::Model_ODE {
* @return AMICI version string
*/
std::string get_amici_version() const override {
return "0.34.2";
return "1.0.0.dev";
}

/**
* @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 "c4a395b6462dc1f26ad1472e6b2fa71fe0d54382";
return "a8dfd6e0963f32c1ce4647a652e93a271b14a053";
}

bool has_quadratic_llh() const override {
Expand Down
2 changes: 1 addition & 1 deletion models/model_neuron_py/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def get_extension() -> CMakeExtension:
author_email="model-author-todo",
ext_modules=[MODEL_EXT],
packages=find_namespace_packages(),
install_requires=["amici==0.34.2"],
install_requires=["amici==1.0.0.dev"],
python_requires=">=3.11",
package_data={},
zip_safe=False,
Expand Down
2 changes: 1 addition & 1 deletion models/model_robertson_py/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if(DEFINED ENV{AMICI_LDFLAGS})
link_libraries("$ENV{AMICI_LDFLAGS}")
endif()

find_package(Amici 0.34.2 REQUIRED HINTS
find_package(Amici 1.0.0 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_robertson_py/model_robertson_py.h
Original file line number Diff line number Diff line change
Expand Up @@ -528,15 +528,15 @@ class Model_model_robertson_py : public amici::Model_DAE {
* @return AMICI version string
*/
std::string get_amici_version() const override {
return "0.34.2";
return "1.0.0.dev";
}

/**
* @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 "c4a395b6462dc1f26ad1472e6b2fa71fe0d54382";
return "a8dfd6e0963f32c1ce4647a652e93a271b14a053";
}

bool has_quadratic_llh() const override {
Expand Down
2 changes: 1 addition & 1 deletion models/model_robertson_py/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def get_extension() -> CMakeExtension:
author_email="model-author-todo",
ext_modules=[MODEL_EXT],
packages=find_namespace_packages(),
install_requires=["amici==0.34.2"],
install_requires=["amici==1.0.0.dev"],
python_requires=">=3.11",
package_data={},
zip_safe=False,
Expand Down
2 changes: 1 addition & 1 deletion models/model_steadystate_py/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if(DEFINED ENV{AMICI_LDFLAGS})
link_libraries("$ENV{AMICI_LDFLAGS}")
endif()

find_package(Amici 0.34.2 REQUIRED HINTS
find_package(Amici 1.0.0 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_steadystate_py/model_steadystate_py.h
Original file line number Diff line number Diff line change
Expand Up @@ -528,15 +528,15 @@ class Model_model_steadystate_py : public amici::Model_ODE {
* @return AMICI version string
*/
std::string get_amici_version() const override {
return "0.34.2";
return "1.0.0.dev";
}

/**
* @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 "c4a395b6462dc1f26ad1472e6b2fa71fe0d54382";
return "a8dfd6e0963f32c1ce4647a652e93a271b14a053";
}

bool has_quadratic_llh() const override {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
import amici

# Ensure we are binary-compatible, see #556
if "0.34.2" != amici.__version__:
if "1.0.0.dev" != amici.__version__:
raise amici.AmiciVersionError(
f"Cannot use model `model_steadystate_py` in {Path(__file__).parent}, "
"generated with amici==0.34.2, "
"generated with amici==1.0.0.dev, "
f"together with amici=={amici.__version__} "
"which is currently installed. To use this model, install "
"amici==0.34.2 or re-import the model with the amici "
"amici==1.0.0.dev or re-import the model with the amici "
"version currently installed."
)

Expand Down
2 changes: 1 addition & 1 deletion models/model_steadystate_py/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def get_extension() -> CMakeExtension:
author_email="model-author-todo",
ext_modules=[MODEL_EXT],
packages=find_namespace_packages(),
install_requires=["amici==0.34.2"],
install_requires=["amici==1.0.0.dev"],
python_requires=">=3.11",
package_data={},
zip_safe=False,
Expand Down
4 changes: 3 additions & 1 deletion python/sdist/amici/exporters/sundials/de_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,9 @@ def _write_c_make_file(self):
template_data = {
"MODELNAME": self.model_name,
"SOURCES": sources,
"AMICI_VERSION": __version__,
# Use major.minor.patch for find_package compatibility.
# CMake version only has number components, no ".dev", ".post", ...
"AMICI_VERSION": ".".join(__version__.split(".")[:3]),
}
apply_template(
MODEL_CMAKE_TEMPLATE_FILE,
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.34.2
1.0.0.dev
Loading