Skip to content

Commit 863c3c0

Browse files
authored
use np.inf instead of PINF/NINF (#1842)
* use np.inf instead of PINF/NINF * update release notes
1 parent 2f29144 commit 863c3c0

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

docs/release.rst

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,24 @@ Unreleased
2525

2626
Enhancements
2727
~~~~~~~~~~~~
28-
* Performance improvement for reading and writing chunks if any of the dimensions is size 1. :issue:`1730`
29-
By :user:`Deepak Cherian <dcherian>`.
30-
28+
* Performance improvement for reading and writing chunks if any of the dimensions is size 1.
29+
By :user:`Deepak Cherian <dcherian>` :issue:`1730`.
3130

3231
Docs
3332
~~~~
3433

3534

3635
Maintenance
3736
~~~~~~~~~~~
37+
* Minor updates to use `np.inf` instead of `np.PINF` / `np.NINF` in preparation for NumPy 2.0.0 release.
38+
By :user:`Joe Hamman <jhamman>` :issue:`1842`.
3839

3940
Deprecations
4041
~~~~~~~~~~~~
4142

4243
* Deprecate experimental v3 support by issuing a `FutureWarning`.
4344
Also updated docs to warn about using the experimental v3 version.
44-
By :user:`Joe Hamman <jhamman>` :issue:`1802` and :issue: `1807`.
45-
46-
Deprecations
47-
~~~~~~~~~~~~
45+
By :user:`Joe Hamman <jhamman>` :issue:`1802` and :issue:`1807`.
4846
* Deprecate the following stores: :class:`zarr.storage.DBMStore`, :class:`zarr.storage.LMDBStore`,
4947
:class:`zarr.storage.SQLiteStore`, :class:`zarr.storage.MongoDBStore`, :class:`zarr.storage.RedisStore`,
5048
and :class:`zarr.storage.ABSStore`. These stores are slated to be removed from Zarr-Python in version 3.0.

zarr/meta.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,9 @@ def decode_fill_value(cls, v: Any, dtype: np.dtype, object_codec: Any = None) ->
227227
if v == "NaN":
228228
return np.nan
229229
elif v == "Infinity":
230-
return np.PINF
230+
return np.inf
231231
elif v == "-Infinity":
232-
return np.NINF
232+
return -np.inf
233233
else:
234234
return np.array(v, dtype=dtype)[()]
235235
elif dtype.kind in "c":

zarr/tests/test_meta.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,8 @@ def test_encode_decode_array_structured():
382382
def test_encode_decode_fill_values_nan():
383383
fills = (
384384
(np.nan, "NaN", np.isnan),
385-
(np.NINF, "-Infinity", np.isneginf),
386-
(np.PINF, "Infinity", np.isposinf),
385+
(-np.inf, "-Infinity", np.isneginf),
386+
(np.inf, "Infinity", np.isposinf),
387387
)
388388

389389
for v, s, f in fills:

0 commit comments

Comments
 (0)