From 2304d1f8ed3de7c68ead7613f204f144ac7de8da Mon Sep 17 00:00:00 2001 From: Mike Jarvis Date: Mon, 24 Jun 2024 15:43:07 -0400 Subject: [PATCH] Don't test with halotools on ci, and skip test if numpy 2.0 --- .github/workflows/ci.yml | 7 ------- tests/test_periodic.py | 8 +++++++- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b6c51be..c3e1b344 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: | diff --git a/tests/test_periodic.py b/tests/test_periodic.py index 7863cbb2..e5d6327d 100644 --- a/tests/test_periodic.py +++ b/tests/test_periodic.py @@ -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