From 9a8ec570560f726077b518dfde60ca1aa3d2d0bb Mon Sep 17 00:00:00 2001 From: Lehman Garrison Date: Thu, 6 Nov 2025 12:00:37 -0500 Subject: [PATCH 1/3] pyproject: bump parallel-numpy-rng dep for numpy 2 fix --- pyproject.toml | 7 ++++++- scripts/hod/run_hod.py | 2 +- tests/test_hod.py | 15 ++++++++++++--- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 59a9e58c..e75211d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ dependencies = [ 'h5py', 'pyyaml', 'msgpack>=1', - 'parallel_numpy_rng>=0.1.2', + 'parallel_numpy_rng>=0.2.0', 'asdf-astropy>=0.3', ] readme = "README.md" @@ -66,6 +66,11 @@ test = [ 'pytest', ] +[dependency-groups] +dev = [ + "abacusutils[test]", +] + [tool.setuptools] include-package-data = true diff --git a/scripts/hod/run_hod.py b/scripts/hod/run_hod.py index 06e3d4bc..bc540887 100755 --- a/scripts/hod/run_hod.py +++ b/scripts/hod/run_hod.py @@ -21,7 +21,7 @@ def main(path2config): # load the yaml parameters - config = yaml.load(open(path2config)) + config = yaml.safe_load(open(path2config)) sim_params = config['sim_params'] HOD_params = config['HOD_params'] clustering_params = config['clustering_params'] diff --git a/tests/test_hod.py b/tests/test_hod.py index e62d2cac..96b98c56 100644 --- a/tests/test_hod.py +++ b/tests/test_hod.py @@ -64,7 +64,7 @@ def test_hod(tmp_path, reference_mode=False): # create a new abacushod object newBall = AbacusHOD(sim_params, HOD_params, clustering_params) mock_dict = newBall.run_hod( - newBall.tracers, want_rsd, write_to_disk=True, Nthread=2 + newBall.tracers, want_rsd, write_to_disk=True, Nthread=4 ) # test mode @@ -107,7 +107,7 @@ def test_hod(tmp_path, reference_mode=False): # throw away run for jit to compile, write to disk mock_dict = newBall.run_hod( - newBall.tracers, want_rsd, write_to_disk=True, Nthread=2 + newBall.tracers, want_rsd, write_to_disk=True, Nthread=4 ) savedir_gal = ( config['sim_params']['output_dir'] @@ -133,6 +133,15 @@ def test_hod(tmp_path, reference_mode=False): data1 = ascii.read(savedir_gal) assert_close(data, data1) + # smoke test for reseed + mock_dict = newBall.run_hod( + newBall.tracers, + want_rsd, + write_to_disk=True, + Nthread=4, + reseed=0xABCDEF, + ) + # smoke test for zcv config['sim_params']['sim_name'] = ( 'AbacusSummit_base_c000_ph006' # so that meta can find it @@ -145,7 +154,7 @@ def test_hod(tmp_path, reference_mode=False): newBall.tracers, want_rsd=config['HOD_params']['want_rsd'], write_to_disk=False, - Nthread=2, + Nthread=4, ) del mock_dict['ELG'] # drop ELG since zcv works with a single tracer currently # zcv_dict = From 59db43600a0f8d52f79849e91ef460c632de2894 Mon Sep 17 00:00:00 2001 From: Lehman Garrison Date: Thu, 6 Nov 2025 12:07:21 -0500 Subject: [PATCH 2/3] pyproject: drop python 3.9 EOL --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e75211d4..fd875a96 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ dependencies = [ 'asdf-astropy>=0.3', ] readme = "README.md" -requires-python = ">=3.9" +requires-python = ">=3.10" urls = {Repository = "https://github.com/abacusorg/abacusutils"} classifiers = [ "Programming Language :: Python :: 3", From a79fb3f04adcf0e461b999fe45e94ba2a6f75436 Mon Sep 17 00:00:00 2001 From: Lehman Garrison Date: Thu, 6 Nov 2025 12:10:25 -0500 Subject: [PATCH 3/3] ci: bump minimum python --- .github/workflows/tests.yml | 2 +- CHANGES.rst | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 39b43df6..339789e8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -68,7 +68,7 @@ jobs: }} strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v5 diff --git a/CHANGES.rst b/CHANGES.rst index ffff18d1..2af32793 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,15 @@ Changelog ========= +Upcoming +-------- + +The minimum Python version is 3.10. + +Fixes +~~~~~ +- HOD: fix reseed in NumPy 2 by updating ``parallel_numpy_rng`` dependency + 2.1.2 (2025-10-13) ------------------