Skip to content

Commit

Permalink
Refactor benchmark collection tests (#2569)
Browse files Browse the repository at this point in the history
* Refactor tests/benchmark-models/test_benchmark_collection.sh into pytest cases
* Unify with gradient checks in `tests/benchmark-models/test_petab_benchmark.py`
* Test some additional benchmark problems

For now, just consolidating the old tests. To be cleaned up further later on.

Closes #2510.
  • Loading branch information
dweindl authored Oct 24, 2024
1 parent 3b7c6d1 commit f5fa6cd
Show file tree
Hide file tree
Showing 4 changed files with 299 additions and 449 deletions.
27 changes: 15 additions & 12 deletions .github/workflows/test_benchmark_collection_models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,28 @@ jobs:
AMICI_PARALLEL_COMPILE="" pip3 install -v --user \
$(ls -t python/sdist/dist/amici-*.tar.gz | head -1)[petab,test,vis]
- run: |
- name: Install test dependencies
run: |
python3 -m pip uninstall -y petab && python3 -m pip install git+https://github.com/petab-dev/libpetab-python.git@develop \
&& python3 -m pip install -U sympy
&& python3 -m pip install -U sympy \
&& python3 -m pip install git+https://github.com/ICB-DCM/fiddy.git
# retrieve test models
- name: Download and test benchmark collection
- name: Download 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/" \
&& pip3 install -e $BENCHMARK_COLLECTION/../src/python \
&& AMICI_PARALLEL_COMPILE="" tests/benchmark-models/test_benchmark_collection.sh
&& python3 -m pip install -e Benchmark-Models-PEtab/src/python
- name: Run tests
env:
AMICI_PARALLEL_COMPILE: ""
run: |
cd tests/benchmark-models && pytest --durations=10
# run gradient checks
- name: Run Gradient Checks
# collect & upload results
- name: Aggregate results
run: |
pip install git+https://github.com/ICB-DCM/fiddy.git \
&& cd tests/benchmark-models && pytest --durations=10 ./test_petab_benchmark.py
cd tests/benchmark-models && python3 evaluate_benchmark.py
# upload results
- uses: actions/upload-artifact@v4
with:
name: computation-times-${{ matrix.python-version }}-${{ matrix.extract_subexpressions }}
Expand Down
149 changes: 0 additions & 149 deletions tests/benchmark-models/test_benchmark_collection.sh

This file was deleted.

Loading

0 comments on commit f5fa6cd

Please sign in to comment.