Skip to content

Commit b8b163f

Browse files
Make tests with MPI only
1 parent 55137bd commit b8b163f

4 files changed

Lines changed: 30 additions & 24 deletions

File tree

.github/workflows/ci_test.yml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -95,42 +95,45 @@ jobs:
9595
matrix:
9696
include:
9797
- os: ubuntu-latest
98-
python: '3.10'
98+
python: '3.13'
9999
tox_env: 'codestyle'
100100
- os: ubuntu-latest
101-
python: '3.12'
102-
tox_env: 'py312-test-cov'
101+
python: '3.13'
102+
tox_env: 'py313-test-cov'
103+
- os: ubuntu-latest
104+
python: '3.13'
105+
tox_env: 'py313-test-mpi-cov'
103106
- os: ubuntu-latest
104107
python: '3.9'
105108
tox_env: 'py39-test-cov'
106109
- os: ubuntu-latest
107-
python: '3.11'
108-
tox_env: 'py311-test-alldeps-cov'
110+
python: '3.13'
111+
tox_env: 'py313-test-alldeps-cov'
109112
use_remote_data: true
110113
- os: macos-14
111-
python: '3.11'
112-
tox_env: 'py311-test-alldeps-cov'
114+
python: '3.13'
115+
tox_env: 'py313-test-alldeps-cov'
113116
use_remote_data: true
114117
- os: ubuntu-latest
115-
python: '3.12'
116-
tox_env: 'py312-test-devdeps'
118+
python: '3.14'
119+
tox_env: 'py314-test-devdeps'
117120
use_remote_data: true
118121
continue-on-error: true
119122
- os: ubuntu-latest
120-
python: '3.12'
121-
tox_env: 'py312-test-devpint'
123+
python: '3.13'
124+
tox_env: 'py313-test-devpint'
122125
use_remote_data: true
123126
continue-on-error: true
124127
- os: ubuntu-latest
125128
python: '3.9'
126129
tox_env: 'py39-test-oldestdeps-cov'
127130
use_remote_data: true
128131
- os: macos-latest
129-
python: '3.11'
130-
tox_env: 'py311-test'
132+
python: '3.13'
133+
tox_env: 'py313-test'
131134
- os: windows-latest
132-
python: '3.11'
133-
tox_env: 'py311-test'
135+
python: '3.13'
136+
tox_env: 'py313-test'
134137

135138
steps:
136139
- name: Check out repository

hendrics/tests/test_parallel.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,7 @@ def test_parallel_versions(self, method, norm):
4949
"--norm",
5050
norm,
5151
]
52-
if method == "mpi":
53-
command = ["mpirun", "-n", "4", "HENparfspec"] + command
54-
sp.check_call(command)
55-
else:
56-
main_parallel(command)
52+
main_parallel(command)
5753

5854
pds = AveragedPowerspectrum.read(out_file.name)
5955
compare_pds = self.pds.to_norm(norm) if norm != "leahy" else self.pds

pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ test_all = [
5858
"numba",
5959
"netcdf4==1.7.0",
6060
"scikit-image",
61-
"mpi4py",
6261
]
6362
recommended = [
6463
"numba",
@@ -73,7 +72,6 @@ all = [
7372
"imageio",
7473
"netcdf4==1.7.0",
7574
"scikit-image",
76-
"mpi4py",
7775
]
7876
docs = [
7977
"tomli>=1.1.0; python_version < '3.11'",

tox.ini

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ description =
3636
cov: and test coverage
3737
astropy4: with astropy 4
3838
astropy5: with astropy 5
39+
mpi: with MPI support
3940

4041
setenv =
4142
devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/scientific-python-nightly-wheels/simple https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/liberfa/simple
@@ -58,6 +59,11 @@ deps =
5859
devpint: git+https://github.com/nanograv/pint.git#egg=pint-pulsar
5960
devdeps: git+https://github.com/stingraysoftware/stingray.git#egg=stingray
6061
alldeps: netcdf4==1.7.0
62+
mpi: mpi4py
63+
64+
65+
allowlist_externals =
66+
mpi: mpirun
6167

6268
# The following indicates which extras_require will be installed
6369
extras =
@@ -67,10 +73,13 @@ extras =
6773
commands =
6874
# Force numpy reinstall to work around upper version limits dependencies put on numpy
6975
devdeps: pip install -U --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
76+
mpi: pip install mpi4py h5py
7077

7178
pip freeze
72-
!cov: pytest --pyargs hendrics {toxinidir}/docs {posargs}
73-
cov: pytest --pyargs hendrics {toxinidir}/docs --cov hendrics --cov-config={toxinidir}/pyproject.toml {posargs}
79+
mpi: mpirun -n 1 pytest --pyargs hendrics -k mpi {posargs} --cov hendrics --cov-config={toxinidir}/pyproject.toml {posargs}
80+
81+
!mpi-!cov: pytest --pyargs hendrics {toxinidir}/docs {posargs}
82+
!mpi-cov: pytest --pyargs hendrics {toxinidir}/docs --cov hendrics --cov-config={toxinidir}/pyproject.toml {posargs}
7483
cov: coverage xml -o {toxinidir}/coverage.xml
7584

7685
[testenv:build_docs]

0 commit comments

Comments
 (0)