Skip to content

Commit

Permalink
Merge pull request #2597 from dweindl/release_0.29.0
Browse files Browse the repository at this point in the history
Release 0.29.0
  • Loading branch information
dweindl authored Nov 28, 2024
2 parents c3bbdd9 + 593b800 commit d2fbf91
Show file tree
Hide file tree
Showing 52 changed files with 3,514 additions and 167 deletions.
5 changes: 4 additions & 1 deletion .github/actions/install-macos-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@ runs:

# install amici dependencies
- name: homebrew
run: brew install hdf5 swig gcc libomp boost
# install hdf5 without dependencies, because pkgconf installation fails,
# because it's already installed on the runners. install the other
# hdf5 dependencies (libaec) manually
run: brew install libaec && brew install --ignore-dependencies hdf5 && brew install swig libomp boost
shell: bash
21 changes: 17 additions & 4 deletions .github/workflows/test_benchmark_collection_models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
run: |
pip3 install --user petab[vis] && \
AMICI_PARALLEL_COMPILE="" pip3 install -v --user \
$(ls -t python/sdist/dist/amici-*.tar.gz | head -1)[petab,test,vis]
$(ls -t python/sdist/dist/amici-*.tar.gz | head -1)[petab,test,vis,jax]
- name: Install test dependencies
run: |
Expand All @@ -60,14 +60,27 @@ jobs:
- name: Download benchmark collection
run: |
git clone --depth 1 https://github.com/benchmarking-initiative/Benchmark-Models-PEtab.git \
&& python3 -m pip install -e Benchmark-Models-PEtab/src/python
pip install git+https://github.com/Benchmarking-Initiative/Benchmark-Models-PEtab.git@master#subdirectory=src/python
- name: Run tests
env:
AMICI_PARALLEL_COMPILE: ""
run: |
cd tests/benchmark-models && pytest --durations=10
cd tests/benchmark-models && pytest \
--durations=10
--cov=amici \
--cov-report=xml:"coverage_py.xml" \
--cov-append \
- name: Codecov Python
if: github.event_name == 'pull_request' || github.repository_owner == 'AMICI-dev'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage_py.xml
flags: python
fail_ci_if_error: true
verbose: true

# collect & upload results
- name: Aggregate results
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/test_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,8 @@ jobs:

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

# install amici dependencies
- name: homebrew
run: |
brew install hdf5 swig gcc cppcheck libomp boost \
&& brew ls -v boost \
&& brew ls -v libomp \
&& echo LDFLAGS="-L/usr/local/lib/ -L/usr/local/Cellar/boost/1.81.0_1/lib/" >> $GITHUB_ENV \
&& echo CPPFLAGS="-I /usr/local/Cellar/boost/1.81.0_1/include/" >> $GITHUB_ENV
- name: Install dependencies
uses: ./.github/actions/install-macos-dependencies

- name: Create AMICI sdist
run: scripts/buildSdist.sh
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 @@ -101,7 +101,7 @@ jobs:
- name: Codecov
if: github.event_name == 'pull_request' || github.repository_owner == 'AMICI-dev'
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/test_python_cplusplus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
- name: Codecov Python
if: github.event_name == 'pull_request' || github.repository_owner == 'AMICI-dev'
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: build/coverage_py.xml
Expand All @@ -99,7 +99,7 @@ jobs:
- name: Codecov CPP
if: github.event_name == 'pull_request' || github.repository_owner == 'AMICI-dev'
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.info
Expand Down Expand Up @@ -161,7 +161,7 @@ jobs:
- name: Codecov Python
if: github.event_name == 'pull_request' || github.repository_owner == 'AMICI-dev'
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: build/coverage_py.xml
Expand All @@ -181,7 +181,7 @@ jobs:
- name: Codecov CPP
if: github.event_name == 'pull_request' || github.repository_owner == 'AMICI-dev'
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.info
Expand Down Expand Up @@ -231,11 +231,6 @@ jobs:
- name: Install python package
run: scripts/installAmiciSource.sh

- name: Install notebook dependencies
run: |
source venv/bin/activate \
&& pip install jax[cpu]
- name: example notebooks
run: scripts/runNotebook.sh python/examples/example_*/

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 @@ -55,7 +55,7 @@ jobs:

- name: Codecov SBMLSuite
if: github.event_name == 'pull_request' || github.repository_owner == 'AMICI-dev'
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage_SBMLSuite.xml
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test_valgrind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,9 @@ jobs:
- name: Install python package
run: scripts/installAmiciSource.sh

- name: Remove jax
# avoid valgrind errors due to jax et al.
run: venv/bin/pip uninstall -y jax

- name: Python tests / Valgrind
run: scripts/run-valgrind-py.sh
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ tests/test/*
*/tests/explicit_amici/*
*/tests/fixed_initial_amici/*
*/tests/localfunc_amici/*
*/tests/conversion/*
*/tests/dimerization/*
tests/cpp/writeResults.h5
tests/cpp/writeResults.h5.bak
tests/sbml-test-suite/*
Expand Down
1 change: 1 addition & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ build:
os: "ubuntu-22.04"
apt_packages:
- libatlas-base-dev
- libhdf5-serial-dev
- swig
tools:
python: "3.11"
54 changes: 54 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,60 @@ See also our [versioning policy](https://amici.readthedocs.io/en/latest/versioni

## v0.X Series

### v0.29.0 (2024-11-28)

**Fixes**

* Fixed race conditions in froot, which could have resulted in incorrect
simulation results for models with events/heavisides/piecewise, for
multi-threaded simulations.

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

* Fixed race conditions for the max-time check, which could have resulted in
incorrect termination of simulations in case of multi-threaded simulations
in combination with a time limit.

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

* Added missing fields in ExpData HDF5 I/O

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

* Added missing fields in ReturnData HDF5 output

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


* **Features**

* Generate models in a JAX-compatible format
([example](https://amici.readthedocs.io/en/develop/ExampleJaxPEtab.html))

by @FFroehlich in https://github.com/AMICI-dev/AMICI/pull/1861

* Faster `fill_in_parameters_for_condition`

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

* Added Python function `writeSimulationExpData` for writing ExpData to HDF5

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

* Improved import of amici-generated models via `amici.import_model_module()`.

So far, it was not possible to import different model modules with the same
name. This is now possible if they are in different directories.
Overwriting an already imported module is still not possible (and never
was); any attempts to do so will raise a `RuntimeError`.
While model packages can, in principle, be imported using regular
`import`s, it is strongly recommended to use `amici.import_model_module()`.

by @dweindl in https://github.com/AMICI-dev/AMICI/pull/2604, https://github.com/AMICI-dev/AMICI/pull/2603, https://github.com/AMICI-dev/AMICI/pull/2596

**Full Changelog**: https://github.com/AMICI-dev/AMICI/compare/v0.28.0...v0.29.0


### v0.28.0 (2024-11-11)

**Breaking changes**
Expand Down
1 change: 1 addition & 0 deletions documentation/ExampleJaxPEtab.ipynb
1 change: 1 addition & 0 deletions documentation/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ def install_doxygen():
"numpy": ("https://numpy.org/devdocs/", None),
"sympy": ("https://docs.sympy.org/latest/", None),
"python": ("https://docs.python.org/3", None),
"jax": ["https://jax.readthedocs.io/en/latest/", None],
}

# Add notebooks prolog with binder links
Expand Down
1 change: 1 addition & 0 deletions documentation/cpp_installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Prerequisites:
* a C++17 compatible compiler
* a C compiler
* Optional:

* HDF5 libraries
* boost for serialization

Expand Down
1 change: 1 addition & 0 deletions documentation/python_examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ Various example notebooks.
example_errors.ipynb
example_large_models/example_performance_optimization.ipynb
ExampleJax.ipynb
ExampleJaxPEtab.ipynb
ExampleSplines.ipynb
ExampleSplinesSwameye2003.ipynb
2 changes: 1 addition & 1 deletion documentation/python_installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Install the AMICI dependencies via ``apt``

.. code-block:: bash
sudo apt install libatlas-base-dev swig
sudo apt install libatlas-base-dev swig python3-dev
# optionally for HDF5 support:
sudo apt install libhdf5-serial-dev
Expand Down
1 change: 1 addition & 0 deletions documentation/python_modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ AMICI Python API
amici.petab_objective
amici.petab_simulate
amici.import_utils
amici.jax
amici.de_export
amici.de_model
amici.de_model_components
Expand Down
2 changes: 2 additions & 0 deletions documentation/rtd_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ sphinx<8
mock>=5.0.2
setuptools>=67.7.2
pysb>=1.11.0
jax>=0.4.26
diffrax>=0.5.0
matplotlib==3.7.1
nbsphinx==0.9.1
nbformat==5.8.0
Expand Down
27 changes: 25 additions & 2 deletions include/amici/hdf5.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class ReturnData;
class ExpData;
class Model;
class Solver;
struct LogItem;

namespace hdf5 {

Expand Down Expand Up @@ -137,6 +138,17 @@ void writeReturnDataDiagnosis(
std::string const& hdf5Location
);

/**
* @brief Write log message to HDF5 file
* @param file HDF5 file to write to
* @param logItems Log items to write
* @param hdf5Location Full dataset path inside the HDF5 file (will be created)
*/
void writeLogItemsToHDF5(
H5::H5File const& file, std::vector<amici::LogItem> const& logItems,
std::string const& hdf5Location
);

/**
* @brief Create the given group and possibly parents.
* @param file HDF5 file to write to
Expand Down Expand Up @@ -164,15 +176,26 @@ std::unique_ptr<ExpData> readSimulationExpData(
/**
* @brief Write AMICI experimental data to HDF5 file.
* @param edata The experimental data which is to be written
* @param file Name of HDF5 file
* @param hdf5Location Path inside the HDF5 file to object having ExpData
* @param file HDF5 file
* @param hdf5Location Path inside the HDF5 file
*/

void writeSimulationExpData(
ExpData const& edata, H5::H5File const& file,
std::string const& hdf5Location
);

/**
* @brief Write AMICI experimental data to HDF5 file.
* @param edata The experimental data which is to be written
* @param file Name of HDF5 file
* @param hdf5Location Path inside the HDF5 file
*/
void writeSimulationExpData(
ExpData const& edata, std::string const& hdf5Filename,
std::string const& hdf5Location
);

/**
* @brief Check whether an attribute with the given name exists
* on the given dataset.
Expand Down
4 changes: 2 additions & 2 deletions include/amici/rdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ class ReturnData : public ModelDimensions {

/** boolean indicating whether residuals for standard deviations have been
* added */
bool sigma_res;
bool sigma_res{false};

/** log messages */
std::vector<LogItem> messages;
Expand All @@ -463,7 +463,7 @@ class ReturnData : public ModelDimensions {

protected:
/** offset for sigma_residuals */
realtype sigma_offset;
realtype sigma_offset{0.0};

/** array of number of found roots for a certain event type
* (shape `ne`) */
Expand Down
7 changes: 2 additions & 5 deletions include/amici/solver.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ namespace amici {
* variables and status flags) are specified as mutable and not included in
* serialization or equality checks. No solver setting parameter should be
* marked mutable.
*
*/
/*
* NOTE: Any changes in data members here must be propagated to copy ctor,
* equality operator, serialization functions in serialization.h, and
* amici::hdf5::(read/write)SolverSettings(From/To)HDF5 in hdf5.cpp.
Expand Down Expand Up @@ -1868,10 +1869,6 @@ class Solver {
/** maximum number of allowed Newton steps for steady state computation */
long int newton_maxsteps_{0L};

/** maximum number of allowed linear steps per Newton step for steady state
* computation */
long int newton_maxlinsteps_{0L};

/** Damping factor state used int the Newton method */
NewtonDampingFactorMode newton_damping_factor_mode_{
NewtonDampingFactorMode::on
Expand Down
Loading

0 comments on commit d2fbf91

Please sign in to comment.