Skip to content

Commit 3f6dde7

Browse files
stephanmgarrjon
andauthored
Preparation for release 0.12.16 (#646)
* Update deploy.yml * Update deploy.yml (#643) * Update deploy.yml Upgrade actions/checkout@v2 -> actions/checkout@v4. * Update deploy.yml According to docs username must be __token__ when using API token: https://pypi.org/help/#invalid-auth * Update deploy.yml We need to generate PYP_API_TOKEN once we have access. __token__ is required, since we do authenticate with an API token and not username password combination. * Fix CI. * Enabling CI on develop branch. * Upgrade GHA cache to v4. * Try to fix R dependencies. * Try fix R dependencies for latest ubuntu. * Adding liblzma-dev. * Adding more required R (runtime) dependencies. * Fix R dependencies. * Change module import amici.petab_import -> amici.petab.petab_import * Fix tests. * Adding LD_LIBRARY path to tox.ini for manually build R. * Another try to fix dependencies. * Correcting LD_LIBRARY_PATH. * Use pyABC with amici extra. * Split up testing of external simulators. * Revert "Split up testing of external simulators." This reverts commit 5de4d6a. * Correcting tox.ini. * Updating tox.ini for base. * Fix tox.ini syntax. * Fix notebooks2. * Adding assert. * Debugging. * More debugging. * Removing debugging statement. * Try to fix PEtab unit tests. * Try to fix PEtab unit tests. * Debugging CI. * Install pyabc with amici extra. * Try to force tox to use installed amici. * More debugging. * Adding pytest to tox environment. * Adding pytest to tox environment. * Fix petab tests. * Re-installing pyabc with amici explictly in tox. * Fix petab imports. * Cleanup. * Release v0.12.16. --------- Co-authored-by: Jonas Arruda <[email protected]>
1 parent 6ee268f commit 3f6dde7

File tree

9 files changed

+107
-34
lines changed

9 files changed

+107
-34
lines changed

.flake8

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ extend-ignore =
1515
B027
1616
# Disable black would make changes warning
1717
BLK100
18+
# Name is never assigned to scope
19+
F824
1820

1921
per-file-ignores =
2022
# Imported but unused

.github/workflows/ci.yml

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
push:
66
branches:
77
- main
8+
- develop
89
pull_request:
910
schedule:
1011
# run Monday at 03:18 UTC
@@ -20,15 +21,15 @@ jobs:
2021

2122
steps:
2223
- name: Check out repository
23-
uses: actions/checkout@v2
24+
uses: actions/checkout@v4
2425

2526
- name: Prepare python ${{ matrix.python-version }}
2627
uses: actions/setup-python@v4
2728
with:
2829
python-version: ${{ matrix.python-version }}
2930

3031
- name: Cache
31-
uses: actions/cache@v1
32+
uses: actions/cache@v4
3233
with:
3334
path: ~/.cache
3435
key: ci-${{ runner.os }}-${{ matrix.python-version }}-base
@@ -58,7 +59,7 @@ jobs:
5859

5960
steps:
6061
- name: Check out repository
61-
uses: actions/checkout@v2
62+
uses: actions/checkout@v4
6263

6364
- name: Prepare python ${{ matrix.python-version }}
6465
uses: actions/setup-python@v4
@@ -71,7 +72,7 @@ jobs:
7172
version: 1.7
7273

7374
- name: Cache
74-
uses: actions/cache@v1
75+
uses: actions/cache@v4
7576
with:
7677
path: ~/.cache
7778
key: ci-${{ runner.os }}-${{ matrix.python-version }}-external
@@ -97,15 +98,15 @@ jobs:
9798

9899
steps:
99100
- name: Check out repository
100-
uses: actions/checkout@v2
101+
uses: actions/checkout@v4
101102

102103
- name: Prepare python ${{ matrix.python-version }}
103104
uses: actions/setup-python@v4
104105
with:
105106
python-version: ${{ matrix.python-version }}
106107

107108
- name: Cache
108-
uses: actions/cache@v1
109+
uses: actions/cache@v4
109110
with:
110111
path: ~/.cache
111112
key: ci-${{ runner.os }}-${{ matrix.python-version }}-petab
@@ -115,10 +116,15 @@ jobs:
115116

116117
- name: Run tests
117118
timeout-minutes: 20
118-
run: tox -e petab
119+
run: |
120+
echo "Amici installed (1):"
121+
pip list | grep amici
122+
tox -e petab -vvv
123+
echo "Amici installed (2):"
124+
pip list | grep amici
119125
120126
- name: Coverage
121-
uses: codecov/codecov-action@v2
127+
uses: codecov/codecov-action@v4
122128
with:
123129
token: ${{ secrets.CODECOV_TOKEN }}
124130
file: ./coverage.xml
@@ -131,15 +137,15 @@ jobs:
131137

132138
steps:
133139
- name: Check out repository
134-
uses: actions/checkout@v2
140+
uses: actions/checkout@v4
135141

136142
- name: Prepare python ${{ matrix.python-version }}
137143
uses: actions/setup-python@v4
138144
with:
139145
python-version: ${{ matrix.python-version }}
140146

141147
- name: Cache
142-
uses: actions/cache@v1
148+
uses: actions/cache@v4
143149
with:
144150
path: ~/Library/Caches/pip
145151
key: ci-${{ runner.os }}-${{ matrix.python-version }}-mac
@@ -165,15 +171,15 @@ jobs:
165171

166172
steps:
167173
- name: Check out repository
168-
uses: actions/checkout@v2
174+
uses: actions/checkout@v4
169175

170176
- name: Prepare python ${{ matrix.python-version }}
171177
uses: actions/setup-python@v4
172178
with:
173179
python-version: ${{ matrix.python-version }}
174180

175181
- name: Cache
176-
uses: actions/cache@v1
182+
uses: actions/cache@v4
177183
with:
178184
path: ~/.cache
179185
key: ci-${{ runner.os }}-${{ matrix.python-version }}-notebooks1
@@ -193,15 +199,15 @@ jobs:
193199

194200
steps:
195201
- name: Check out repository
196-
uses: actions/checkout@v2
202+
uses: actions/checkout@v4
197203

198204
- name: Prepare python ${{ matrix.python-version }}
199205
uses: actions/setup-python@v4
200206
with:
201207
python-version: ${{ matrix.python-version }}
202208

203209
- name: Cache
204-
uses: actions/cache@v1
210+
uses: actions/cache@v4
205211
with:
206212
path: ~/.cache
207213
key: ci-${{ runner.os }}-${{ matrix.python-version }}-notebooks2
@@ -221,15 +227,15 @@ jobs:
221227

222228
steps:
223229
- name: Check out repository
224-
uses: actions/checkout@v2
230+
uses: actions/checkout@v4
225231

226232
- name: Prepare python ${{ matrix.python-version }}
227233
uses: actions/setup-python@v4
228234
with:
229235
python-version: ${{ matrix.python-version }}
230236

231237
- name: Cache
232-
uses: actions/cache@v1
238+
uses: actions/cache@v4
233239
with:
234240
path: ~/.cache
235241
key: ci-${{ runner.os }}-${{ matrix.python-version }}-quality

.github/workflows/install_deps.sh

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,58 @@ do
3333
# MacOS
3434
brew install r
3535
else
36-
# Linux
37-
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo gpg --dearmor -o /usr/share/keyrings/r-project.gpg
38-
echo "deb [signed-by=/usr/share/keyrings/r-project.gpg] https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/" | sudo tee -a /etc/apt/sources.list.d/r-project.list
39-
sudo apt-get update
40-
sudo apt-get install r-base
36+
# Linux (Not compatible with Ubuntu 24: no CRAN repository currently available)
37+
#wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo gpg --dearmor -o /usr/share/keyrings/r-project.gpg
38+
#echo "deb [signed-by=/usr/share/keyrings/r-project.gpg] https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/" | sudo tee -a /etc/apt/sources.list.d/r-project.list
39+
#sudo apt-get update
40+
#sudo apt-get install libtiff5 r-base
41+
sudo apt update
42+
sudo apt install -y build-essential libreadline-dev libx11-dev libxt-dev libpng-dev libjpeg-dev libcairo2-dev libssl-dev libcurl4-openssl-dev libxml2-dev texinfo texlive texlive-fonts-extra screen wget
43+
sudo apt install -y liblzma-dev
44+
45+
sudo apt install -y \
46+
build-essential \
47+
libreadline-dev \
48+
libx11-dev \
49+
libxt-dev \
50+
libpng-dev \
51+
libjpeg-dev \
52+
libcairo2-dev \
53+
libtiff-dev \
54+
libglib2.0-dev \
55+
liblzma-dev \
56+
libbz2-dev \
57+
libzstd-dev \
58+
libcurl4-openssl-dev \
59+
libssl-dev \
60+
libxml2-dev \
61+
texinfo \
62+
texlive \
63+
texlive-fonts-extra \
64+
texlive-latex-extra \
65+
zlib1g-dev \
66+
gfortran \
67+
libpcre2-dev \
68+
libicu-dev \
69+
libboost-all-dev
70+
71+
cd /tmp
72+
wget https://cran.r-project.org/src/base/R-4/R-4.4.0.tar.gz
73+
tar -xvzf R-4.4.0.tar.gz
74+
cd R-4.4.0
75+
./configure --enable-R-shlib --with-blas --with-lapack
76+
make -j$(nproc)
77+
sudo make install
4178
fi
4279
;;
4380

4481
amici)
4582
# AMICI dependencies
46-
sudo apt-get install swig libatlas-base-dev libhdf5-serial-dev
83+
sudo apt-get install swig libatlas-base-dev libhdf5-serial-dev libboost-all-dev
84+
85+
# pip install amici
86+
pip uninstall amici pyabc
87+
pip install 'pyabc[amici]'
4788
;;
4889

4990
doc)

CHANGELOG.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ Release Notes
77
0.12 Series
88
...........
99

10+
0.12.16 (2025-05-23)
11+
--------------------
12+
13+
General:
14+
15+
* Migration to PEtab v2.
16+
17+
1018
0.12.15 (2024-10-29)
1119
--------------------
1220

pyabc/petab/amici.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
try:
2727
import amici
28-
from amici import petab_import as amici_petab_import
29-
from amici.petab_objective import LLH, RDATAS, simulate_petab
28+
from amici.petab import petab_import as amici_petab_import
29+
from amici.petab.simulations import LLH, RDATAS, simulate_petab
3030
except ImportError:
3131
amici = amici_petab_import = simulate_petab = LLH = RDATAS = None
3232
logger.error(

pyabc/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.12.15'
1+
__version__ = '0.12.16'

test/petab/test_petab.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33
import sys
44

5-
import amici.petab_import
5+
import amici.petab.petab_import
66
import cloudpickle as pickle
77
import git
88
import matplotlib.pyplot as plt
@@ -322,7 +322,7 @@ def boehm_model_importer():
322322
output_folder = f'amici_models/{model_name}'
323323
if output_folder not in sys.path:
324324
sys.path.insert(0, output_folder)
325-
model = amici.petab_import.import_petab_problem(
325+
model = amici.petab.petab_import.import_petab_problem(
326326
petab_problem,
327327
model_output_dir=output_folder,
328328
generate_sensitivity_code=False,

test/petab/test_petab_suite.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010
import pyabc
1111

1212
try:
13-
import amici.petab_import
14-
import amici.petab_objective
13+
import amici.petab.petab_import
14+
import amici.petab.simulations
1515
import petab.v1 as petab
1616

1717
import pyabc.petab
1818
except ImportError:
1919
pass
2020

21+
2122
logging.basicConfig(level=logging.INFO)
2223
logger = logging.getLogger(__name__)
2324

@@ -94,7 +95,7 @@ def _execute_case(case):
9495
# models with the same name in a single python session
9596
model_name = f"petab_{MODEL_TYPE}_test_case_{case}_{PETAB_VERSION.replace('.', '_')}"
9697

97-
amici_model = amici.petab_import.import_petab_problem(
98+
amici_model = amici.petab.petab_import.import_petab_problem(
9899
petab_problem=petab_problem,
99100
model_name=model_name,
100101
model_output_dir=output_folder,
@@ -117,7 +118,7 @@ def _execute_case(case):
117118
# extract results
118119
rdatas = ret['rdatas']
119120
chi2 = sum(rdata['chi2'] for rdata in rdatas)
120-
simulation_df = amici.petab_objective.rdatas_to_measurement_df(
121+
simulation_df = amici.petab.simulations.rdatas_to_measurement_df(
121122
rdatas, amici_model, importer.petab_problem.measurement_df
122123
)
123124
petab.check_measurement_df(

tox.ini

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ description =
4545
# Unit tests
4646

4747
[testenv:base]
48+
setenv =
49+
LD_LIBRARY_PATH = {env:LD_LIBRARY_PATH:/usr/lib}:/usr/local/lib/R/lib
4850
extras = test,R,pyarrow,autograd
4951
passenv = HOME
5052
commands =
@@ -57,22 +59,32 @@ description =
5759
Test basic functionality
5860

5961
[testenv:visualization]
62+
setenv =
63+
LD_LIBRARY_PATH = {env:LD_LIBRARY_PATH:/usr/lib}:/usr/local/lib/R/lib
6064
extras = test,plotly,webserver_dash,webserver_flask
6165
commands =
6266
pytest --cov=pyabc --cov-report=xml --cov-append \
6367
test/visualization
6468
description =
6569
Test visualization
6670

67-
[testenv:external]
68-
extras = test,R,julia,copasi
71+
[testenv:external-R]
72+
setenv =
73+
LD_LIBRARY_PATH = {env:LD_LIBRARY_PATH:/usr/lib}:/usr/local/lib/R/lib
74+
extras = test,R
6975
commands =
7076
# General
7177
pytest --cov=pyabc --cov-report=xml --cov-append \
7278
test/external/test_external.py -s
7379
# R
7480
pytest --cov=pyabc --cov-report=xml --cov-append \
7581
test/external/test_rpy2.py -s
82+
description =
83+
Test external model simulators
84+
85+
[testenv:external-other-simulators]
86+
extras = test,julia,copasi
87+
commands =
7688
# Julia
7789
python -c "import julia; julia.install()"
7890
python -m pytest --cov=pyabc --cov-report=xml --cov-append \
@@ -86,7 +98,8 @@ description =
8698
[testenv:petab]
8799
extras = test,petab,amici,test_petab
88100
commands =
89-
pytest --cov=pyabc --cov-report=xml --cov-append \
101+
# Petab
102+
python -m pytest --cov=pyabc --cov-report=xml --cov-append \
90103
test/petab -s
91104
description =
92105
Test PEtab support
@@ -129,6 +142,8 @@ description =
129142
Run notebooks
130143

131144
[testenv:notebooks2]
145+
setenv =
146+
LD_LIBRARY_PATH = {env:LD_LIBRARY_PATH:/usr/lib}:/usr/local/lib/R/lib
132147
allowlist_externals = bash
133148
extras = examples,R,petab,yaml2sbml,amici,autograd
134149
commands =

0 commit comments

Comments
 (0)