Skip to content

Commit c2ec4f0

Browse files
committed
Remove deprecated API
1 parent a26926c commit c2ec4f0

File tree

10 files changed

+39
-912
lines changed

10 files changed

+39
-912
lines changed

changes/3325.removal.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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

src/zarr/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
save,
2727
save_array,
2828
save_group,
29-
tree,
3029
zeros,
3130
zeros_like,
3231
)
@@ -119,7 +118,6 @@ def print_packages(packages: list[str]) -> None:
119118
"save",
120119
"save_array",
121120
"save_group",
122-
"tree",
123121
"zeros",
124122
"zeros_like",
125123
]

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
]
@@ -542,31 +540,6 @@ async def save_group(
542540
await asyncio.gather(*aws)
543541

544542

545-
@deprecated("Use AsyncGroup.tree instead.", category=ZarrDeprecationWarning)
546-
async def tree(grp: AsyncGroup, expand: bool | None = None, level: int | None = None) -> Any:
547-
"""Provide a rich display of the hierarchy.
548-
549-
.. deprecated:: 3.0.0
550-
`zarr.tree()` is deprecated and will be removed in a future release.
551-
Use `group.tree()` instead.
552-
553-
Parameters
554-
----------
555-
grp : Group
556-
Zarr or h5py group.
557-
expand : bool, optional
558-
Only relevant for HTML representation. If True, tree will be fully expanded.
559-
level : int, optional
560-
Maximum depth to descend into hierarchy.
561-
562-
Returns
563-
-------
564-
TreeRepr
565-
A pretty-printable object displaying the hierarchy.
566-
"""
567-
return await grp.tree(expand=expand, level=level)
568-
569-
570543
async def array(
571544
data: npt.ArrayLike | Array, **kwargs: Any
572545
) -> 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
@@ -68,7 +65,6 @@
6865
"save",
6966
"save_array",
7067
"save_group",
71-
"tree",
7268
"zeros",
7369
"zeros_like",
7470
]
@@ -340,31 +336,6 @@ def save_group(
340336
)
341337

342338

343-
@deprecated("Use Group.tree instead.", category=ZarrDeprecationWarning)
344-
def tree(grp: Group, expand: bool | None = None, level: int | None = None) -> Any:
345-
"""Provide a rich display of the hierarchy.
346-
347-
.. deprecated:: 3.0.0
348-
`zarr.tree()` is deprecated and will be removed in a future release.
349-
Use `group.tree()` instead.
350-
351-
Parameters
352-
----------
353-
grp : Group
354-
Zarr or h5py group.
355-
expand : bool, optional
356-
Only relevant for HTML representation. If True, tree will be fully expanded.
357-
level : int, optional
358-
Maximum depth to descend into hierarchy.
359-
360-
Returns
361-
-------
362-
TreeRepr
363-
A pretty-printable object displaying the hierarchy.
364-
"""
365-
return sync(async_api.tree(grp._async_group, expand=expand, level=level))
366-
367-
368339
# TODO: add type annotations for kwargs
369340
def array(data: npt.ArrayLike | Array, **kwargs: Any) -> Array:
370341
"""Create an array filled with `data`.

src/zarr/convenience.py

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

0 commit comments

Comments
 (0)