Skip to content

Commit 7b767bf

Browse files
committed
Remove deprecated API
1 parent 24385ab commit 7b767bf

File tree

13 files changed

+40
-1017
lines changed

13 files changed

+40
-1017
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
]
@@ -564,31 +562,6 @@ async def save_group(
564562
await asyncio.gather(*aws)
565563

566564

567-
@deprecated("Use AsyncGroup.tree instead.", category=ZarrDeprecationWarning)
568-
async def tree(grp: AsyncGroup, expand: bool | None = None, level: int | None = None) -> Any:
569-
"""Provide a rich display of the hierarchy.
570-
571-
!!! warning "Deprecated"
572-
`zarr.tree()` is deprecated since v3.0.0 and will be removed in a future release.
573-
Use `group.tree()` instead.
574-
575-
Parameters
576-
----------
577-
grp : Group
578-
Zarr or h5py group.
579-
expand : bool, optional
580-
Only relevant for HTML representation. If True, tree will be fully expanded.
581-
level : int, optional
582-
Maximum depth to descend into hierarchy.
583-
584-
Returns
585-
-------
586-
TreeRepr
587-
A pretty-printable object displaying the hierarchy.
588-
"""
589-
return await grp.tree(expand=expand, level=level)
590-
591-
592565
async def array(
593566
data: npt.ArrayLike | Array, **kwargs: Any
594567
) -> 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
]
@@ -349,31 +345,6 @@ def save_group(
349345
)
350346

351347

352-
@deprecated("Use Group.tree instead.", category=ZarrDeprecationWarning)
353-
def tree(grp: Group, expand: bool | None = None, level: int | None = None) -> Any:
354-
"""Provide a rich display of the hierarchy.
355-
356-
!!! warning "Deprecated"
357-
`zarr.tree()` is deprecated since v3.0.0 and will be removed in a future release.
358-
Use `group.tree()` instead.
359-
360-
Parameters
361-
----------
362-
grp : Group
363-
Zarr or h5py group.
364-
expand : bool, optional
365-
Only relevant for HTML representation. If True, tree will be fully expanded.
366-
level : int, optional
367-
Maximum depth to descend into hierarchy.
368-
369-
Returns
370-
-------
371-
TreeRepr
372-
A pretty-printable object displaying the hierarchy.
373-
"""
374-
return sync(async_api.tree(grp._async_group, expand=expand, level=level))
375-
376-
377348
# TODO: add type annotations for kwargs
378349
def array(data: npt.ArrayLike | Array, **kwargs: Any) -> Array:
379350
"""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)