Skip to content

Commit 2e928b1

Browse files
authored
Deprecate N5Store (#2103)
* deprecate(n5): add deprecation warning to N5Store * also deprecate N5FSStore * docs * fix doc
1 parent d1b92b5 commit 2e928b1

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

docs/release.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,26 @@ Enhancements
2828
~~~~~~~~~~~~
2929
* Added support for creating a copy of data when converting a `zarr.Array`
3030
to a numpy array.
31-
By :user:`David Stansby <dstansby>`
31+
By :user:`David Stansby <dstansby>` (:issue:`2106`) and
32+
:user:`Joe Hamman <jhamman>` (:issue:`2123`).
3233

3334
Maintenance
3435
~~~~~~~~~~~
3536
* Removed support for Python 3.9.
36-
By :user:`David Stansby <dstansby>`
37+
By :user:`David Stansby <dstansby>` (:issue:`2074`).
3738

3839
* Fix a regression when using orthogonal indexing with a scalar.
3940
By :user:`Deepak Cherian <dcherian>` :issue:`1931`
4041

4142
* Added compatibility with numpy 2.1.
4243
By :user:`David Stansby <dstansby>`
4344

45+
Deprecations
46+
~~~~~~~~~~~~
47+
48+
* Deprecate :class:`zarr.n5.N5Store` and :class:`zarr.n5.N5FSStore`. These
49+
stores are slated to be removed in Zarr Python 3.0.
50+
By :user:`Joe Hamman <jhamman>` :issue:`2085`.
4451

4552
.. _release_2.18.2:
4653

zarr/n5.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,20 @@ class N5Store(NestedDirectoryStore):
6969
7070
Safe to write in multiple threads or processes.
7171
72+
.. deprecated:: 2.18.3
73+
`N5Store` will be removed in Zarr 3.0.0.
7274
"""
7375

76+
def __init__(self, *args: Any, **kwargs: Any) -> None:
77+
super().__init__(*args, **kwargs)
78+
warnings.warn(
79+
"The N5Store is deprecated and will be removed in a Zarr-Python version 3, "
80+
"see https://github.com/zarr-developers/zarr-python/issues/1274 and "
81+
"https://github.com/zarr-developers/n5py for more information.",
82+
FutureWarning,
83+
stacklevel=2,
84+
)
85+
7486
def __getitem__(self, key: str) -> bytes:
7587
if key.endswith(zarr_group_meta_key):
7688
key_new = key.replace(zarr_group_meta_key, n5_attrs_key)
@@ -322,13 +334,23 @@ class N5FSStore(FSStore):
322334
storage, and this procedure requires chunk keys with "." separated
323335
dimensions, hence the Zarr arrays targeting N5 have the deceptive
324336
"." dimension separator.
337+
338+
.. deprecated:: 2.18.3
339+
`N5FSStore` will be removed in Zarr 3.0.0.
325340
"""
326341

327342
_array_meta_key = "attributes.json"
328343
_group_meta_key = "attributes.json"
329344
_attrs_key = "attributes.json"
330345

331346
def __init__(self, *args, **kwargs):
347+
warnings.warn(
348+
"The N5FSStore is deprecated and will be removed in a Zarr-Python version 3, "
349+
"see https://github.com/zarr-developers/zarr-python/issues/1274 and "
350+
"https://github.com/zarr-developers/n5py for more information.",
351+
FutureWarning,
352+
stacklevel=2,
353+
)
332354
if "dimension_separator" in kwargs:
333355
kwargs.pop("dimension_separator")
334356
warnings.warn(

0 commit comments

Comments
 (0)