Skip to content

Commit

Permalink
Merge branch 'develop' into fix_reservedsyms
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl authored Oct 7, 2024
2 parents 3d7a0ca + cd56633 commit 5612d27
Show file tree
Hide file tree
Showing 379 changed files with 46,265 additions and 35,814 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/deploy_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ jobs:

- run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV

- name: Remove direct dependencies from setup.cfg
# Remove any "git+https"-based dependencies that are not supported
# by PyPI and are only required for testing.
run: sed -i '/git+https/d' python/sdist/pyproject.toml

- name: sdist
run: scripts/buildSdist.sh

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test_benchmark_collection_models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,14 @@ jobs:
run: |
git clone --depth 1 https://github.com/benchmarking-initiative/Benchmark-Models-PEtab.git \
&& export BENCHMARK_COLLECTION="$(pwd)/Benchmark-Models-PEtab/Benchmark-Models/" \
&& pip3 install -e $BENCHMARK_COLLECTION/../src/python \
&& AMICI_PARALLEL_COMPILE="" tests/benchmark-models/test_benchmark_collection.sh
# run gradient checks
- name: Run Gradient Checks
run: |
pip install git+https://github.com/ICB-DCM/fiddy.git \
&& cd tests/benchmark-models && pytest ./test_petab_benchmark.py
&& cd tests/benchmark-models && pytest --durations=10 ./test_petab_benchmark.py
# upload results
- uses: actions/upload-artifact@v4
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/test_petab_test_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
build:
name: PEtab Testsuite

runs-on: ubuntu-22.04
runs-on: ubuntu-latest

env:
ENABLE_GCOV_COVERAGE: TRUE
Expand Down Expand Up @@ -68,6 +68,12 @@ jobs:
&& source ./venv/bin/activate \
&& cd petab_test_suite && pip3 install -e .
- name: Install PEtab benchmark collection
run: |
git clone --depth 1 https://github.com/benchmarking-initiative/Benchmark-Models-PEtab.git \
&& export BENCHMARK_COLLECTION="$(pwd)/Benchmark-Models-PEtab/Benchmark-Models/" \
&& source venv/bin/activate && python -m pip install -e $BENCHMARK_COLLECTION/../src/python
- name: Install petab
run: |
source ./venv/bin/activate \
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/test_python_cplusplus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Cache
uses: actions/cache@v4
with:
path: |
~/.cache/pooch
key: ${{ runner.os }}-py${{ matrix.python-version }}-${{ github.job }}

- uses: actions/checkout@v4
- run: git fetch --prune --unshallow

Expand Down Expand Up @@ -201,6 +208,13 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Cache
uses: actions/cache@v4
with:
path: |
~/.cache/pooch
key: ${{ runner.os }}-py${{ matrix.python-version }}-${{ github.job }}

- uses: actions/checkout@v4
- run: git fetch --prune --unshallow

Expand Down Expand Up @@ -259,6 +273,17 @@ jobs:
- name: C++ tests
run: scripts/run-cpp-tests.sh

- name: Get Pooch Cache Directory
id: get-pooch-cache
run: |
echo "pooch-cache=$(source venv/bin/activate && python -c 'import pooch; print(pooch.os_cache("pooch"))')" >> $GITHUB_ENV
- name: Cache Pooch Directory
uses: actions/cache@v4
with:
path: ${{ env.pooch-cache }}
key: ${{ runner.os }}-py${{ matrix.python-version }}-${{ github.job }}

- name: Python tests
run: |
scripts/run-python-tests.sh \
Expand Down Expand Up @@ -301,6 +326,24 @@ jobs:
- name: Get BioNetGen
run: scripts/buildBNGL.sh


- name: Get Pooch Cache Directory
id: get-pooch-cache
run: |
echo "pooch-cache=$(source venv/bin/activate && python -c 'import pooch; print(pooch.os_cache("pooch"))')" >> $GITHUB_ENV
- name: Cache Pooch Directory
uses: actions/cache@v4
with:
path: ${{ env.pooch-cache }}
key: ${{ runner.os }}-py${{ matrix.python-version }}-${{ github.job }}

- name: Install PEtab benchmark collection
run: |
git clone --depth 1 https://github.com/benchmarking-initiative/Benchmark-Models-PEtab.git \
&& export BENCHMARK_COLLECTION="$(pwd)/Benchmark-Models-PEtab/Benchmark-Models/" \
&& source venv/bin/activate && python -m pip install -e $BENCHMARK_COLLECTION/../src/python
- name: Python tests
run: |
scripts/run-python-tests.sh \
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/test_python_ver_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@ jobs:
- run: source venv/bin/activate && pip3 install "sympy>=1.12.1"
if: matrix.python-version != '3.12'

- name: Get Pooch Cache Directory
id: get-pooch-cache
run: |
echo "pooch-cache=$(source venv/bin/activate && python -c 'import pooch; print(pooch.os_cache("pooch"))')" >> $GITHUB_ENV
- name: Cache Pooch Directory
uses: actions/cache@v4
with:
path: ${{ env.pooch-cache }}
key: ${{ runner.os }}-py${{ matrix.python-version }}-${{ github.job }}

- name: Python tests
run: |
source venv/bin/activate \
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/test_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,18 @@ jobs:

- run: python -m amici

- name: Get Pooch Cache Directory
id: get-pooch-cache
run: |
echo "pooch-cache=$(python -c 'import pooch; print(pooch.os_cache("pooch"))')" >> $GITHUB_ENV
shell: bash

- name: Cache Pooch Directory
uses: actions/cache@v4
with:
path: ${{ env.pooch-cache }}
key: ${{ runner.os }}-py${{ matrix.python-version }}-${{ github.job }}

- name: Run Python tests
shell: bash
run: |
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ ThirdParty/sundials/build/*
ThirdParty/SuiteSparse/lib/*
ThirdParty/SuiteSparse/include/
ThirdParty/SuiteSparse/share/*
ThirdParty/SuiteSparse/install/*
ThirdParty/SuperLU_MT_3.1/
ThirdParty/superlu_mt_3.1.tar.gz
ThirdParty/swig-*
Expand All @@ -203,3 +204,4 @@ cache_fiddy/*
debug/*
tests/benchmark-models/cache_fiddy/*
venv/*
.coverage
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repos:
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.4.1
rev: v0.6.7
hooks:
# Run the linter.
- id: ruff
Expand All @@ -28,7 +28,7 @@ repos:
- python/sdist/pyproject.toml

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
rev: v3.17.0
hooks:
- id: pyupgrade
args: ["--py310-plus"]
Expand Down
64 changes: 64 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,70 @@ See also our [versioning policy](https://amici.readthedocs.io/en/latest/versioni

## v0.X Series


### v0.26.3 (2024-10-03)

**Fixes**

* Skip building SuiteSparse shared libraries and build all subprojects together
for slightly faster package installation

by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2514
and https://github.com/AMICI-dev/AMICI/pull/2519

* Got rid of petab `DeprecationWarnings` when using the `amici_import_petab`
CLI

by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2517

* Now also sundials and suitesparse are built in debug mode when installing
with `ENABLE_AMICI_DEBUGGING=TRUE`

by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2515

**Full Changelog**: https://github.com/AMICI-dev/AMICI/compare/v0.26.2...v0.26.3

### v0.26.2 (2024-09-25)

**Fixes**

* Fixed a sympy float comparison issue in spline code that would cause
an `AssertionError`

by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2499

* Fixed some warnings from recent CMake versions

by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2492

* Fixed a potential issue when including AMICI in a CMake project

by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2493

**Full Changelog**: https://github.com/AMICI-dev/AMICI/compare/v0.26.1...v0.26.2


### v0.26.1 (2024-07-11)

**Fixes**

* Fixed some C++ exception handling that previously could crash Python under
certain conditions

by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2484

* Disabled turning warnings into errors when building amici on GitHub Actions
in downstream projects

by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2481

* Fixed CMP0167 warning with CMake 3.30

by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2480


**Full Changelog**: https://github.com/AMICI-dev/AMICI/compare/v0.26.0...v0.26.1

### v0.26.0 (2024-07-02)

AMICI v0.26.0 requires sympy>=1.12.1 and petab>=0.4.0.
Expand Down
47 changes: 23 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
#
# Build AMICI library
#
cmake_minimum_required(VERSION 3.15)
cmake_policy(VERSION 3.15...3.27)

# cmake >=3.27
if(POLICY CMP0144)
cmake_policy(SET CMP0144 NEW)
endif(POLICY CMP0144)
# cmake >= 3.30
if(POLICY CMP0167)
cmake_policy(SET CMP0167 NEW)
endif(POLICY CMP0167)
cmake_minimum_required(VERSION 3.22)
# When updating the policy version, please also update it in
# src/CMakeLists.template.cmake
cmake_policy(VERSION 3.22...3.30)

project(amici)

Expand All @@ -36,10 +29,11 @@ message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# require at least gcc 4.9, otherwise regex wont work properly
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
message(FATAL_ERROR "GCC version must be at least 4.9!")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}"
STREQUAL "MINGW")
# require at least gcc 9.1 for proper C+17 support, e.g. std::reduce
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.1)
message(FATAL_ERROR "GCC version must be at least 9.1!")
endif()
endif()

Expand Down Expand Up @@ -136,7 +130,8 @@ elseif(AMICI_TRY_ENABLE_HDF5)
endif()

set(VENDORED_SUNDIALS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ThirdParty/sundials)
set(SUNDIALS_PRIVATE_INCLUDE_DIRS "${VENDORED_SUNDIALS_DIR}/src")
set(SUNDIALS_PRIVATE_INCLUDE_DIRS
"${VENDORED_SUNDIALS_DIR}/src;${VENDORED_SUNDIALS_DIR}/src/sundials")
# Handle different sundials build/install dirs, depending on whether we are
# building the Python extension only or the full C++ interface
if(AMICI_PYTHON_BUILD_EXT_ONLY)
Expand All @@ -147,8 +142,7 @@ else()
set(VENDORED_SUNDIALS_INSTALL_DIR ${VENDORED_SUNDIALS_BUILD_DIR})
endif()
set(SUNDIALS_ROOT "${VENDORED_SUNDIALS_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}")
find_package(
SUNDIALS REQUIRED CONFIG PATHS "${SUNDIALS_ROOT}/cmake/sundials/")
find_package(SUNDIALS REQUIRED CONFIG PATHS "${SUNDIALS_ROOT}/cmake/sundials/")
message(STATUS "Found SUNDIALS: ${SUNDIALS_DIR}")

set(GSL_LITE_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ThirdParty/gsl")
Expand Down Expand Up @@ -231,7 +225,14 @@ set(AMICI_CXX_OPTIONS
""
CACHE STRING "C++ options for libamici (semicolon-separated)")
target_compile_options(${PROJECT_NAME} PRIVATE "${AMICI_CXX_OPTIONS}")

set_property(
SOURCE src/solver_cvodes.cpp
APPEND
PROPERTY INCLUDE_DIRECTORIES "${SUNDIALS_PRIVATE_INCLUDE_DIRS}")
set_property(
SOURCE src/solver_idas.cpp
APPEND
PROPERTY INCLUDE_DIRECTORIES "${SUNDIALS_PRIVATE_INCLUDE_DIRS}")
add_dependencies(${PROJECT_NAME} version)

file(GLOB PUBLIC_HEADERS include/amici/*.h)
Expand All @@ -244,8 +245,7 @@ target_include_directories(
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
$<BUILD_INTERFACE:${GSL_LITE_INCLUDE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_DATADIR}/amici/swig>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/swig>
PRIVATE ${SUNDIALS_PRIVATE_INCLUDE_DIRS})
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/swig>)

if("$ENV{ENABLE_AMICI_DEBUGGING}"
OR "$ENV{ENABLE_GCOV_COVERAGE}"
Expand All @@ -265,8 +265,7 @@ target_compile_definitions(

target_link_libraries(
${PROJECT_NAME}
PUBLIC SUNDIALS::generic_static
SUNDIALS::nvecserial_static
PUBLIC SUNDIALS::nvecserial_static
SUNDIALS::sunmatrixband_static
SUNDIALS::sunmatrixdense_static
SUNDIALS::sunmatrixsparse_static
Expand Down Expand Up @@ -377,7 +376,7 @@ export(
include(CMakePackageConfigHelpers)
include(version)
configure_package_config_file(
cmake/AmiciConfig.cmake "${CMAKE_CURRENT_BINARY_DIR}/AmiciConfig.cmake"
"cmake/AmiciConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/AmiciConfig.cmake"
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Amici")
write_basic_package_version_file(AmiciConfigVersion.cmake
COMPATIBILITY ExactVersion)
Expand Down
Loading

0 comments on commit 5612d27

Please sign in to comment.