Skip to content

Commit

Permalink
Release 0.23.0
Browse files Browse the repository at this point in the history
Merge pull request #2372 from dweindl/release_0.23.0
  • Loading branch information
dweindl authored Mar 7, 2024
2 parents 7a06016 + 59d1d9f commit 815a50d
Show file tree
Hide file tree
Showing 209 changed files with 13,784 additions and 8,681 deletions.
3 changes: 3 additions & 0 deletions .github/actions/setup-amici-cpp/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ runs:
- run: echo "ENABLE_GCOV_COVERAGE=TRUE" >> $GITHUB_ENV
shell: bash

- run: echo "PYTHONFAULTHANDLER=1" >> $GITHUB_ENV
shell: bash

- name: Set up Sonar tools
uses: ./.github/actions/setup-sonar-tools

Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/deploy_protected.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,25 @@ on:
workflow_dispatch:

jobs:
check-secret:
runs-on: ubuntu-latest
outputs:
secrets-defined: ${{ steps.secret-check.outputs.defined }}
steps:
- name: Check for Secret availability
id: secret-check
shell: bash
run: |
if [ "${{ secrets.DOCKER_USERNAME }}" != '' ]; then
echo "defined=true" >> $GITHUB_OUTPUT;
else
echo "defined=false" >> $GITHUB_OUTPUT;
fi
dockerhub:
name: Deploy Dockerhub
if: github.event.pull_request.head.repo.fork == false
needs: [check-secret]
if: needs.check-secret.outputs.secrets-defined == 'true'
runs-on: ubuntu-22.04

strategy:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test_petab_test_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,27 +57,27 @@ jobs:

- name: Install petab
run: |
source ./build/venv/bin/activate \
source ./venv/bin/activate \
&& pip3 install wheel pytest shyaml pytest-cov pysb
# retrieve test models
- name: Download and install PEtab test suite
run: |
git clone --depth 1 --branch main \
https://github.com/PEtab-dev/petab_test_suite \
&& source ./build/venv/bin/activate \
&& source ./venv/bin/activate \
&& cd petab_test_suite && pip3 install -e .
- name: Run PEtab-related unit tests
run: |
source ./build/venv/bin/activate \
source ./venv/bin/activate \
&& pytest --cov-report=xml:coverage.xml \
--cov=./ python/tests/test_*petab*.py python/tests/petab/
# run test models
- name: Run PEtab test suite
run: |
source ./build/venv/bin/activate \
source ./venv/bin/activate \
&& AMICI_PARALLEL_COMPILE="" pytest -v \
--cov-report=xml:coverage.xml \
--cov-append \
Expand Down
28 changes: 21 additions & 7 deletions .github/workflows/test_python_cplusplus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ jobs:
python-version: [ "3.9" ]

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

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand All @@ -38,11 +45,11 @@ jobs:
run: scripts/installAmiciSource.sh

- name: Check OpenMP support
run: source build/venv/bin/activate && python -c "import amici; import sys; sys.exit(not amici.compiledWithOpenMP())"
run: source venv/bin/activate && python -c "import amici; import sys; sys.exit(not amici.compiledWithOpenMP())"

- name: Python tests (part 1)
run: |
source build/venv/bin/activate \
source venv/bin/activate \
&& pytest \
--ignore-glob=*petab* \
--ignore-glob=*test_splines.py \
Expand All @@ -57,7 +64,7 @@ jobs:
- name: Python tests splines
if: ${{ github.base_ref == 'master' || github.event.merge_group.base_ref == 'master'}}
run: |
source build/venv/bin/activate \
source venv/bin/activate \
&& pytest \
--cov=amici \
--cov-report=xml:"${AMICI_DIR}/build/coverage_py.xml" \
Expand Down Expand Up @@ -131,7 +138,7 @@ jobs:

- name: Python tests
run: |
source build/venv/bin/activate \
source venv/bin/activate \
&& pytest \
--cov=amici \
--cov-report=xml:"${AMICI_DIR}/build/coverage_py.xml" \
Expand Down Expand Up @@ -207,7 +214,7 @@ jobs:

- name: Install notebook dependencies
run: |
source build/venv/bin/activate \
source venv/bin/activate \
&& pip install jax[cpu]
- name: example notebooks
Expand Down Expand Up @@ -244,7 +251,7 @@ jobs:
run: scripts/installAmiciSource.sh

- name: Check OpenMP support
run: source build/venv/bin/activate && python -c "import amici; import sys; sys.exit(not amici.compiledWithOpenMP())"
run: source venv/bin/activate && python -c "import amici; import sys; sys.exit(not amici.compiledWithOpenMP())"

- name: cppcheck
run: scripts/run-cppcheck.sh
Expand All @@ -265,6 +272,13 @@ jobs:
runs-on: macos-latest

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

- name: Set up Python
uses: actions/setup-python@v5
with:
Expand All @@ -282,7 +296,7 @@ jobs:
scripts/installAmiciSource.sh
- name: Check OpenMP support
run: source build/venv/bin/activate && python -c "import amici; import sys; sys.exit(not amici.compiledWithOpenMP())"
run: source venv/bin/activate && python -c "import amici; import sys; sys.exit(not amici.compiledWithOpenMP())"

- name: Get BioNetGen
run: scripts/buildBNGL.sh
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/test_python_ver_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,16 @@ jobs:
- name: Install python package
run: scripts/installAmiciSource.sh

# until https://github.com/dateutil/dateutil >2.8.2 is released https://github.com/dateutil/dateutil/issues/1314
- run: source build/venv/bin/activate && pip3 install git+https://github.com/dateutil/dateutil.git@296d419fe6bf3b22897f8f210735ac9c4e1cb796
if: matrix.python-version == '3.12'

# install pysb before sympy to allow for sympy>=1.12 (https://github.com/pysb/pysb/commit/e83937cb8c74afc9b2fa96595b68464946745f33)
- run: source build/venv/bin/activate && pip3 install git+https://github.com/pysb/pysb
- run: source venv/bin/activate && pip3 install git+https://github.com/pysb/pysb

# until sympy>1.12 is released
- run: source build/venv/bin/activate && pip3 install git+https://github.com/sympy/sympy.git@master
- run: source venv/bin/activate && pip3 install git+https://github.com/sympy/sympy.git@master
if: matrix.python-version == '3.12'

- name: Python tests
run: |
source build/venv/bin/activate \
source venv/bin/activate \
&& python3 -m pytest \
--durations=10 \
--ignore-glob=*petab* \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_sbml_semantic_test_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
paths:
- .github/workflows/test_sbml_semantic_test_suite.yml
- python/sdist/amici/de_export.py
- python/sdist/amici/de_model.py
- python/sdist/amici/de_model_components.py
- python/sdist/amici/sbml_import.py
- python/sdist/amici/import_utils.py
- scripts/run-SBMLTestsuite.sh
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,4 @@ CS_Signalling_ERBB_RAS_AKT/
cache_fiddy/*
debug/*
tests/benchmark-models/cache_fiddy/*
venv/*
70 changes: 70 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,76 @@

## v0.X Series

### v0.23.0 (2024-03-07)

**Features**

* SBML `InitialAssignment` are no longer absorbed into other model expressions,
but are available as parameters or expressions (`w`) in the amici model
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2304,
https://github.com/AMICI-dev/AMICI/pull/2305,
https://github.com/AMICI-dev/AMICI/pull/2345,
https://github.com/AMICI-dev/AMICI/pull/2359
* Upgraded to SuiteSparse 7.6
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2316
* Model expressions `w` are now split into static and dynamic expressions,
and only evaluated as needed
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2303
* Exposed additional solver settings:
* `Solver.setMaxConvFails()`: maximum number of non-linear solver
convergence failures
* `Solver.setMaxNonlinIters()`: maximum number of non-linear solver
iterations
* `Solver.setMaxStepSize()`: maximum step size
* `Solver.setConstraints()`: for setting (non)negativity/positivity
constraints on state variables

by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2335,
https://github.com/AMICI-dev/AMICI/pull/2360,
https://github.com/AMICI-dev/AMICI/pull/2340
* Improved output for debugging simulation failures:
`ReturnData.{xdot,J}` now contain the respective
values from the timepoint of failure, not the last output timepoint.
NaN/Inf warnings now always include the timepoint at which the issue
occurred. Note that C++ stacktraces are now only logged for debug builds.
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2349,
https://github.com/AMICI-dev/AMICI/pull/2347,
https://github.com/AMICI-dev/AMICI/pull/2366
* Updated dataframes import/export to include parameter values and scales
by @FFroehlich in https://github.com/AMICI-dev/AMICI/pull/2351

**Fixes**

* CMake: Updated BLAS detection and some minor fixes
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2318
and https://github.com/AMICI-dev/AMICI/pull/2357
* Deterministic ordering of source files in generated `CMakeLists.txt`
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2322
* Fixed size check in `Model::setStateIsNonNegative`
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2332
* Fixed uncaught C++ exception in `runAmiciSimulation` that may crash Python
in case of invalid values for standard deviations
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2338
* Fixed missing import in `amici/petab/petab_import.py`
by @plakrisenko in https://github.com/AMICI-dev/AMICI/pull/2342
* Fixed `ReturnDataView` `AttributeError: messages`
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2341
* Added a missing return code constant `LSETUP_FAIL`
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2353
* Fixed in-place building of model wheels
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2352
* Made is-zero-checks compatible with the upcoming sympy>1.12
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2350
* Fixed issues with paths containing blanks for sundials
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2361
* Added `amici.petab.conditions` to the API documentation
by @PaulJonasJost in https://github.com/AMICI-dev/AMICI/pull/2364
* Improved type annotations in swig-wrappers
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2344,
https://github.com/AMICI-dev/AMICI/pull/2365

**Full Changelog**: https://github.com/AMICI-dev/AMICI/compare/v0.22.0...v0.23.0

### v0.22.0 (2024-02-23)

**Features**
Expand Down
71 changes: 10 additions & 61 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ endif()
# find dependencies
include(GNUInstallDirs)

include(AmiciFindBLAS)
find_package(OpenMP)
find_package(Boost COMPONENTS chrono)

Expand All @@ -142,49 +143,6 @@ message(STATUS "Found SUNDIALS: ${SUNDIALS_DIR}")

set(GSL_LITE_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ThirdParty/gsl")

# AMICI requires BLAS, currently Intel MKL, CBLAS or MATLAB BLAS can be used.
# The latter is not supported via CMake yet.
set(BLAS
"CBLAS"
CACHE STRING "BLAS library to use")
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)
else()
set(BLAS_INCLUDE_DIRS
""
CACHE STRING "")
set(BLAS_LIBRARIES
-lmkl
CACHE STRING "")
endif()
elseif(NOT DEFINED ENV{BLAS_LIBS} AND NOT DEFINED ENV{BLAS_CFLAGS})
# if nothing is specified via environment variables, let's try FindBLAS
find_package(BLAS)
if(NOT BLAS_FOUND)
# Nothing specified by the user and FindBLAS didn't find anything; let's try
# if cblas is available on the system paths.
set(BLAS_INCLUDE_DIRS
""
CACHE STRING "")
set(BLAS_LIBRARIES
-lcblas
CACHE STRING "")
endif()
endif()
add_compile_definitions(AMICI_BLAS_${BLAS})

# Add target to create version file
add_custom_target(
version
Expand Down Expand Up @@ -259,16 +217,6 @@ set(AMICI_SRC_LIST

add_library(${PROJECT_NAME} ${AMICI_SRC_LIST})

# legacy python package environment variables:
if(DEFINED ENV{BLAS_CFLAGS})
target_compile_options(${PROJECT_NAME} PRIVATE "$ENV{BLAS_CFLAGS}")
endif()
if(DEFINED ENV{BLAS_LIBS})
# Note that, on Windows, at least for ninja, this will only work with dashes
# instead of slashes in any linker options
target_link_libraries(${PROJECT_NAME} PUBLIC "$ENV{BLAS_LIBS}")
endif()

set(AMICI_CXX_OPTIONS
""
CACHE STRING "C++ options for libamici (semicolon-separated)")
Expand All @@ -289,10 +237,6 @@ target_include_directories(
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/swig>
PRIVATE ${SUNDIALS_PRIVATE_INCLUDE_DIRS})

if(NOT "${BLAS_INCLUDE_DIRS}" STREQUAL "")
target_include_directories(${PROJECT_NAME} PUBLIC ${BLAS_INCLUDE_DIRS})
endif()

if("$ENV{ENABLE_AMICI_DEBUGGING}"
OR "$ENV{ENABLE_GCOV_COVERAGE}"
OR CMAKE_BUILD_TYPE MATCHES "Debug")
Expand Down Expand Up @@ -328,11 +272,11 @@ target_link_libraries(
SUNDIALS::sunnonlinsolfixedpoint_static
SUNDIALS::cvodes_static
SUNDIALS::idas_static
${BLAS_LIBRARIES}
$<$<BOOL:${Boost_CHRONO_FOUND}>:Boost::chrono>
$<$<BOOL:${OpenMP_FOUND}>:OpenMP::OpenMP_CXX>
${CMAKE_DL_LIBS}
PRIVATE
BLAS::BLAS
$<$<BOOL:${SUNDIALS_SUPERLUMT_ENABLE}>:SUNDIALS::sundials_sunlinsolsuperlumt>
)

Expand Down Expand Up @@ -431,16 +375,21 @@ install(
EXPORT AmiciTargets
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Amici"
NAMESPACE Upstream::)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/AmiciConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/AmiciConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Amici)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/AmiciConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/AmiciConfigVersion.cmake
${CMAKE_CURRENT_LIST_DIR}/cmake/AmiciFindBLAS.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Amici)

install(DIRECTORY ThirdParty/gsl/gsl TYPE INCLUDE)
# When running from setup.py, this is a symlink we need to dereference
get_filename_component(_swig_realpath "swig" REALPATH)
install(DIRECTORY "${_swig_realpath}"
DESTINATION ${CMAKE_INSTALL_DATADIR}/amici)

configure_file(cmake/AmiciFindBLAS.cmake
${CMAKE_CURRENT_BINARY_DIR}/AmiciFindBLAS.cmake COPYONLY)

# Register package?
if(EXPORT_PACKAGE)
export(PACKAGE Amici)
Expand Down
Loading

0 comments on commit 815a50d

Please sign in to comment.