Skip to content

Commit e0e94cc

Browse files
committed
Remove deprecated API
1 parent 1cd4f7e commit e0e94cc

File tree

13 files changed

+40
-1021
lines changed

13 files changed

+40
-1021
lines changed

changes/3325.removal.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
The deprecated ``zarr.convenience`` sub-module has been removed.
2+
All functions are available in the top-level `zarr` namespace.
3+
4+
The following deprecated methods have been removed:
5+
6+
- ``AsyncArray.create`` - use `zarr.api.asynchronous.create_array` instead.
7+
- ``Array.create`` - use `zarr.create_array` instead.
8+
9+
The ``codecs`` argument on the removed methods corresponds to a combination of the ``compressors`` and ``serializer`` arguments on their replacements,
10+
and the ``chunk_shape`` argument on the removed methods corresponds to the ``chunks`` argument on their replacements.
11+
12+
The following deprecated properties have been removed:
13+
14+
- ``AsyncArray.compressor`` - use ``AsyncArray.compressors[0]`` instead for Zarr format 2 arrays.
15+
- ``Array.compressor`` - use ``Array.compressors[0]`` instead for Zarr format 2 arrays.
16+
- ``AsyncGroup.create_dataset`` - use `AsyncGroup.create_array` instead
17+
- ``AsyncGroup.require_dataset`` - use `AsyncGroup.require_array` instead
18+
- ``Group.create_dataset`` - use `Group.create_array` instead
19+
- ``Group.require_dataset`` - use `Group.require_array` instead
20+
- ``Group.array`` - use `Group.create_array` instead
21+
22+
The following deprecated functions have been removed:
23+
24+
- ``zarr.api.asynchronous.tree`` - use `AsyncGroup.tree` instead
25+
- ``zarr.api.synchronous.tree`` - use `Group.tree` instead
26+
- ``zarr.tree`` - use `Group.tree` instead
27+
28+
29+
Setting ``zarr.storage.default_compressor`` is deprecated, use `zarr.config` to configure ``array.v2_default_compressor``
30+
e.g. ``zarr.config.set({'codecs.zstd':'numcodecs.Zstd', 'array.v2_default_compressor.numeric': 'zstd'})``

src/zarr/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
save,
3131
save_array,
3232
save_group,
33-
tree,
3433
zeros,
3534
zeros_like,
3635
)
@@ -177,7 +176,6 @@ def set_format(log_format: str) -> None:
177176
"save",
178177
"save_array",
179178
"save_group",
180-
"tree",
181179
"zeros",
182180
"zeros_like",
183181
]

src/zarr/api/asynchronous.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import numpy as np
99
import numpy.typing as npt
10-
from typing_extensions import deprecated
1110

1211
from zarr.abc.store import Store
1312
from zarr.core.array import (
@@ -89,7 +88,6 @@
8988
"save",
9089
"save_array",
9190
"save_group",
92-
"tree",
9391
"zeros",
9492
"zeros_like",
9593
]
@@ -576,31 +574,6 @@ async def save_group(
576574
await asyncio.gather(*aws)
577575

578576

579-
@deprecated("Use AsyncGroup.tree instead.", category=ZarrDeprecationWarning)
580-
async def tree(grp: AsyncGroup, expand: bool | None = None, level: int | None = None) -> Any:
581-
"""Provide a rich display of the hierarchy.
582-
583-
!!! warning "Deprecated"
584-
`zarr.tree()` is deprecated since v3.0.0 and will be removed in a future release.
585-
Use `group.tree()` instead.
586-
587-
Parameters
588-
----------
589-
grp : Group
590-
Zarr or h5py group.
591-
expand : bool, optional
592-
Only relevant for HTML representation. If True, tree will be fully expanded.
593-
level : int, optional
594-
Maximum depth to descend into hierarchy.
595-
596-
Returns
597-
-------
598-
TreeRepr
599-
A pretty-printable object displaying the hierarchy.
600-
"""
601-
return await grp.tree(expand=expand, level=level)
602-
603-
604577
async def array(
605578
data: npt.ArrayLike | Array, **kwargs: Any
606579
) -> AsyncArray[ArrayV2Metadata] | AsyncArray[ArrayV3Metadata]:

src/zarr/api/synchronous.py

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@
22

33
from typing import TYPE_CHECKING, Any, Literal
44

5-
from typing_extensions import deprecated
6-
75
import zarr.api.asynchronous as async_api
86
import zarr.core.array
97
from zarr.core.array import DEFAULT_FILL_VALUE, Array, AsyncArray, CompressorLike
108
from zarr.core.group import Group
119
from zarr.core.sync import sync
1210
from zarr.core.sync_group import create_hierarchy
13-
from zarr.errors import ZarrDeprecationWarning
1411

1512
if TYPE_CHECKING:
1613
from collections.abc import Iterable
@@ -67,7 +64,6 @@
6764
"save",
6865
"save_array",
6966
"save_group",
70-
"tree",
7167
"zeros",
7268
"zeros_like",
7369
]
@@ -361,31 +357,6 @@ def save_group(
361357
)
362358

363359

364-
@deprecated("Use Group.tree instead.", category=ZarrDeprecationWarning)
365-
def tree(grp: Group, expand: bool | None = None, level: int | None = None) -> Any:
366-
"""Provide a rich display of the hierarchy.
367-
368-
!!! warning "Deprecated"
369-
`zarr.tree()` is deprecated since v3.0.0 and will be removed in a future release.
370-
Use `group.tree()` instead.
371-
372-
Parameters
373-
----------
374-
grp : Group
375-
Zarr or h5py group.
376-
expand : bool, optional
377-
Only relevant for HTML representation. If True, tree will be fully expanded.
378-
level : int, optional
379-
Maximum depth to descend into hierarchy.
380-
381-
Returns
382-
-------
383-
TreeRepr
384-
A pretty-printable object displaying the hierarchy.
385-
"""
386-
return sync(async_api.tree(grp._async_group, expand=expand, level=level))
387-
388-
389360
# TODO: add type annotations for kwargs
390361
def array(data: npt.ArrayLike | Array, **kwargs: Any) -> Array:
391362
"""Create an array filled with `data`.

src/zarr/convenience.py

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)