diff --git a/changes/3391.feature.rst b/changes/3391.feature.rst new file mode 100644 index 0000000000..45a1472a2c --- /dev/null +++ b/changes/3391.feature.rst @@ -0,0 +1 @@ +Make config param optional in init_array diff --git a/src/zarr/core/array.py b/src/zarr/core/array.py index 4b34c31de1..47d9dc1047 100644 --- a/src/zarr/core/array.py +++ b/src/zarr/core/array.py @@ -4444,7 +4444,7 @@ async def init_array( chunk_key_encoding: ChunkKeyEncodingLike | None = None, dimension_names: DimensionNames = None, overwrite: bool = False, - config: ArrayConfigLike | None, + config: ArrayConfigLike | None = None, ) -> AsyncArray[ArrayV3Metadata] | AsyncArray[ArrayV2Metadata]: """Create and persist an array metadata document. @@ -4524,8 +4524,10 @@ async def init_array( Zarr format 3 only. Zarr format 2 arrays should not use this parameter. overwrite : bool, default False Whether to overwrite an array with the same name in the store, if one exists. - config : ArrayConfigLike or None, optional + config : ArrayConfigLike or None, default=None Configuration for this array. + If ``None``, the default array runtime configuration will be used. This default + is stored in the global configuration object. Returns ------- diff --git a/src/zarr/testing/utils.py b/src/zarr/testing/utils.py index 3cb7f5cb99..2a4c3e45c5 100644 --- a/src/zarr/testing/utils.py +++ b/src/zarr/testing/utils.py @@ -46,4 +46,4 @@ def has_cupy() -> bool: # Decorator for GPU tests def gpu_test(func: T) -> T: - return cast("T", gpu_mark(skip_if_no_gpu(func))) + return cast(T, gpu_mark(skip_if_no_gpu(func))) diff --git a/tests/test_api.py b/tests/test_api.py index 3668ef306a..68cdab37da 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -440,7 +440,6 @@ async def test_init_order_warns() -> None: store_path=StorePath(store=MemoryStore()), shape=(1,), dtype="uint8", - config=None, zarr_format=3, order="F", )