Skip to content

Commit 120db2a

Browse files
committed
add test for consistent docstring usage
1 parent 54158d6 commit 120db2a

File tree

5 files changed

+89
-82
lines changed

5 files changed

+89
-82
lines changed

src/zarr/api/asynchronous.py

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ async def load(
271271
272272
Parameters
273273
----------
274-
store : Store or str
274+
store : StoreLike
275275
Store or path to directory in file system or name of zip file.
276276
path : str or None, optional
277277
The path within the store from which to load.
@@ -315,7 +315,7 @@ async def open(
315315
316316
Parameters
317317
----------
318-
store : Store or str, optional
318+
store : StoreLike or None, default=None
319319
Store or path to directory in file system or name of zip file.
320320
mode : {'r', 'r+', 'a', 'w', 'w-'}, optional
321321
Persistence mode: 'r' means read only (must exist); 'r+' means
@@ -399,7 +399,7 @@ async def save(
399399
400400
Parameters
401401
----------
402-
store : Store or str
402+
store : StoreLike
403403
Store or path to directory in file system or name of zip file.
404404
*args : ndarray
405405
NumPy arrays with data to save.
@@ -435,7 +435,7 @@ async def save_array(
435435
436436
Parameters
437437
----------
438-
store : Store or str
438+
store : StoreLike
439439
Store or path to directory in file system or name of zip file.
440440
arr : ndarray
441441
NumPy array with data to save.
@@ -491,7 +491,7 @@ async def save_group(
491491
492492
Parameters
493493
----------
494-
store : Store or str
494+
store : StoreLike
495495
Store or path to directory in file system or name of zip file.
496496
*args : ndarray
497497
NumPy arrays with data to save.
@@ -640,14 +640,13 @@ async def group(
640640
641641
Parameters
642642
----------
643-
store : Store or str, optional
644-
Store or path to directory in file system.
643+
store : StoreLike or None, default=None
644+
Store or path to directory in file system or name of zip file.
645645
overwrite : bool, optional
646646
If True, delete any pre-existing data in `store` at `path` before
647647
creating the group.
648-
chunk_store : Store, optional
649-
Separate storage for chunks. If not provided, `store` will be used
650-
for storage of both chunks and metadata.
648+
chunk_store : StoreLike or None, default=None
649+
Separate storage for chunks. Not implemented.
651650
cache_attrs : bool, optional
652651
If True (default), user attributes will be cached for attribute read
653652
operations. If False, user attributes are reloaded from the store prior
@@ -717,8 +716,8 @@ async def create_group(
717716
718717
Parameters
719718
----------
720-
store : Store or str
721-
Store or path to directory in file system.
719+
store : StoreLike
720+
Store or path to directory in file system or name of zip file.
722721
path : str, optional
723722
Group path within store.
724723
overwrite : bool, optional
@@ -773,7 +772,7 @@ async def open_group(
773772
774773
Parameters
775774
----------
776-
store : Store, str, or mapping, optional
775+
store : StoreLike or None, default=None
777776
Store or path to directory in file system or name of zip file.
778777
779778
Strings are interpreted as paths on the local file system
@@ -798,7 +797,7 @@ async def open_group(
798797
Array synchronizer.
799798
path : str, optional
800799
Group path within store.
801-
chunk_store : Store or str, optional
800+
chunk_store : StoreLike or None, default=None
802801
Store or path to directory in file system or name of zip file.
803802
storage_options : dict
804803
If using an fsspec URL to create the store, these will be passed to
@@ -873,7 +872,7 @@ async def create(
873872
compressor: CompressorLike = "auto",
874873
fill_value: Any | None = DEFAULT_FILL_VALUE,
875874
order: MemoryOrder | None = None,
876-
store: str | StoreLike | None = None,
875+
store: StoreLike | None = None,
877876
synchronizer: Any | None = None,
878877
overwrite: bool = False,
879878
path: PathLike | None = None,
@@ -924,14 +923,14 @@ async def create(
924923
:class:`zarr.codecs.ZstdCodec`is used.
925924
926925
If ``compressor`` is set to ``None``, no compression is used.
927-
fill_value : object
928-
Default value to use for uninitialized portions of the array.
926+
fill_value : Any, optional
927+
Fill value for the array.
929928
order : {'C', 'F'}, optional
930929
Deprecated in favor of the ``config`` keyword argument.
931930
Pass ``{'order': <value>}`` to ``create`` instead of using this parameter.
932931
Memory layout to be used within each chunk.
933932
If not specified, the ``array.order`` parameter in the global config will be used.
934-
store : Store or str
933+
store : StoreLike or None, default=None
935934
Store or path to directory in file system or name of zip file.
936935
synchronizer : object, optional
937936
Array synchronizer.
@@ -940,7 +939,7 @@ async def create(
940939
creating the array.
941940
path : str, optional
942941
Path under which array is stored.
943-
chunk_store : MutableMapping, optional
942+
chunk_store : StoreLike or None, default=None
944943
Separate storage for chunks. If not provided, `store` will be used
945944
for storage of both chunks and metadata.
946945
filters : Iterable[Codec] | Literal["auto"], optional
@@ -1241,7 +1240,7 @@ async def open_array(
12411240
12421241
Parameters
12431242
----------
1244-
store : Store or str
1243+
store : StoreLike
12451244
Store or path to directory in file system or name of zip file.
12461245
zarr_version : {2, 3, None}, optional
12471246
The zarr format to use when saving. Deprecated in favor of zarr_format.

src/zarr/api/synchronous.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def load(
133133
134134
Parameters
135135
----------
136-
store : Store or str
136+
store : StoreLike
137137
Store or path to directory in file system or name of zip file.
138138
path : str or None, optional
139139
The path within the store from which to load.
@@ -173,7 +173,7 @@ def open(
173173
174174
Parameters
175175
----------
176-
store : Store or str, optional
176+
store : StoreLike or None, default=None
177177
Store or path to directory in file system or name of zip file.
178178
mode : {'r', 'r+', 'a', 'w', 'w-'}, optional
179179
Persistence mode: 'r' means read only (must exist); 'r+' means
@@ -235,7 +235,7 @@ def save(
235235
236236
Parameters
237237
----------
238-
store : Store or str
238+
store : StoreLike
239239
Store or path to directory in file system or name of zip file.
240240
*args : ndarray
241241
NumPy arrays with data to save.
@@ -269,7 +269,7 @@ def save_array(
269269
270270
Parameters
271271
----------
272-
store : Store or str
272+
store : StoreLike
273273
Store or path to directory in file system or name of zip file.
274274
arr : ndarray
275275
NumPy array with data to save.
@@ -312,7 +312,7 @@ def save_group(
312312
313313
Parameters
314314
----------
315-
store : Store or str
315+
store : StoreLike
316316
Store or path to directory in file system or name of zip file.
317317
*args : ndarray
318318
NumPy arrays with data to save.
@@ -403,14 +403,13 @@ def group(
403403
404404
Parameters
405405
----------
406-
store : Store or str, optional
407-
Store or path to directory in file system.
406+
store : StoreLike or None, default=None
407+
Store or path to directory in file system or name of zip file.
408408
overwrite : bool, optional
409409
If True, delete any pre-existing data in `store` at `path` before
410410
creating the group.
411-
chunk_store : Store, optional
412-
Separate storage for chunks. If not provided, `store` will be used
413-
for storage of both chunks and metadata.
411+
chunk_store : StoreLike or None, default=None
412+
Separate storage for chunks. Not implemented.
414413
cache_attrs : bool, optional
415414
If True (default), user attributes will be cached for attribute read
416415
operations. If False, user attributes are reloaded from the store prior
@@ -471,7 +470,7 @@ def open_group(
471470
472471
Parameters
473472
----------
474-
store : Store, str, or mapping, optional
473+
store : StoreLike or None, default=None
475474
Store or path to directory in file system or name of zip file.
476475
477476
Strings are interpreted as paths on the local file system
@@ -496,7 +495,7 @@ def open_group(
496495
Array synchronizer.
497496
path : str, optional
498497
Group path within store.
499-
chunk_store : Store or str, optional
498+
chunk_store : StoreLike or None, default=None
500499
Store or path to directory in file system or name of zip file.
501500
storage_options : dict
502501
If using an fsspec URL to create the store, these will be passed to
@@ -561,8 +560,8 @@ def create_group(
561560
562561
Parameters
563562
----------
564-
store : Store or str
565-
Store or path to directory in file system.
563+
store : StoreLike
564+
Store or path to directory in file system or name of zip file.
566565
path : str, optional
567566
Group path within store.
568567
overwrite : bool, optional
@@ -605,7 +604,7 @@ def create(
605604
compressor: CompressorLike = "auto",
606605
fill_value: Any | None = DEFAULT_FILL_VALUE, # TODO: need type
607606
order: MemoryOrder | None = None,
608-
store: str | StoreLike | None = None,
607+
store: StoreLike | None = None,
609608
synchronizer: Any | None = None,
610609
overwrite: bool = False,
611610
path: PathLike | None = None,
@@ -656,14 +655,14 @@ def create(
656655
:class:`zarr.codecs.ZstdCodec`is used.
657656
658657
If ``compressor`` is set to ``None``, no compression is used.
659-
fill_value : object
660-
Default value to use for uninitialized portions of the array.
658+
fill_value : Any, optional
659+
Fill value for the array.
661660
order : {'C', 'F'}, optional
662661
Deprecated in favor of the ``config`` keyword argument.
663662
Pass ``{'order': <value>}`` to ``create`` instead of using this parameter.
664663
Memory layout to be used within each chunk.
665664
If not specified, the ``array.order`` parameter in the global config will be used.
666-
store : Store or str
665+
store : StoreLike or None, default=None
667666
Store or path to directory in file system or name of zip file.
668667
synchronizer : object, optional
669668
Array synchronizer.
@@ -672,7 +671,7 @@ def create(
672671
creating the array.
673672
path : str, optional
674673
Path under which array is stored.
675-
chunk_store : MutableMapping, optional
674+
chunk_store : StoreLike or None, default=None
676675
Separate storage for chunks. If not provided, `store` will be used
677676
for storage of both chunks and metadata.
678677
filters : Iterable[Codec] | Literal["auto"], optional
@@ -795,7 +794,7 @@ def create(
795794

796795

797796
def create_array(
798-
store: str | StoreLike,
797+
store: StoreLike,
799798
*,
800799
name: str | None = None,
801800
shape: ShapeLike | None = None,
@@ -823,7 +822,7 @@ def create_array(
823822
824823
Parameters
825824
----------
826-
store : str or Store
825+
store : StoreLike
827826
Store or path to directory in file system or name of zip file.
828827
name : str or None, optional
829828
The name of the array within the store. If ``name`` is ``None``, the array will be located
@@ -962,7 +961,7 @@ def create_array(
962961

963962

964963
def from_array(
965-
store: str | StoreLike,
964+
store: StoreLike,
966965
*,
967966
data: Array | npt.ArrayLike,
968967
write_data: bool = True,
@@ -986,8 +985,8 @@ def from_array(
986985
987986
Parameters
988987
----------
989-
store : str or Store
990-
Store or path to directory in file system or name of zip file for the new array.
988+
store : StoreLike
989+
Store or path to directory in file system or name of zip file.
991990
data : Array | array-like
992991
The array to copy.
993992
write_data : bool, default True
@@ -1323,7 +1322,7 @@ def open_array(
13231322
13241323
Parameters
13251324
----------
1326-
store : Store or str
1325+
store : StoreLike
13271326
Store or path to directory in file system or name of zip file.
13281327
zarr_version : {2, 3, None}, optional
13291328
The zarr format to use when saving. Deprecated in favor of zarr_format.
@@ -1348,6 +1347,7 @@ def open_array(
13481347
async_api.open_array(
13491348
store=store,
13501349
zarr_version=zarr_version,
1350+
zarr_format=zarr_format,
13511351
path=path,
13521352
storage_options=storage_options,
13531353
**kwargs,

src/zarr/core/array.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2097,7 +2097,7 @@ def open(
20972097
20982098
Parameters
20992099
----------
2100-
store : Store
2100+
store : StoreLike
21012101
Store containing the Array.
21022102
21032103
Returns
@@ -3943,7 +3943,7 @@ class ShardsConfigParam(TypedDict):
39433943

39443944

39453945
async def from_array(
3946-
store: str | StoreLike,
3946+
store: StoreLike,
39473947
*,
39483948
data: Array | npt.ArrayLike,
39493949
write_data: bool = True,
@@ -3967,8 +3967,8 @@ async def from_array(
39673967
39683968
Parameters
39693969
----------
3970-
store : str or Store
3971-
Store or path to directory in file system or name of zip file for the new array.
3970+
store : StoreLike
3971+
Store or path to directory in file system or name of zip file.
39723972
data : Array | array-like
39733973
The array to copy.
39743974
write_data : bool, default True
@@ -4422,7 +4422,7 @@ async def init_array(
44224422

44234423

44244424
async def create_array(
4425-
store: str | StoreLike,
4425+
store: StoreLike,
44264426
*,
44274427
name: str | None = None,
44284428
shape: ShapeLike | None = None,
@@ -4448,7 +4448,7 @@ async def create_array(
44484448
44494449
Parameters
44504450
----------
4451-
store : str or Store
4451+
store : StoreLike
44524452
Store or path to directory in file system or name of zip file.
44534453
name : str or None, optional
44544454
The name of the array within the store. If ``name`` is ``None``, the array will be located

src/zarr/storage/_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ async def make_store_path(
299299
300300
Parameters
301301
----------
302-
store_like : StoreLike | None
302+
store_like : StoreLike, optional
303303
The object to convert to a `StorePath` object.
304304
path : str | None, optional
305305
The path to use when creating the `StorePath` object. If None, the

0 commit comments

Comments
 (0)