Skip to content

Commit 81df371

Browse files
committed
Remove deprecated API
1 parent ee0e69a commit 81df371

File tree

13 files changed

+42
-965
lines changed

13 files changed

+42
-965
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 (
@@ -90,7 +89,6 @@
9089
"save",
9190
"save_array",
9291
"save_group",
93-
"tree",
9492
"zeros",
9593
"zeros_like",
9694
]
@@ -577,31 +575,6 @@ async def save_group(
577575
await asyncio.gather(*aws)
578576

579577

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

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
]
@@ -362,31 +358,6 @@ def save_group(
362358
)
363359

364360

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