diff --git a/docs/release.rst b/docs/release.rst index 697dfde3b8..05110f8ce1 100644 --- a/docs/release.rst +++ b/docs/release.rst @@ -28,12 +28,13 @@ Enhancements ~~~~~~~~~~~~ * Added support for creating a copy of data when converting a `zarr.Array` to a numpy array. - By :user:`David Stansby ` + By :user:`David Stansby ` (:issue:`2106`) and + :user:`Joe Hamman ` (:issue:`2123`). Maintenance ~~~~~~~~~~~ * Removed support for Python 3.9. - By :user:`David Stansby ` + By :user:`David Stansby ` (:issue:`2074`). * Fix a regression when using orthogonal indexing with a scalar. By :user:`Deepak Cherian ` :issue:`1931` @@ -41,6 +42,12 @@ Maintenance * Added compatibility with numpy 2.1. By :user:`David Stansby ` +Deprecations +~~~~~~~~~~~~ + +* Deprecate :class:`zarr.n5.N5Store` and :class:`zarr.n5.N5FSStore`. These + stores are slated to be removed in Zarr Python 3.0. + By :user:`Joe Hamman ` :issue:`2085`. .. _release_2.18.2: diff --git a/zarr/n5.py b/zarr/n5.py index 3d3e9afa26..3bb7093128 100644 --- a/zarr/n5.py +++ b/zarr/n5.py @@ -69,8 +69,20 @@ class N5Store(NestedDirectoryStore): Safe to write in multiple threads or processes. + .. deprecated:: 2.18.3 + `N5Store` will be removed in Zarr 3.0.0. """ + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + warnings.warn( + "The N5Store is deprecated and will be removed in a Zarr-Python version 3, " + "see https://github.com/zarr-developers/zarr-python/issues/1274 and " + "https://github.com/zarr-developers/n5py for more information.", + FutureWarning, + stacklevel=2, + ) + def __getitem__(self, key: str) -> bytes: if key.endswith(zarr_group_meta_key): key_new = key.replace(zarr_group_meta_key, n5_attrs_key) @@ -322,6 +334,9 @@ class N5FSStore(FSStore): storage, and this procedure requires chunk keys with "." separated dimensions, hence the Zarr arrays targeting N5 have the deceptive "." dimension separator. + + .. deprecated:: 2.18.3 + `N5FSStore` will be removed in Zarr 3.0.0. """ _array_meta_key = "attributes.json" @@ -329,6 +344,13 @@ class N5FSStore(FSStore): _attrs_key = "attributes.json" def __init__(self, *args, **kwargs): + warnings.warn( + "The N5FSStore is deprecated and will be removed in a Zarr-Python version 3, " + "see https://github.com/zarr-developers/zarr-python/issues/1274 and " + "https://github.com/zarr-developers/n5py for more information.", + FutureWarning, + stacklevel=2, + ) if "dimension_separator" in kwargs: kwargs.pop("dimension_separator") warnings.warn(