Skip to content

Commit 39e05e9

Browse files
committed
add write_data attr to synchronous.create_array
1 parent 4ad7a5a commit 39e05e9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/zarr/api/synchronous.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,7 @@ def create_array(
763763
storage_options: dict[str, Any] | None = None,
764764
overwrite: bool = False,
765765
config: ArrayConfig | ArrayConfigLike | None = None,
766+
write_data: bool = True,
766767
) -> Array:
767768
"""Create an array.
768769
@@ -856,6 +857,11 @@ def create_array(
856857
Whether to overwrite an array with the same name in the store, if one exists.
857858
config : ArrayConfig or ArrayConfigLike, optional
858859
Runtime configuration for the array.
860+
write_data : bool
861+
If a pre-existing array-like object was provided to this function via the ``data`` parameter
862+
then ``write_data`` determines whether the values in that array-like object should be
863+
written to the Zarr array created by this function. If ``write_data`` is ``False``, then the
864+
array will be left empty.
859865
860866
Returns
861867
-------
@@ -896,6 +902,7 @@ def create_array(
896902
storage_options=storage_options,
897903
overwrite=overwrite,
898904
config=config,
905+
write_data=write_data,
899906
)
900907
)
901908
)

0 commit comments

Comments
 (0)