Skip to content

Commit f23f810

Browse files
committed
Remove deprecated API
1 parent e410173 commit f23f810

File tree

12 files changed

+71
-938
lines changed

12 files changed

+71
-938
lines changed

changes/xxxx.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 (
@@ -83,7 +82,6 @@
8382
"save",
8483
"save_array",
8584
"save_group",
86-
"tree",
8785
"zeros",
8886
"zeros_like",
8987
]
@@ -536,31 +534,6 @@ async def save_group(
536534
await asyncio.gather(*aws)
537535

538536

539-
@deprecated("Use AsyncGroup.tree instead.")
540-
async def tree(grp: AsyncGroup, expand: bool | None = None, level: int | None = None) -> Any:
541-
"""Provide a rich display of the hierarchy.
542-
543-
.. deprecated:: 3.0.0
544-
`zarr.tree()` is deprecated and will be removed in a future release.
545-
Use `group.tree()` instead.
546-
547-
Parameters
548-
----------
549-
grp : Group
550-
Zarr or h5py group.
551-
expand : bool, optional
552-
Only relevant for HTML representation. If True, tree will be fully expanded.
553-
level : int, optional
554-
Maximum depth to descend into hierarchy.
555-
556-
Returns
557-
-------
558-
TreeRepr
559-
A pretty-printable object displaying the hierarchy.
560-
"""
561-
return await grp.tree(expand=expand, level=level)
562-
563-
564537
async def array(
565538
data: npt.ArrayLike | Array, **kwargs: Any
566539
) -> AsyncArray[ArrayV2Metadata] | AsyncArray[ArrayV3Metadata]:

src/zarr/api/synchronous.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
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
@@ -67,7 +65,6 @@
6765
"save",
6866
"save_array",
6967
"save_group",
70-
"tree",
7168
"zeros",
7269
"zeros_like",
7370
]
@@ -339,31 +336,6 @@ def save_group(
339336
)
340337

341338

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

src/zarr/convenience.py

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

0 commit comments

Comments
 (0)