Skip to content

Commit

Permalink
Merge branch 'develop' into adjoint_event
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl authored Jan 16, 2024
2 parents 8ea8bdf + ec4ee25 commit 7e32da0
Show file tree
Hide file tree
Showing 94 changed files with 1,956 additions and 956 deletions.
31 changes: 31 additions & 0 deletions .github/actions/install-macos-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Install AMICI dependencies for MacOS
description: Install AMICI dependencies for MacOS

runs:
using: "composite"
steps:
# use all available cores
- run: echo "AMICI_PARALLEL_COMPILE=" >> $GITHUB_ENV
shell: bash

# AMICI repository root
- run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV
shell: bash

# BioNetGen path
- run: echo "BNGPATH=${AMICI_DIR}/ThirdParty/BioNetGen-2.7.0" >> $GITHUB_ENV
shell: bash

# CMake hints
# Ensure CMake is using the python version that we will use for the python tests later on
- run: echo "PYTHON_EXECUTABLE=${Python3_ROOT_DIR}/bin/python3" >> $GITHUB_ENV
shell: bash
- run: echo "OpenMP_ROOT=$(brew --prefix)/opt/libomp" >> $GITHUB_ENV
shell: bash
- run: echo "BOOST_ROOT=$(brew --prefix)/opt/boost" >> $GITHUB_ENV
shell: bash

# install amici dependencies
- name: homebrew
run: brew install hdf5 swig gcc libomp boost
shell: bash
5 changes: 5 additions & 0 deletions .github/workflows/deploy_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ 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/setup.cfg

- name: sdist
run: scripts/buildSdist.sh

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:

strategy:
matrix:
python-version: [ "3.10" ]
python-version: [ "3.11" ]

steps:
- name: Set up Python ${{ matrix.python-version }}
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/test_matlab.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
name: Matlab
on: [push, merge_group, workflow_dispatch]
on:
push:
merge_group:
workflow_dispatch:
pull_request:
branches:
- master


jobs:
matlab:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_petab_test_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
run: |
source ./build/venv/bin/activate \
&& pytest --cov-report=xml:coverage.xml \
--cov=./ python/tests/test_*petab*.py
--cov=./ python/tests/test_*petab*.py python/tests/petab/
# run test models
- name: Run PEtab test suite
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-22.04, macos-latest]

runs-on: ${{ matrix.os }}
Expand Down
60 changes: 47 additions & 13 deletions .github/workflows/test_python_cplusplus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ jobs:

# TODO: Include notebooks in coverage report

osx:
name: Tests OSX
macos_cpp_py:
name: Tests MacOS C++/Python
runs-on: macos-latest

steps:
Expand All @@ -231,16 +231,11 @@ jobs:
- uses: actions/checkout@v3
- run: git fetch --prune --unshallow

- run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV
- run: echo "BNGPATH=${AMICI_DIR}/ThirdParty/BioNetGen-2.7.0" >> $GITHUB_ENV
# Ensure CMake is using the python version that we will use for the python tests later on
- run: echo "PYTHON_EXECUTABLE=${Python3_ROOT_DIR}/bin/python3" >> $GITHUB_ENV
- run: echo "OpenMP_ROOT=$(brew --prefix)/opt/libomp" >> $GITHUB_ENV
- run: echo "BOOST_ROOT=$(brew --prefix)/opt/boost" >> $GITHUB_ENV
- name: Install dependencies
uses: ./.github/actions/install-macos-dependencies

# install amici dependencies
- name: homebrew
run: brew install hdf5 swig gcc cppcheck libomp boost
run: brew install cppcheck

- name: Build AMICI
run: scripts/buildAll.sh
Expand All @@ -254,8 +249,47 @@ jobs:
- name: cppcheck
run: scripts/run-cppcheck.sh

- name: Python tests
run: scripts/run-python-tests.sh

- name: C++ tests
run: scripts/run-cpp-tests.sh

- name: Python tests
run: |
scripts/run-python-tests.sh \
test_pregenerated_models.py \
test_splines_short.py \
test_misc.py
macos_python:
name: Tests MacOS Python
runs-on: macos-latest

steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9

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

- name: Install dependencies
uses: ./.github/actions/install-macos-dependencies

- name: Install python package
run: |
pip show numpy > /dev/null || python3 -m pip install numpy
scripts/installAmiciSource.sh
- name: Check OpenMP support
run: source build/venv/bin/activate && python -c "import amici; import sys; sys.exit(not amici.compiledWithOpenMP())"

- name: Get BioNetGen
run: scripts/buildBNGL.sh

- name: Python tests
run: |
scripts/run-python-tests.sh \
--ignore=test_pregenerated_models.py \
--ignore=test_splines_short.py \
--ignore=test_misc.py
20 changes: 16 additions & 4 deletions .github/workflows/test_python_ver_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12']
experimental: [false]

steps:
Expand All @@ -44,15 +44,27 @@ jobs:
- name: Install apt dependencies
uses: ./.github/actions/install-apt-dependencies

# install AMICI
- name: Build BNGL
run: scripts/buildBNGL.sh

- 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

# until sympy>1.12 is released
- run: source build/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 \
&& pip3 install git+https://github.com/pysb/pysb \
&& python3 -m pytest --ignore-glob=*petab* \
&& python3 -m pytest \
--durations=10 \
--ignore-glob=*petab* \
--ignore-glob=*test_splines.py ${AMICI_DIR}/python/tests
37 changes: 22 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
args: ["--profile", "black", "--filter-files", "--line-length", "79"]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
Expand All @@ -16,15 +10,28 @@ repos:
args: [--allow-multiple-documents]
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.7.0
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.11
hooks:
- id: black-jupyter
# It is recommended to specify the latest version of Python
# supported by your project here, or alternatively use
# pre-commit's default_language_version, see
# https://pre-commit.com/#top_level-default_language_version
language_version: python3.11
args: ["--line-length", "79"]
# Run the linter.
- id: ruff
args:
- --fix
- --config
- python/sdist/pyproject.toml

# Run the formatter.
- id: ruff-format
args:
- --config
- python/sdist/pyproject.toml

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args: ["--py39-plus"]
additional_dependencies: [pyupgrade==3.15.0]

exclude: '^(ThirdParty|models)/'
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ build:
- libatlas-base-dev
- swig
tools:
python: "3.9"
python: "3.11"
88 changes: 87 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,97 @@

## v0.X Series

### v0.21.1 (2024-01-17)

Fixed package configuration for PyPI upload. No further changes.

### v0.21.0 (2024-01-16)

**Deprecations**

* Moved PEtab-related functionality from `amici.petab_*` to the
petab-subpackage `amici.petab.*`. The old public functions are still
available but will be removed in a future release.
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2205,
https://github.com/AMICI-dev/AMICI/pull/2211,
https://github.com/AMICI-dev/AMICI/pull/2252

**Features**

* Handle events occurring at fixed timepoints without root-finding.
This avoids event-after-reinitialization errors in many cases a brings a
slight performance improvement.
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2227
* Added `PetabProblem` class for handling PEtab-defined simulation conditions,
making it easier to perform customized operations based on PEtab-defined
simulation conditions.
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2255
* code-gen: Simplified `switch` statements, leading to reduced file sizes and
faster compilation for certain models.
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2240
* Made `Model` and `ModelPtr` deepcopyable
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2247
* Made `Solver` and `SolverPtr` deepcopyable
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2245
* Added a debugging helper `get_model_for_preeq` for debugging simulation
issues during pre-equilibration.
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2250
* Added `SwigPtrView` fields to `dir()` outputs
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2244
* Use proper labels for in plotting functions if IDs are available in
`ReturnData`.
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2249
* Added `ExpData::clear_observations` to set all measurements/sigmas to NaN
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2258

**Fixes**

* Fixed AMICI hiding all warnings. Previously, importing `amici` resulted
in all warnings being hidden in the rest of the program.
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2243
* CMake: Fixed model debug builds
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2222
* Fixed CMake potentially using incorrect Python library for building model
extension
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2220
* CMake: fixed cxx flag check
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2225
* Fixed potential out-of-bounds read in `Model::checkFinite` for
matlab-imported models
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2232
* Fixed piecewise/Heaviside handling
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2234
* Deterministic order of event assignments
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2242
* Proper error message in case of unsupported state-dependent sigmas
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2239
* Fixed swig shadow warning + other linting issues
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2261
* Fixed `SwigPtrView.__getattr__`
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2259
* `simulate_petab`: Avoid warning when simulating with default parameters
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2265

**Documentation**

* Updated Python package installation instructions for Arch Linux
by @willov in https://github.com/AMICI-dev/AMICI/pull/2212
* Updated `ExpData` documentation
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2254
* Documented simulation starting time `t0`
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2263
* Updated PEtab example
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2255

...

**Full Changelog**: https://github.com/AMICI-dev/AMICI/compare/v0.20.0...v0.21.0

### v0.20.0 (2023-11-23)

**Fixes**

* Fixed CMake cmake_minimum_required deprecation warning
* Fixed CMake `cmake_minimum_required` deprecation warning
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2183
* Fixed misleading preequilibration failure messages
by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2181
Expand Down
Loading

0 comments on commit 7e32da0

Please sign in to comment.