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) ------------------ diff --git a/pyproject.toml b/pyproject.toml index 59a9e58c..fd875a96 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,11 +26,11 @@ dependencies = [ 'h5py', 'pyyaml', 'msgpack>=1', - 'parallel_numpy_rng>=0.1.2', + 'parallel_numpy_rng>=0.2.0', '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", @@ -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 =