Skip to content

Commit

Permalink
Don't test with halotools on ci, and skip test if numpy 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rmjarvis committed Jun 24, 2024
1 parent ba30ad5 commit 2304d1f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,6 @@ jobs:
run: |
pip install -U matplotlib nbval ipykernel scipy pandas guppy3 h5py pyarrow mpi4py
- name: Install halotools
# halotools is currently (3/2024) broken on 3.7, 3.8, 3.12
# Just run on the ones we know it works.
if: ((matrix.py == '3.9') || (matrix.py == '3.10') || (matrix.py == '3.11')) && (matrix.os != 'windows-latest')
run: |
pip install -U halotools
- name: Install fitsio everywhere but Windows
if: matrix.os != 'windows-latest'
run: |
Expand Down
8 changes: 7 additions & 1 deletion tests/test_periodic.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,19 @@ def test_halotools():
# Note: halotools as of version 0.6 use astropy.extern.six, which is deprecated.
# Ignore the warning that is emitted about this. And in later astropy versions, it
# now raises a ModuleNotFoundError. So put it inside this try block.
# It also doesn't work with numpy 2.0. So this is mostly just broken now.
# We leave it here, but without any visible warning in case things improve and
# we can reenable it.
with warnings.catch_warnings():
warnings.simplefilter('ignore', category=AstropyWarning)
from halotools.mock_observables import npairs_3d
except ImportError:
warnings.warn("Skipping some tests because halotools or astropy is not installed.")
print('Skipping test_halotools, since either halotools or astropy is not installed.')
return
else:
if np.__version__ >= '2.0':
print('Skipping test_halotools, since numpy is version ',np.__version__)
return

# Compare the Periodic metric with the same calculation in halotools
# This first bit is directly from the documentation for halotools.npairs_3d
Expand Down

0 comments on commit 2304d1f

Please sign in to comment.