Skip to content

Commit ddd3827

Browse files
committed
Make init_array config optional.
* Add default value to init_array config param. * Update docstring. * Add changelog entry. * Fix type casting typo.
1 parent 6a546d6 commit ddd3827

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

changes/3391.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Make config param optional in init_array

src/zarr/core/array.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4206,7 +4206,7 @@ async def init_array(
42064206
chunk_key_encoding: ChunkKeyEncodingLike | None = None,
42074207
dimension_names: DimensionNames = None,
42084208
overwrite: bool = False,
4209-
config: ArrayConfigLike | None,
4209+
config: ArrayConfigLike | None = None,
42104210
) -> AsyncArray[ArrayV3Metadata] | AsyncArray[ArrayV2Metadata]:
42114211
"""Create and persist an array metadata document.
42124212
@@ -4287,7 +4287,7 @@ async def init_array(
42874287
overwrite : bool, default False
42884288
Whether to overwrite an array with the same name in the store, if one exists.
42894289
config : ArrayConfigLike or None, optional
4290-
Configuration for this array.
4290+
Configuration for this array (default is None).
42914291
42924292
Returns
42934293
-------

src/zarr/testing/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ def has_cupy() -> bool:
4646

4747
# Decorator for GPU tests
4848
def gpu_test(func: T) -> T:
49-
return cast("T", gpu_mark(skip_if_no_gpu(func)))
49+
return cast(T, gpu_mark(skip_if_no_gpu(func)))

tests/test_api.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,6 @@ async def test_init_order_warns() -> None:
417417
store_path=StorePath(store=MemoryStore()),
418418
shape=(1,),
419419
dtype="uint8",
420-
config=None,
421420
zarr_format=3,
422421
order="F",
423422
)

0 commit comments

Comments
 (0)