From 2a208424e6e399ddc06cf23ff8ae05f0932d1ab9 Mon Sep 17 00:00:00 2001 From: Joseph Hamman Date: Mon, 19 Aug 2024 20:07:32 -0700 Subject: [PATCH 1/4] deprecate(n5): add deprecation warning to N5Store --- zarr/n5.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/zarr/n5.py b/zarr/n5.py index 3d3e9afa26..c937c79e9d 100644 --- a/zarr/n5.py +++ b/zarr/n5.py @@ -71,6 +71,16 @@ class N5Store(NestedDirectoryStore): """ + 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) From d5fa2adb4bf07413f263d54b5137dcd78df59a92 Mon Sep 17 00:00:00 2001 From: Joseph Hamman Date: Mon, 26 Aug 2024 13:09:32 -0700 Subject: [PATCH 2/4] also deprecate N5FSStore --- zarr/n5.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zarr/n5.py b/zarr/n5.py index c937c79e9d..b675fb7534 100644 --- a/zarr/n5.py +++ b/zarr/n5.py @@ -339,6 +339,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( From 15781e2bc6e3e4d5055af133081d29b8fc133c08 Mon Sep 17 00:00:00 2001 From: Joseph Hamman Date: Mon, 26 Aug 2024 14:02:33 -0700 Subject: [PATCH 3/4] docs --- docs/release.rst | 13 +++++++++++-- zarr/n5.py | 5 +++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/docs/release.rst b/docs/release.rst index 697dfde3b8..917eb7f317 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,14 @@ 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 b675fb7534..3bb7093128 100644 --- a/zarr/n5.py +++ b/zarr/n5.py @@ -69,6 +69,8 @@ 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: @@ -332,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" From 27b800e6f8fbbe6a72af62c34f4d20aeec46ca31 Mon Sep 17 00:00:00 2001 From: Joseph Hamman Date: Mon, 26 Aug 2024 14:09:20 -0700 Subject: [PATCH 4/4] fix doc --- docs/release.rst | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/release.rst b/docs/release.rst index 917eb7f317..05110f8ce1 100644 --- a/docs/release.rst +++ b/docs/release.rst @@ -46,10 +46,8 @@ 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`. - - + stores are slated to be removed in Zarr Python 3.0. + By :user:`Joe Hamman ` :issue:`2085`. .. _release_2.18.2: