Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc2ec4f0

Browse files
committed
Remove deprecated API
1 parenta26926c commitc2ec4f0

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
importnumpyasnp
99
importnumpy.typingasnpt
10-
fromtyping_extensionsimportdeprecated
1110

1211
fromzarr.abc.storeimportStore
1312
fromzarr.core.arrayimport (
@@ -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
awaitasyncio.gather(*aws)
543541

544542

545-
@deprecated("Use AsyncGroup.tree instead.",category=ZarrDeprecationWarning)
546-
asyncdeftree(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-
returnawaitgrp.tree(expand=expand,level=level)
568-
569-
570543
asyncdefarray(
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
fromtypingimportTYPE_CHECKING,Any,Literal
44

5-
fromtyping_extensionsimportdeprecated
6-
75
importzarr.api.asynchronousasasync_api
86
importzarr.core.array
97
fromzarr.core.arrayimportDEFAULT_FILL_VALUE,Array,AsyncArray,CompressorLike
108
fromzarr.core.groupimportGroup
119
fromzarr.core.syncimportsync
1210
fromzarr.core.sync_groupimportcreate_hierarchy
13-
fromzarr.errorsimportZarrDeprecationWarning
1411

1512
ifTYPE_CHECKING:
1613
fromcollections.abcimportIterable
@@ -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-
deftree(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-
returnsync(async_api.tree(grp._async_group,expand=expand,level=level))
366-
367-
368339
# TODO: add type annotations for kwargs
369340
defarray(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)

[8]ページ先頭

©2009-2025 Movatter.jp