diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e767541c7..fee738051 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: python-version: ['3.10', '3.11'] - numpy-version: ['1.24', '1.26'] + numpy-version: ['1.24', '1.26', '2.0.0rc1'] dependency-set: ["minimal", "optional"] steps: @@ -33,7 +33,8 @@ jobs: pip install hatch - name: Set Up Hatch Env run: | - hatch env create + hatch env create test.py${{ matrix.python-version }}-${{ matrix.numpy-version }}-${{ matrix.dependency-set }} + hatch env run -e test.py${{ matrix.python-version }}-${{ matrix.numpy-version }}-${{ matrix.dependency-set }} list-env - name: Run Tests run: | hatch env run --env test.py${{ matrix.python-version }}-${{ matrix.numpy-version }}-${{ matrix.dependency-set }} run diff --git a/pyproject.toml b/pyproject.toml index 9887c824c..b60b78dcd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -92,6 +92,9 @@ version.source = "vcs" build.hooks.vcs.version-file = "src/zarr/_version.py" [tool.hatch.envs.test] +dependencies = [ + "numpy~={matrix:numpy}", +] extra-dependencies = [ "coverage", "pytest", @@ -108,12 +111,12 @@ features = ["extra"] [[tool.hatch.envs.test.matrix]] python = ["3.10", "3.11"] -numpy = ["1.24", "1.26"] +numpy = ["1.24", "1.26", "2.0.0rc1"] version = ["minimal"] [[tool.hatch.envs.test.matrix]] python = ["3.10", "3.11"] -numpy = ["1.24", "1.26"] +numpy = ["1.24", "1.26", "2.0.0rc1"] features = ["optional"] [tool.hatch.envs.test.scripts] @@ -121,6 +124,7 @@ run-coverage = "pytest --cov-config=pyproject.toml --cov=pkg --cov=tests" run = "run-coverage --no-cov" run-verbose = "run-coverage --verbose" run-mypy = "mypy src" +list-env = "pip list" [tool.hatch.envs.docs] features = ['docs'] diff --git a/src/zarr/v2/meta.py b/src/zarr/v2/meta.py index ee9cc5738..2f2f3b948 100644 --- a/src/zarr/v2/meta.py +++ b/src/zarr/v2/meta.py @@ -217,9 +217,9 @@ def decode_fill_value(cls, v: Any, dtype: np.dtype, object_codec: Any = None) -> if v == "NaN": return np.nan elif v == "Infinity": - return np.PINF + return np.inf elif v == "-Infinity": - return np.NINF + return -np.inf else: return np.array(v, dtype=dtype)[()] elif dtype.kind in "c": diff --git a/tests/v2/test_meta.py b/tests/v2/test_meta.py index e6531adfb..b7c00ec64 100644 --- a/tests/v2/test_meta.py +++ b/tests/v2/test_meta.py @@ -325,8 +325,8 @@ def test_encode_decode_array_structured(): def test_encode_decode_fill_values_nan(): fills = ( (np.nan, "NaN", np.isnan), - (np.NINF, "-Infinity", np.isneginf), - (np.PINF, "Infinity", np.isposinf), + (-np.inf, "-Infinity", np.isneginf), + (np.inf, "Infinity", np.isposinf), ) for v, s, f in fills: