Skip to content

Commit 91a1a57

Browse files
committed
Refactor to support post-numpy.distutils future
This splits scikits.odes into 4 packages: * scikits-odes-core: contains DaeBase and OdeBase which all other packages use. Uses setuptools as the build system. * scikits-odes-daepack: contains the daepack fortran code plus f2py wrappers and associated python code. Uses mesonpy as the build system, as f2py really only supports mesonpy now. * scikits-odes-sundials: contains the cython sundials wrappers. Uses setuptools as the build system, as meson does not align with how we're using cython. * scikits-odes (using the correct normalised package name): contains the high-level wrapper code to switch between solvers. Also contains the compatibility code to allow old imports to work across the packages. Uses setuptools as the build backend. Each package has its own directory, though currently there are symlinks to shared files, and the docs and API docs are for all packages (there hasn't been too much change there). CI is also updated, with only scikits-odes-daepack failing due to conflicts between tox and meson. Tests haven't been moved, there is likely some cleanup to do, and to improve the code coverage of each of the packages.
1 parent 1435fe4 commit 91a1a57

File tree

128 files changed

+10691
-2975
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+10691
-2975
lines changed

.github/workflows/test-core.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Test scikits-odes-core
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
tests:
7+
8+
runs-on: ubuntu-latest
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
include:
13+
#- python-version: "3.7"
14+
# tox-env: py37
15+
#- python-version: "3.8"
16+
# tox-env: py38
17+
#- python-version: "3.9"
18+
# tox-env: py39
19+
#- python-version: "3.10"
20+
# tox-env: py310
21+
#- python-version: "3.11"
22+
# tox-env: py311
23+
#- python-version: "3.12"
24+
# tox-env: py312
25+
- python-version: "3.11"
26+
tox-env: check-manifest
27+
#- python-version: "3.11"
28+
# tox-env: checkreadme
29+
30+
steps:
31+
- uses: actions/checkout@v2
32+
33+
- name: Set up Python ${{ matrix.python-version }}
34+
uses: actions/setup-python@v2
35+
with:
36+
python-version: ${{ matrix.python-version }}
37+
38+
- name: Get pip cache dir
39+
id: pip-cache
40+
run: |
41+
echo "::set-output name=dir::$(pip cache dir)"
42+
43+
- name: pip cache
44+
uses: actions/cache@v2
45+
with:
46+
path: ${{ steps.pip-cache.outputs.dir }}
47+
key: ${{ runner.os }}-pip-1
48+
restore-keys: |
49+
${{ runner.os }}-pip-
50+
51+
- name: Install python dependencies
52+
run: |
53+
python -m pip install --upgrade pip
54+
python -m pip install --upgrade tox
55+
56+
- name: Run tests
57+
run: |
58+
cd packages/scikits-odes-core && tox
59+
env:
60+
TOXENV: ${{ matrix.tox-env }}

.github/workflows/test-daepack.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Test scikits-odes-daepack
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
tests:
7+
8+
runs-on: ubuntu-latest
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
include:
13+
- python-version: "3.7"
14+
tox-env: py37
15+
- python-version: "3.8"
16+
tox-env: py38
17+
- python-version: "3.9"
18+
tox-env: py39
19+
- python-version: "3.10"
20+
tox-env: py310
21+
- python-version: "3.11"
22+
tox-env: py311
23+
- python-version: "3.12"
24+
tox-env: py312
25+
26+
steps:
27+
- uses: actions/checkout@v2
28+
29+
- name: Set up Python ${{ matrix.python-version }}
30+
uses: actions/setup-python@v2
31+
with:
32+
python-version: ${{ matrix.python-version }}
33+
34+
- name: Install build dependencies
35+
run: sudo apt-get install gfortran
36+
37+
- name: Get pip cache dir
38+
id: pip-cache
39+
run: |
40+
echo "::set-output name=dir::$(pip cache dir)"
41+
42+
- name: pip cache
43+
uses: actions/cache@v2
44+
with:
45+
path: ${{ steps.pip-cache.outputs.dir }}
46+
key: ${{ runner.os }}-pip-1
47+
restore-keys: |
48+
${{ runner.os }}-pip-
49+
50+
- name: Install python dependencies
51+
run: |
52+
python -m pip install --upgrade pip
53+
python -m pip install --upgrade tox
54+
55+
- name: Run tests
56+
run: |
57+
cd packages/scikits-odes-daepack && tox
58+
env:
59+
TOXENV: ${{ matrix.tox-env }}
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
name: Test scikits-odes
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
tests:
7+
8+
runs-on: ubuntu-latest
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
include:
13+
#- python-version: "3.7"
14+
# sundials-version: "6.5.0"
15+
# tox-env: py37
16+
# sundials-precision: double
17+
# sundials-index-size: 64
18+
- python-version: "3.8"
19+
sundials-version: "6.5.0"
20+
tox-env: py38
21+
sundials-precision: double
22+
sundials-index-size: 64
23+
- python-version: "3.9"
24+
sundials-version: "6.5.0"
25+
tox-env: py39
26+
sundials-precision: double
27+
sundials-index-size: 64
28+
- python-version: "3.10"
29+
sundials-version: "6.5.0"
30+
tox-env: py310
31+
sundials-precision: double
32+
sundials-index-size: 64
33+
- python-version: "3.11"
34+
sundials-version: "6.5.0"
35+
tox-env: py311
36+
sundials-precision: double
37+
sundials-index-size: 64
38+
- python-version: "3.12"
39+
sundials-version: "6.5.0"
40+
tox-env: py312
41+
sundials-precision: double
42+
sundials-index-size: 64
43+
- python-version: "3.11"
44+
sundials-version: "6.5.0"
45+
tox-env: check-manifest
46+
sundials-precision: double
47+
sundials-index-size: 64
48+
#- python-version: "3.11"
49+
# sundials-version: "6.5.0"
50+
# tox-env: checkreadme
51+
# sundials-precision: double
52+
# sundials-index-size: 64
53+
- python-version: "3.11"
54+
sundials-version: "6.5.0"
55+
tox-env: py311
56+
sundials-precision: double
57+
sundials-index-size: 32
58+
#- python-version: "3.11"
59+
# sundials-version: "6.5.0"
60+
# tox-env: py311
61+
# sundials-precision: single
62+
# sundials-index-size: 64
63+
- python-version: "3.11"
64+
sundials-version: "6.5.0"
65+
tox-env: py311
66+
sundials-precision: extended
67+
sundials-index-size: 64
68+
69+
steps:
70+
- uses: actions/checkout@v2
71+
- name: Set up Python ${{ matrix.python-version }}
72+
uses: actions/setup-python@v2
73+
with:
74+
python-version: ${{ matrix.python-version }}
75+
- name: Install build dependencies
76+
run: sudo apt-get install gfortran liblapack-dev
77+
78+
- name: Sundials cache
79+
uses: actions/cache@v2
80+
with:
81+
path: ~/sundials
82+
key: ${{ runner.os }}-sundials-${{ matrix.sundials-version }}
83+
restore-keys: |
84+
${{ runner.os }}-sundials-
85+
86+
- name: Install sundials
87+
run: |
88+
source ci_support/ensure_sundials_installed.sh &&
89+
printf "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH\n export LIBRARY_PATH=$LIBRARY_PATH\n export CPATH=$CPATH" > sundials_env.sh
90+
env:
91+
SUNDIALS_VERSION: ${{ matrix.sundials-version }}
92+
SUNDIALS_PRECISION: ${{ matrix.sundials-precision }}
93+
SUNDIALS_INDEX_SIZE: ${{ matrix.sundials-index-size }}
94+
95+
- name: Get pip cache dir
96+
id: pip-cache
97+
run: |
98+
echo "::set-output name=dir::$(pip cache dir)"
99+
100+
- name: pip cache
101+
uses: actions/cache@v2
102+
with:
103+
path: ${{ steps.pip-cache.outputs.dir }}
104+
key: ${{ runner.os }}-pip-1
105+
restore-keys: |
106+
${{ runner.os }}-pip-
107+
108+
- name: Install python dependencies
109+
run: |
110+
python -m pip install --upgrade pip
111+
python -m pip install --upgrade tox
112+
113+
- name: Run tests
114+
run: |
115+
cat sundials_env.sh
116+
source sundials_env.sh &&
117+
env &&
118+
cd packages/scikits-odes &&
119+
tox
120+
env:
121+
TOXENV: ${{ matrix.tox-env }}

.github/workflows/test-overall.yml

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
name: Python package
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
tests:
7+
8+
runs-on: ubuntu-latest
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
include:
13+
#- python-version: "3.7"
14+
# sundials-version: "6.5.0"
15+
# tox-env: py37-test
16+
# sundials-precision: double
17+
# sundials-index-size: 64
18+
- python-version: "3.8"
19+
sundials-version: "6.5.0"
20+
tox-env: py38-test
21+
sundials-precision: double
22+
sundials-index-size: 64
23+
- python-version: "3.9"
24+
sundials-version: "6.5.0"
25+
tox-env: py39-test
26+
sundials-precision: double
27+
sundials-index-size: 64
28+
- python-version: "3.10"
29+
sundials-version: "6.5.0"
30+
tox-env: py310-test
31+
sundials-precision: double
32+
sundials-index-size: 64
33+
- python-version: "3.11"
34+
sundials-version: "6.5.0"
35+
tox-env: py311-test
36+
sundials-precision: double
37+
sundials-index-size: 64
38+
- python-version: "3.12"
39+
sundials-version: "6.5.0"
40+
tox-env: py312-test
41+
sundials-precision: double
42+
sundials-index-size: 64
43+
- python-version: "3.11"
44+
sundials-version: "6.5.0"
45+
tox-env: doctr
46+
sundials-precision: double
47+
sundials-index-size: 64
48+
- python-version: "3.11"
49+
sundials-version: "6.5.0"
50+
tox-env: docs
51+
sundials-precision: double
52+
sundials-index-size: 64
53+
- python-version: "3.11"
54+
sundials-version: "6.5.0"
55+
tox-env: py311-test
56+
sundials-precision: double
57+
sundials-index-size: 32
58+
#- python-version: "3.11"
59+
# sundials-version: "6.5.0"
60+
# tox-env: py311-test
61+
# sundials-precision: single
62+
# sundials-index-size: 64
63+
- python-version: "3.11"
64+
sundials-version: "6.5.0"
65+
tox-env: py311-test
66+
sundials-precision: extended
67+
sundials-index-size: 64
68+
#- python-version: "3.12"
69+
# sundials-version: "6.5.0"
70+
# tox-env: py312-notebooks
71+
# sundials-precision: double
72+
# sundials-index-size: 64
73+
74+
steps:
75+
- uses: actions/checkout@v2
76+
- name: Set up Python ${{ matrix.python-version }}
77+
uses: actions/setup-python@v2
78+
with:
79+
python-version: ${{ matrix.python-version }}
80+
- name: Install build dependencies
81+
run: sudo apt-get install gfortran liblapack-dev
82+
83+
- name: Sundials cache
84+
uses: actions/cache@v2
85+
with:
86+
path: ~/sundials
87+
key: ${{ runner.os }}-sundials-${{ matrix.sundials-version }}
88+
restore-keys: |
89+
${{ runner.os }}-sundials-
90+
91+
- name: Install sundials
92+
run: |
93+
source ci_support/ensure_sundials_installed.sh &&
94+
printf "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH\n export LIBRARY_PATH=$LIBRARY_PATH\n export CPATH=$CPATH" > sundials_env.sh
95+
env:
96+
SUNDIALS_VERSION: ${{ matrix.sundials-version }}
97+
SUNDIALS_PRECISION: ${{ matrix.sundials-precision }}
98+
SUNDIALS_INDEX_SIZE: ${{ matrix.sundials-index-size }}
99+
100+
- name: Get pip cache dir
101+
id: pip-cache
102+
run: |
103+
echo "::set-output name=dir::$(pip cache dir)"
104+
105+
- name: pip cache
106+
uses: actions/cache@v2
107+
with:
108+
path: ${{ steps.pip-cache.outputs.dir }}
109+
key: ${{ runner.os }}-pip-1
110+
restore-keys: |
111+
${{ runner.os }}-pip-
112+
113+
- name: Install python dependencies
114+
run: |
115+
python -m pip install --upgrade pip
116+
python -m pip install "setuptools<=64.0.0"
117+
python -m pip install --upgrade tox
118+
119+
- name: Run tests
120+
run: |
121+
cat sundials_env.sh
122+
source sundials_env.sh &&
123+
env &&
124+
tox
125+
env:
126+
TOXENV: ${{ matrix.tox-env }}

0 commit comments

Comments
 (0)