Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate N5Store #2103

Merged
merged 8 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions docs/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,26 @@ Enhancements
~~~~~~~~~~~~
* Added support for creating a copy of data when converting a `zarr.Array`
to a numpy array.
By :user:`David Stansby <dstansby>`
By :user:`David Stansby <dstansby>` (:issue:`2106`) and
:user:`Joe Hamman <jhamman>` (:issue:`2123`).

Maintenance
~~~~~~~~~~~
* Removed support for Python 3.9.
By :user:`David Stansby <dstansby>`
By :user:`David Stansby <dstansby>` (:issue:`2074`).

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

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

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 <jhamman>` :issue:`2085`.

.. _release_2.18.2:

Expand Down
22 changes: 22 additions & 0 deletions zarr/n5.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -322,13 +334,23 @@ 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"
_group_meta_key = "attributes.json"
_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(
Expand Down
Loading