Skip to content

Commit 0fcd5e6

Browse files
authored
Merge branch 'main' into FURB
2 parents b0f2829 + afdbb75 commit 0fcd5e6

File tree

17 files changed

+137
-149
lines changed

17 files changed

+137
-149
lines changed

pyproject.toml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,4 +330,15 @@ ignore = [
330330

331331
[tool.numpydoc_validation]
332332
# See https://numpydoc.readthedocs.io/en/latest/validation.html#built-in-validation-checks for list of checks
333-
checks = ["GL06", "GL07", "GL10", "PR03", "PR05", "PR06"]
333+
checks = [
334+
"GL06",
335+
"GL07",
336+
"GL09",
337+
"GL10",
338+
"SS02",
339+
"SS04",
340+
"PR02",
341+
"PR03",
342+
"PR05",
343+
"PR06",
344+
]

src/zarr/abc/codec.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def evolve_from_array_spec(self, array_spec: ArraySpec) -> Self:
8585
8686
Parameters
8787
----------
88-
chunk_spec : ArraySpec
88+
array_spec : ArraySpec
8989
9090
Returns
9191
-------
@@ -99,11 +99,11 @@ def validate(self, *, shape: ChunkCoords, dtype: np.dtype[Any], chunk_grid: Chun
9999
100100
Parameters
101101
----------
102-
shape: ChunkCoords
102+
shape : ChunkCoords
103103
The array shape
104-
dtype: np.dtype[Any]
104+
dtype : np.dtype[Any]
105105
The array data type
106-
chunk_grid: ChunkGrid
106+
chunk_grid : ChunkGrid
107107
The array chunk grid
108108
"""
109109
...
@@ -292,11 +292,11 @@ def validate(self, *, shape: ChunkCoords, dtype: np.dtype[Any], chunk_grid: Chun
292292
293293
Parameters
294294
----------
295-
shape: ChunkCoords
295+
shape : ChunkCoords
296296
The array shape
297-
dtype: np.dtype[Any]
297+
dtype : np.dtype[Any]
298298
The array data type
299-
chunk_grid: ChunkGrid
299+
chunk_grid : ChunkGrid
300300
The array chunk grid
301301
"""
302302
...
@@ -308,7 +308,7 @@ def compute_encoded_size(self, byte_length: int, array_spec: ArraySpec) -> int:
308308
309309
Parameters
310310
----------
311-
input_byte_length : int
311+
byte_length : int
312312
array_spec : ArraySpec
313313
314314
Returns
@@ -327,7 +327,7 @@ async def decode(
327327
328328
Parameters
329329
----------
330-
chunks_and_specs : Iterable[tuple[Buffer | None, ArraySpec]]
330+
chunk_bytes_and_specs : Iterable[tuple[Buffer | None, ArraySpec]]
331331
Ordered set of encoded chunks with their accompanying chunk spec.
332332
333333
Returns
@@ -346,7 +346,7 @@ async def encode(
346346
347347
Parameters
348348
----------
349-
chunks_and_specs : Iterable[tuple[NDBuffer | None, ArraySpec]]
349+
chunk_arrays_and_specs : Iterable[tuple[NDBuffer | None, ArraySpec]]
350350
Ordered set of to-be-encoded chunks with their accompanying chunk spec.
351351
352352
Returns

src/zarr/abc/store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def with_mode(self, mode: AccessModeLiteral) -> Self:
163163
164164
Parameters
165165
----------
166-
mode: AccessModeLiteral
166+
mode : AccessModeLiteral
167167
The new mode to use.
168168
169169
Returns

src/zarr/api/asynchronous.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868

6969

7070
def _get_shape_chunks(a: ArrayLike | Any) -> tuple[ChunkCoords | None, ChunkCoords | None]:
71-
"""helper function to get the shape and chunks from an array-like object"""
71+
"""Helper function to get the shape and chunks from an array-like object"""
7272
shape = None
7373
chunks = None
7474

@@ -86,7 +86,7 @@ def _get_shape_chunks(a: ArrayLike | Any) -> tuple[ChunkCoords | None, ChunkCoor
8686

8787

8888
def _like_args(a: ArrayLike, kwargs: dict[str, Any]) -> dict[str, Any]:
89-
"""set default values for shape and chunks if they are not present in the array-like object"""
89+
"""Set default values for shape and chunks if they are not present in the array-like object"""
9090

9191
new = kwargs.copy()
9292

@@ -121,7 +121,7 @@ def _like_args(a: ArrayLike, kwargs: dict[str, Any]) -> dict[str, Any]:
121121
def _handle_zarr_version_or_format(
122122
*, zarr_version: ZarrFormat | None, zarr_format: ZarrFormat | None
123123
) -> ZarrFormat | None:
124-
"""handle the deprecated zarr_version kwarg and return zarr_format"""
124+
"""Handle the deprecated zarr_version kwarg and return zarr_format"""
125125
if zarr_format is not None and zarr_version is not None and zarr_format != zarr_version:
126126
raise ValueError(
127127
f"zarr_format {zarr_format} does not match zarr_version {zarr_version}, please only set one"
@@ -135,7 +135,7 @@ def _handle_zarr_version_or_format(
135135

136136

137137
def _default_zarr_version() -> ZarrFormat:
138-
"""return the default zarr_version"""
138+
"""Return the default zarr_version"""
139139
return cast(ZarrFormat, int(config.get("default_zarr_version", 3)))
140140

141141

@@ -152,9 +152,9 @@ async def consolidate_metadata(
152152
153153
Parameters
154154
----------
155-
store: StoreLike
155+
store : StoreLike
156156
The store-like object whose metadata you wish to consolidate.
157-
path: str, optional
157+
path : str, optional
158158
A path to a group in the store to consolidate at. Only children
159159
below that group will be consolidated.
160160
@@ -341,13 +341,13 @@ async def save(
341341
----------
342342
store : Store or str
343343
Store or path to directory in file system or name of zip file.
344-
args : ndarray
344+
*args : ndarray
345345
NumPy arrays with data to save.
346346
zarr_format : {2, 3, None}, optional
347347
The zarr format to use when saving.
348348
path : str or None, optional
349349
The path within the group where the arrays will be saved.
350-
kwargs
350+
**kwargs
351351
NumPy arrays with data to save.
352352
"""
353353
zarr_format = _handle_zarr_version_or_format(zarr_version=zarr_version, zarr_format=zarr_format)
@@ -386,7 +386,7 @@ async def save_array(
386386
storage_options : dict
387387
If using an fsspec URL to create the store, these will be passed to
388388
the backend implementation. Ignored otherwise.
389-
kwargs
389+
**kwargs
390390
Passed through to :func:`create`, e.g., compressor.
391391
"""
392392
zarr_format = (
@@ -423,7 +423,7 @@ async def save_group(
423423
----------
424424
store : Store or str
425425
Store or path to directory in file system or name of zip file.
426-
args : ndarray
426+
*args : ndarray
427427
NumPy arrays with data to save.
428428
zarr_format : {2, 3, None}, optional
429429
The zarr format to use when saving.
@@ -432,7 +432,7 @@ async def save_group(
432432
storage_options : dict
433433
If using an fsspec URL to create the store, these will be passed to
434434
the backend implementation. Ignored otherwise.
435-
kwargs
435+
**kwargs
436436
NumPy arrays with data to save.
437437
"""
438438
zarr_format = (
@@ -479,7 +479,7 @@ async def array(
479479
----------
480480
data : array_like
481481
The data to fill the array with.
482-
kwargs
482+
**kwargs
483483
Passed through to :func:`create`.
484484
485485
Returns

src/zarr/core/array.py

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,6 @@ class AsyncArray(Generic[T_ArrayMetadata]):
185185
The metadata of the array.
186186
store_path : StorePath
187187
The path to the Zarr store.
188-
codec_pipeline : CodecPipeline, optional
189-
The codec pipeline used for encoding and decoding chunks, by default None.
190188
order : {'C', 'F'}, optional
191189
The order of the array data in memory, by default None.
192190
@@ -858,9 +856,9 @@ def _iter_chunk_coords(
858856
859857
Parameters
860858
----------
861-
origin: Sequence[int] | None, default=None
859+
origin : Sequence[int] | None, default=None
862860
The origin of the selection relative to the array's chunk grid.
863-
selection_shape: Sequence[int] | None, default=None
861+
selection_shape : Sequence[int] | None, default=None
864862
The shape of the selection in chunk grid coordinates.
865863
866864
Yields
@@ -879,9 +877,9 @@ def _iter_chunk_keys(
879877
880878
Parameters
881879
----------
882-
origin: Sequence[int] | None, default=None
880+
origin : Sequence[int] | None, default=None
883881
The origin of the selection relative to the array's chunk grid.
884-
selection_shape: Sequence[int] | None, default=None
882+
selection_shape : Sequence[int] | None, default=None
885883
The shape of the selection in chunk grid coordinates.
886884
887885
Yields
@@ -902,9 +900,9 @@ def _iter_chunk_regions(
902900
903901
Parameters
904902
----------
905-
origin: Sequence[int] | None, default=None
903+
origin : Sequence[int] | None, default=None
906904
The origin of the selection relative to the array's chunk grid.
907-
selection_shape: Sequence[int] | None, default=None
905+
selection_shape : Sequence[int] | None, default=None
908906
The shape of the selection in chunk grid coordinates.
909907
910908
Yields
@@ -1152,17 +1150,7 @@ async def info(self) -> None:
11521150

11531151
@dataclass(frozen=True)
11541152
class Array:
1155-
"""Instantiate an array from an initialized store.
1156-
1157-
Parameters
1158-
----------
1159-
store : StoreLike
1160-
The array store that has already been initialized.
1161-
shape : ChunkCoords
1162-
The shape of the array.
1163-
dtype : npt.DTypeLike
1164-
The dtype of the array.
1165-
"""
1153+
"""Instantiate an array from an initialized store."""
11661154

11671155
_async_array: AsyncArray[ArrayV3Metadata] | AsyncArray[ArrayV2Metadata]
11681156

@@ -1420,9 +1408,9 @@ def _iter_chunk_coords(
14201408
14211409
Parameters
14221410
----------
1423-
origin: Sequence[int] | None, default=None
1411+
origin : Sequence[int] | None, default=None
14241412
The origin of the selection relative to the array's chunk grid.
1425-
selection_shape: Sequence[int] | None, default=None
1413+
selection_shape : Sequence[int] | None, default=None
14261414
The shape of the selection in chunk grid coordinates.
14271415
14281416
Yields
@@ -1457,9 +1445,9 @@ def _iter_chunk_keys(
14571445
14581446
Parameters
14591447
----------
1460-
origin: Sequence[int] | None, default=None
1448+
origin : Sequence[int] | None, default=None
14611449
The origin of the selection relative to the array's chunk grid.
1462-
selection_shape: Sequence[int] | None, default=None
1450+
selection_shape : Sequence[int] | None, default=None
14631451
The shape of the selection in chunk grid coordinates.
14641452
14651453
Yields
@@ -1479,9 +1467,9 @@ def _iter_chunk_regions(
14791467
14801468
Parameters
14811469
----------
1482-
origin: Sequence[int] | None, default=None
1470+
origin : Sequence[int] | None, default=None
14831471
The origin of the selection relative to the array's chunk grid.
1484-
selection_shape: Sequence[int] | None, default=None
1472+
selection_shape : Sequence[int] | None, default=None
14851473
The shape of the selection in chunk grid coordinates.
14861474
14871475
Yields
@@ -2232,7 +2220,7 @@ def get_mask_selection(
22322220
22332221
Parameters
22342222
----------
2235-
selection : ndarray, bool
2223+
mask : ndarray, bool
22362224
A Boolean array of the same shape as the array against which the selection is
22372225
being made.
22382226
out : NDBuffer, optional
@@ -2315,7 +2303,7 @@ def set_mask_selection(
23152303
23162304
Parameters
23172305
----------
2318-
selection : ndarray, bool
2306+
mask : ndarray, bool
23192307
A Boolean array of the same shape as the array against which the selection is
23202308
being made.
23212309
value : npt.ArrayLike

src/zarr/core/buffer/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ class NDBuffer:
308308
309309
Parameters
310310
----------
311-
ndarray_like
311+
array : ndarray_like
312312
ndarray-like object that is convertible to a regular Numpy array.
313313
"""
314314

src/zarr/core/buffer/cpu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class NDBuffer(core.NDBuffer):
138138
139139
Parameters
140140
----------
141-
ndarray_like
141+
array
142142
ndarray-like object that is convertible to a regular Numpy array.
143143
"""
144144

src/zarr/core/buffer/gpu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class NDBuffer(core.NDBuffer):
132132
133133
Parameters
134134
----------
135-
ndarray_like
135+
array
136136
ndarray-like object that is convertible to a regular Numpy array.
137137
"""
138138

src/zarr/core/chunk_grids.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ def _guess_chunks(
4242
4343
Parameters
4444
----------
45-
shape: ChunkCoords
45+
shape : ChunkCoords
4646
The chunk shape.
47-
typesize: int
47+
typesize : int
4848
The size, in bytes, of each element of the chunk.
49-
increment_bytes: int = 256 * 1024
49+
increment_bytes : int = 256 * 1024
5050
The number of bytes used to increment or decrement the target chunk size in bytes.
51-
min_bytes: int = 128 * 1024
51+
min_bytes : int = 128 * 1024
5252
The soft lower bound on the final chunk size in bytes.
53-
max_bytes: int = 64 * 1024 * 1024
53+
max_bytes : int = 64 * 1024 * 1024
5454
The hard upper bound on the final chunk size in bytes.
5555
5656
Returns

0 commit comments

Comments
 (0)