From 70be4a2e99fd89043741c4671a5b4765bcc4c6d2 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Wed, 8 May 2024 15:56:24 +0200 Subject: [PATCH 01/13] Fix release date --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1819436908..dc831f49c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## v0.X Series -### v0.25.0 (2024-05-TBD) +### v0.25.0 (2024-05-08) This release requires Python >= 3.10. From f30bada63420023ca3072fe31a30cfc76e1cfc26 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 May 2024 16:46:23 +0200 Subject: [PATCH 02/13] Bump actions/cache from 3 to 4 (#2434) Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/test_python_cplusplus.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_python_cplusplus.yml b/.github/workflows/test_python_cplusplus.yml index 5714a37b21..2128f4df1a 100644 --- a/.github/workflows/test_python_cplusplus.yml +++ b/.github/workflows/test_python_cplusplus.yml @@ -19,7 +19,7 @@ jobs: steps: - name: Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/.cache/pooch @@ -273,7 +273,7 @@ jobs: steps: - name: Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/Library/Caches/pooch From 7aa0950734c3b99b9f717834583c2ad8fff682ef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 May 2024 16:48:55 +0200 Subject: [PATCH 03/13] Bump matlab-actions/setup-matlab from 1 to 2 (#2436) Bumps [matlab-actions/setup-matlab](https://github.com/matlab-actions/setup-matlab) from 1 to 2. - [Release notes](https://github.com/matlab-actions/setup-matlab/releases) - [Commits](https://github.com/matlab-actions/setup-matlab/compare/v1...v2) --- updated-dependencies: - dependency-name: matlab-actions/setup-matlab dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/test_matlab.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_matlab.yml b/.github/workflows/test_matlab.yml index 46185e9d45..90ada6d995 100644 --- a/.github/workflows/test_matlab.yml +++ b/.github/workflows/test_matlab.yml @@ -21,7 +21,7 @@ jobs: - run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV - name: Install MATLAB - uses: matlab-actions/setup-matlab@v1 + uses: matlab-actions/setup-matlab@v2 - name: Run script uses: matlab-actions/run-command@v1 with: From 253b1075d0f2cf5bea28bd511e0139f498de2ce9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 May 2024 19:29:49 +0200 Subject: [PATCH 04/13] Bump matlab-actions/run-command from 1 to 2 (#2435) Bumps [matlab-actions/run-command](https://github.com/matlab-actions/run-command) from 1 to 2. - [Release notes](https://github.com/matlab-actions/run-command/releases) - [Commits](https://github.com/matlab-actions/run-command/compare/v1...v2) --- updated-dependencies: - dependency-name: matlab-actions/run-command dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/test_matlab.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_matlab.yml b/.github/workflows/test_matlab.yml index 90ada6d995..473b927e7d 100644 --- a/.github/workflows/test_matlab.yml +++ b/.github/workflows/test_matlab.yml @@ -23,6 +23,6 @@ jobs: - name: Install MATLAB uses: matlab-actions/setup-matlab@v2 - name: Run script - uses: matlab-actions/run-command@v1 + uses: matlab-actions/run-command@v2 with: command: cd matlab; installAMICI; addpath tests; testModels From 56949761eda0d536e56575b6562691b0f1e7a1e7 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Mon, 13 May 2024 10:40:45 +0200 Subject: [PATCH 05/13] Change dependabot target branch to 'develop' --- .github/dependabot.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d3e0189bdb..edacb6bea9 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,3 +8,4 @@ updates: ignore: - dependency-name: "*" update-types: ["version-update:semver-patch", "version-update:semver-minor"] + target-branch: "develop" From 4eb4bbd613c48d78d05b9574026c4b21fc6aa268 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Mon, 13 May 2024 11:26:52 +0200 Subject: [PATCH 06/13] RTD: bump Jinja2 --- documentation/rtd_requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/rtd_requirements.txt b/documentation/rtd_requirements.txt index 8d2c2100f9..9b5cc9709b 100644 --- a/documentation/rtd_requirements.txt +++ b/documentation/rtd_requirements.txt @@ -18,7 +18,7 @@ exhale>=0.3.7 sphinxcontrib-matlabdomain>=0.20.0 sphinxcontrib-napoleon>=0.7 pygments>=2.15.1 -Jinja2==3.1.2 +Jinja2==3.1.4 git+https://github.com/readthedocs/readthedocs-sphinx-ext ipykernel -e git+https://github.com/Benchmarking-Initiative/Benchmark-Models-PEtab.git@master#subdirectory=src/python&egg=benchmark_models_petab From 0c000461941abd0462d4ddb893a33801fe49aae9 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Tue, 14 May 2024 10:02:43 +0200 Subject: [PATCH 07/13] Avoid symbol clashes in plot_expressions (#2440) Ignore sympy constants when sympifying expression strings to avoid clashes with sympy.*. --- python/sdist/amici/numpy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/sdist/amici/numpy.py b/python/sdist/amici/numpy.py index 9aa03fc2dd..4f659c0b45 100644 --- a/python/sdist/amici/numpy.py +++ b/python/sdist/amici/numpy.py @@ -13,7 +13,7 @@ import amici import numpy as np import sympy as sp - +from sympy.abc import _clash from . import ExpData, ExpDataPtr, Model, ReturnData, ReturnDataPtr StrOrExpr = Union[str, sp.Expr] @@ -497,7 +497,7 @@ def evaluate(expr: StrOrExpr, rdata: ReturnDataView) -> np.array: from sympy.utilities.lambdify import lambdify if isinstance(expr, str): - expr = sp.sympify(expr) + expr = sp.sympify(expr, locals=_clash) arg_names = list(sorted(expr.free_symbols, key=lambda x: x.name)) func = lambdify(arg_names, expr, "numpy") From a63b016f316e7ab95eca2a2b0a9d0119448daf61 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Tue, 14 May 2024 14:31:41 +0200 Subject: [PATCH 08/13] Pin cmake_build_extension==0.5.1 (#2446) Missed one location before. Fixes #2442. --- scripts/installAmiciSource.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/installAmiciSource.sh b/scripts/installAmiciSource.sh index c074c89d46..514926773f 100755 --- a/scripts/installAmiciSource.sh +++ b/scripts/installAmiciSource.sh @@ -33,7 +33,7 @@ fi export PYTHON_EXECUTABLE="${AMICI_PATH}/venv/bin/python" python -m pip install --upgrade pip wheel -python -m pip install --upgrade pip setuptools cmake_build_extension numpy +python -m pip install --upgrade pip setuptools cmake_build_extension==0.5.1 numpy python -m pip install git+https://github.com/FFroehlich/pysb@fix_pattern_matching # pin to PR for SPM with compartments AMICI_BUILD_TEMP="${AMICI_PATH}/python/sdist/build/temp" \ python -m pip install --verbose -e "${AMICI_PATH}/python/sdist[petab,test,vis]" --no-build-isolation From e03f82970a51d30cfe2b42eeed5d5125fe7f2d05 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Wed, 15 May 2024 18:26:45 +0200 Subject: [PATCH 09/13] pytest: ignore log(0) warnings (#2448) The warning/error in #2444 is caused by `petab.parameters.scale()`. Whether this warning should be suppressed there or not is to discussed in the PEtab context. For amici, I'd say we're fine with just accepting `np.log(0) == -inf` without a warning. Closes #2444. --- pytest.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pytest.ini b/pytest.ini index 3868c80b1e..4f682576a3 100644 --- a/pytest.ini +++ b/pytest.ini @@ -19,5 +19,7 @@ filterwarnings = ignore:The --rsyncdir command line argument and rsyncdirs config variable are deprecated.:DeprecationWarning ignore:.*:ImportWarning:tellurium ignore:.*PyDevIPCompleter6.*:DeprecationWarning + # ignore numpy log(0) warnings (np.log(0) = -inf) + ignore:divide by zero encountered in log:RuntimeWarning norecursedirs = .git amici_models build doc documentation matlab models ThirdParty amici sdist examples From 44ed074f1870259ee091d9e275118707bbb24aff Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Wed, 15 May 2024 18:33:32 +0200 Subject: [PATCH 10/13] PEtab: fix missing parameters in fill_in_parameters (#2449) Allows providing only a subset of parameter to simulate_petab. The missing parameters are taken from nominalValues in the parameter table. Fixes https://github.com/AMICI-dev/AMICI/issues/2444. Nevertheless, exclude `Lang_PLOSComputBiol2024` to save time. --- python/sdist/amici/petab/simulations.py | 45 ++++++++++--------- .../benchmark-models/test_petab_benchmark.py | 1 + 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/python/sdist/amici/petab/simulations.py b/python/sdist/amici/petab/simulations.py index e80e40a94b..2cbed98dce 100644 --- a/python/sdist/amici/petab/simulations.py +++ b/python/sdist/amici/petab/simulations.py @@ -166,30 +166,33 @@ def simulate_petab( amici_model=amici_model, ) + if problem_parameters is not None and not scaled_parameters: + problem_parameters = petab_problem.scale_parameters(problem_parameters) + scaled_parameters = True + if problem_parameters is None: - # scaled PEtab nominal values - problem_parameters = dict( - zip( - petab_problem.x_ids, - petab_problem.x_nominal_scaled, - strict=True, - ) + problem_parameters = {} + + # scaled PEtab nominal values + default_problem_parameters = dict( + zip( + petab_problem.x_ids, + petab_problem.get_x_nominal(scaled=scaled_parameters), + strict=True, ) - # depending on `fill_fixed_parameters` for parameter mapping, the - # parameter mapping may contain values instead of symbols for fixed - # parameters. In this case, we need to filter them here to avoid - # warnings in `fill_in_parameters`. - free_parameters = parameter_mapping.free_symbols - problem_parameters = { - par_id: par_value - for par_id, par_value in problem_parameters.items() - if par_id in free_parameters - } - - elif not scaled_parameters: - problem_parameters = petab_problem.scale_parameters(problem_parameters) + ) + # depending on `fill_fixed_parameters` for parameter mapping, the + # parameter mapping may contain values instead of symbols for fixed + # parameters. In this case, we need to filter them here to avoid + # warnings in `fill_in_parameters`. + free_parameters = parameter_mapping.free_symbols + default_problem_parameters = { + par_id: par_value + for par_id, par_value in default_problem_parameters.items() + if par_id in free_parameters + } - scaled_parameters = True + problem_parameters = default_problem_parameters | problem_parameters # Get edatas if edatas is None: diff --git a/tests/benchmark-models/test_petab_benchmark.py b/tests/benchmark-models/test_petab_benchmark.py index 976ff3dc05..47bf503984 100644 --- a/tests/benchmark-models/test_petab_benchmark.py +++ b/tests/benchmark-models/test_petab_benchmark.py @@ -36,6 +36,7 @@ "Isensee_JCB2018", "Beer_MolBioSystems2014", "Alkan_SciSignal2018", + "Lang_PLOSComputBiol2024", # excluded due to excessive numerical failures "Crauste_CellSystems2017", "Fujita_SciSignal2010", From 59256b4b9b9ad36b92f6006aad17d2ee744e8b87 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Thu, 16 May 2024 10:53:39 +0200 Subject: [PATCH 11/13] CMake: Fix MKL detection when not using environment modules (#2443) If MKLROOT is set (e.g., `source /opt/intel/oneapi/setvars.sh` will do that), first try FindBLAS instead of just relying on MKL_INCDIR and MKL_LIB. Fixes #2441. --- CMakeLists.txt | 2 +- cmake/AmiciFindBLAS.cmake | 51 ++++++++++++++++++++++++------------- cmake/cmakelang-tools.cmake | 2 ++ swig/CMakeLists.txt | 5 +++- 4 files changed, 41 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d8a1109d90..81cc70c9d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -135,7 +135,7 @@ endif() set(VENDORED_SUNDIALS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ThirdParty/sundials) set(SUNDIALS_PRIVATE_INCLUDE_DIRS "${VENDORED_SUNDIALS_DIR}/src") # Handle different sundials build/install dirs, depending on whether we are -# building the Python extension only or the full C++ interface +# building the Python extension only or the full C++ interface if(AMICI_PYTHON_BUILD_EXT_ONLY) set(VENDORED_SUNDIALS_BUILD_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(VENDORED_SUNDIALS_INSTALL_DIR ${VENDORED_SUNDIALS_BUILD_DIR}) diff --git a/cmake/AmiciFindBLAS.cmake b/cmake/AmiciFindBLAS.cmake index 51d9c9b257..e0553b81c5 100644 --- a/cmake/AmiciFindBLAS.cmake +++ b/cmake/AmiciFindBLAS.cmake @@ -12,18 +12,33 @@ set_property(CACHE BLAS PROPERTY STRINGS "CBLAS" "MKL" "ACCELERATE") if(${BLAS} STREQUAL "MKL" OR DEFINED ENV{MKLROOT}) if(DEFINED ENV{MKLROOT}) - # This is set by Environment Modules - message(STATUS "Using MKL_INCDIR and MKL_LIB from environment module") set(BLAS "MKL" CACHE STRING "BLAS library to use" FORCE) - set(BLAS_INCLUDE_DIRS - "$ENV{MKL_INCDIR}" - CACHE STRING "" FORCE) - set(BLAS_LIBRARIES - "$ENV{MKL_LIB}" - CACHE STRING "" FORCE) + + # Was MKLROOT set by /opt/intel/oneapi/setvars.sh? then cmake will find it + message(STATUS "Trying to find BLAS based on MKLROOT=$ENV{MKLROOT}") + # give the user the option to override the BLA_VENDOR + if(NOT DEFINED BLA_VENDOR) + set(BLA_VENDOR Intel10_64lp) + endif() + message(STATUS "Trying FindBLAS with BLA_VENDOR=${BLA_VENDOR}") + find_package(BLAS) + if(BLAS_FOUND) + message(STATUS "Found BLAS via FindBLAS and MKLROOT") + else() + # This is set by Environment Modules and might not be compatible with + # FindBLAS + message(STATUS "Using MKL_INCDIR and MKL_LIB from environment module") + set(BLAS_INCLUDE_DIRS + "$ENV{MKL_INCDIR}" + CACHE STRING "" FORCE) + set(BLAS_LIBRARIES + "$ENV{MKL_LIB}" + CACHE STRING "" FORCE) + endif() else() + message(STATUS "BLAS is set to MKL, but MKLROOT is not set.") set(BLAS_INCLUDE_DIRS "" CACHE STRING "") @@ -42,6 +57,7 @@ elseif( if(APPLE AND (NOT DEFINED BLA_VENDOR OR BLA_VENDOR STREQUAL "All")) set(BLA_VENDOR Apple) + message(STATUS "Trying FindBLAS with BLA_VENDOR=${BLA_VENDOR}") find_package(BLAS) if(BLAS_FOUND) message(STATUS "Found Apple Accelerate BLAS") @@ -59,6 +75,7 @@ elseif( endif() if(NOT BLAS_FOUND) + message(STATUS "Trying FindBLAS with BLA_VENDOR=${BLA_VENDOR}") find_package(BLAS) if(BLAS_FOUND) message(STATUS "Found BLAS via FindBLAS") @@ -79,17 +96,17 @@ endif() # Create an imported target if(NOT TARGET BLAS::BLAS) add_library(BLAS INTERFACE) - set_target_properties(BLAS PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${BLAS_INCLUDE_DIRS}" - INTERFACE_LINK_LIBRARIES "${BLAS_LIBRARIES}") + set_target_properties( + BLAS PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${BLAS_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${BLAS_LIBRARIES}") add_library(BLAS::BLAS ALIAS BLAS) if("${PROJECT_NAME}" STREQUAL "amici") - install(TARGETS BLAS EXPORT BLAS) - export(EXPORT BLAS NAMESPACE BLAS::) - install( - EXPORT BLAS - DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Amici" - NAMESPACE BLAS::) + install(TARGETS BLAS EXPORT BLAS) + export(EXPORT BLAS NAMESPACE BLAS::) + install( + EXPORT BLAS + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Amici" + NAMESPACE BLAS::) endif() # legacy python package environment variables: diff --git a/cmake/cmakelang-tools.cmake b/cmake/cmakelang-tools.cmake index ad489500bc..5796938d2c 100644 --- a/cmake/cmakelang-tools.cmake +++ b/cmake/cmakelang-tools.cmake @@ -9,7 +9,9 @@ set(ALL_CMAKE_FILES tests/cpp/unittests/CMakeLists.txt ${CMAKE_MODULE_PATH}/cmakelang-tools.cmake ${CMAKE_MODULE_PATH}/clang-tools.cmake + ${CMAKE_MODULE_PATH}/AmiciFindBLAS.cmake ${CMAKE_MODULE_PATH}/version.cmake) + list(JOIN ALL_CMAKE_FILES " " ALL_CMAKE_FILES) # --- cmake-format --- diff --git a/swig/CMakeLists.txt b/swig/CMakeLists.txt index 7b7baf9be9..5cc6e6b5a2 100644 --- a/swig/CMakeLists.txt +++ b/swig/CMakeLists.txt @@ -20,7 +20,10 @@ find_package( Python3 COMPONENTS Interpreter Development NumPy REQUIRED) -message(STATUS "Found numpy ${Python3_NumPy_VERSION} include dir ${Python3_NumPy_INCLUDE_DIRS}") +message( + STATUS + "Found numpy ${Python3_NumPy_VERSION} include dir ${Python3_NumPy_INCLUDE_DIRS}" +) set(AMICI_INTERFACE_LIST ${CMAKE_CURRENT_SOURCE_DIR}/amici.i ${CMAKE_CURRENT_SOURCE_DIR}/edata.i From 7f7be0f4636eb32267e855b770e8aa2474e1f306 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Thu, 16 May 2024 12:55:33 +0200 Subject: [PATCH 12/13] Specify cmake build types and require cmake-build-extension==0.6.0 (#2445) * Require https://github.com/diegoferigo/cmake-build-extension/releases/tag/v0.6.0 * Specify cmake build types properly Closes #2447 Closes #2442 --- CMakeLists.txt | 1 - python/sdist/amici/setup.template.py | 6 ++++++ python/sdist/pyproject.toml | 4 ++-- python/sdist/setup.py | 5 +++++ python/tests/test_misc.py | 5 +++-- scripts/buildAmici.sh | 3 ++- scripts/installAmiciSource.sh | 2 +- src/CMakeLists.template.cmake | 5 ++++- 8 files changed, 23 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 81cc70c9d0..4b0c95321b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,7 +90,6 @@ if("$ENV{ENABLE_AMICI_DEBUGGING}" OR "$ENV{ENABLE_GCOV_COVERAGE}") else() add_compile_options(-O0 -g) endif() - set(CMAKE_BUILD_TYPE "Debug") endif() # coverage options diff --git a/python/sdist/amici/setup.template.py b/python/sdist/amici/setup.template.py index 80fd3fde2a..14edbfd2d4 100644 --- a/python/sdist/amici/setup.template.py +++ b/python/sdist/amici/setup.template.py @@ -24,6 +24,11 @@ def get_extension() -> CMakeExtension: else: os.environ["CMAKE_BUILD_PARALLEL_LEVEL"] = "1" + debug_build = os.getenv("ENABLE_AMICI_DEBUGGING", "").lower() in [ + "1", + "true", + ] or os.getenv("ENABLE_GCOV_COVERAGE", "").lower() in ["1", "true"] + return CMakeExtension( name="model_ext", source_dir=os.getcwd(), @@ -37,6 +42,7 @@ def get_extension() -> CMakeExtension: "-DAMICI_PYTHON_BUILD_EXT_ONLY=ON", f"-DPython3_EXECUTABLE={Path(sys.executable).as_posix()}", ], + cmake_build_type="Debug" if debug_build else "Release", ) diff --git a/python/sdist/pyproject.toml b/python/sdist/pyproject.toml index 10a3b05374..905e564cf4 100644 --- a/python/sdist/pyproject.toml +++ b/python/sdist/pyproject.toml @@ -11,7 +11,7 @@ requires = [ # cf. discussion at https://github.com/numpy/numpy/issues/5888 # (https://github.com/scipy/oldest-supported-numpy/) "oldest-supported-numpy", - "cmake-build-extension==0.5.1", + "cmake-build-extension==0.6.0", ] build-backend = "setuptools.build_meta" @@ -21,7 +21,7 @@ dynamic = ["version"] description = "Advanced multi-language Interface to CVODES and IDAS" requires-python = ">=3.10" dependencies = [ - "cmake-build-extension==0.5.1", + "cmake-build-extension==0.6.0", "sympy>=1.9", "numpy>=1.19.3; python_version=='3.9'", "numpy>=1.21.4; python_version>='3.10'", diff --git a/python/sdist/setup.py b/python/sdist/setup.py index 83bf33237a..9dd268953a 100755 --- a/python/sdist/setup.py +++ b/python/sdist/setup.py @@ -141,6 +141,10 @@ def get_extensions(): ], ) # AMICI + debug_build = os.getenv("ENABLE_AMICI_DEBUGGING", "").lower() in [ + "1", + "true", + ] or os.getenv("ENABLE_GCOV_COVERAGE", "").lower() in ["1", "true"] amici_ext = CMakeExtension( name="amici", install_prefix="amici", @@ -153,6 +157,7 @@ def get_extensions(): "-DAMICI_PYTHON_BUILD_EXT_ONLY=ON", f"-DPython3_EXECUTABLE={Path(sys.executable).as_posix()}", ], + cmake_build_type="Debug" if debug_build else "Release", ) # Order matters! return [suitesparse_config, amd, btf, colamd, klu, sundials, amici_ext] diff --git a/python/tests/test_misc.py b/python/tests/test_misc.py index b68e96f1a0..80e1afaa03 100644 --- a/python/tests/test_misc.py +++ b/python/tests/test_misc.py @@ -65,8 +65,9 @@ def test_cmake_compilation(sbml_example_presimulation_module): amici_dir = (Path(__file__).parents[2] / "build").absolute() cmd = ( f"set -e; " - f"cmake -S {source_dir} -B '{build_dir}' -DAmici_DIR={amici_dir}; " - f"cmake --build '{build_dir}'" + f"cmake -S {source_dir} -B '{build_dir}' " + f"-DCMAKE_BUILD_TYPE=Debug -DAmici_DIR={amici_dir}; " + f"cmake --build '{build_dir}' --config Debug" ) try: diff --git a/scripts/buildAmici.sh b/scripts/buildAmici.sh index 80b724c8c3..cb2428579c 100755 --- a/scripts/buildAmici.sh +++ b/scripts/buildAmici.sh @@ -14,7 +14,8 @@ mkdir -p "${amici_build_dir}" cd "${amici_build_dir}" if [ "${GITHUB_ACTIONS:-}" = true ] || - [ "${ENABLE_AMICI_DEBUGGING:-}" = TRUE ]; then + [ "${ENABLE_AMICI_DEBUGGING:-}" = TRUE ] || + [ "${ENABLE_GCOV_COVERAGE:-}" = TRUE ]; then # Running on CI server build_type="Debug" # exceptions instead of terminate() diff --git a/scripts/installAmiciSource.sh b/scripts/installAmiciSource.sh index 514926773f..1c0a975708 100755 --- a/scripts/installAmiciSource.sh +++ b/scripts/installAmiciSource.sh @@ -33,7 +33,7 @@ fi export PYTHON_EXECUTABLE="${AMICI_PATH}/venv/bin/python" python -m pip install --upgrade pip wheel -python -m pip install --upgrade pip setuptools cmake_build_extension==0.5.1 numpy +python -m pip install --upgrade pip setuptools cmake_build_extension==0.6.0 numpy python -m pip install git+https://github.com/FFroehlich/pysb@fix_pattern_matching # pin to PR for SPM with compartments AMICI_BUILD_TEMP="${AMICI_PATH}/python/sdist/build/temp" \ python -m pip install --verbose -e "${AMICI_PATH}/python/sdist[petab,test,vis]" --no-build-isolation diff --git a/src/CMakeLists.template.cmake b/src/CMakeLists.template.cmake index ee50a551e8..dbad3e146c 100644 --- a/src/CMakeLists.template.cmake +++ b/src/CMakeLists.template.cmake @@ -38,6 +38,10 @@ endif() find_package(Amici TPL_AMICI_VERSION REQUIRED HINTS ${CMAKE_CURRENT_LIST_DIR}/../../build) message(STATUS "Found AMICI ${Amici_DIR}") +set_target_properties(Upstream::amici PROPERTIES + MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo;Release; + MAP_IMPORTED_CONFIG_RELEASE Release + MAP_IMPORTED_CONFIG_DEBUG Debug;RelWithDebInfo;) # Debug build? if("$ENV{ENABLE_AMICI_DEBUGGING}" OR "$ENV{ENABLE_GCOV_COVERAGE}") @@ -47,7 +51,6 @@ if("$ENV{ENABLE_AMICI_DEBUGGING}" OR "$ENV{ENABLE_GCOV_COVERAGE}") else() add_compile_options(-O0 -g) endif() - set(CMAKE_BUILD_TYPE "Debug") endif() # coverage options From d9b447731960dea8ce69858f295a348b1e19d375 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Thu, 16 May 2024 13:02:06 +0200 Subject: [PATCH 13/13] Bump version, update release notes --- CHANGELOG.md | 16 ++++++++++++++++ version.txt | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc831f49c7..f4eed1f392 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,22 @@ ## v0.X Series +### v0.25.1 (2024-05-16) + +**Fixes** +* Avoid clashes with sympy-entities in `plot_expressions` + by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2440 +* PEtab: fix KeyErrors for missing parameters in `fill_in_parameters` + (default values are now used if only a subset of parameters is provided) + by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2449 +* CMake: Fix Intel MKL detection when not using environment modules + by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2443 +* CMake: Fix some issues with multi-config generators + by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2445 + +**Full Changelog**: https://github.com/AMICI-dev/AMICI/compare/v0.25.0...v0.25.1 + + ### v0.25.0 (2024-05-08) This release requires Python >= 3.10. diff --git a/version.txt b/version.txt index d21d277be5..af2dabf3ff 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.25.0 +0.25.1