Skip to content

Commit 2271067

Browse files
authored
Update docs for user-facing create_array api on on Group. (#3375)
* new doc message for creating arrays with data * also change create_array data docs in api
1 parent c21d1f9 commit 2271067

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/zarr/api/synchronous.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -783,13 +783,12 @@ def create_array(
783783
The name of the array within the store. If ``name`` is ``None``, the array will be located
784784
at the root of the store.
785785
shape : ChunkCoords, optional
786-
Shape of the array. Can be ``None`` if ``data`` is provided.
786+
Shape of the array. Must be ``None`` if ``data`` is provided.
787787
dtype : ZDTypeLike, optional
788-
Data type of the array. Can be ``None`` if ``data`` is provided.
788+
Data type of the array. Must be ``None`` if ``data`` is provided.
789789
data : np.ndarray, optional
790790
Array-like data to use for initializing the array. If this parameter is provided, the
791-
``shape`` and ``dtype`` parameters must be identical to ``data.shape`` and ``data.dtype``,
792-
or ``None``.
791+
``shape`` and ``dtype`` parameters must be ``None``.
793792
chunks : ChunkCoords, optional
794793
Chunk shape of the array.
795794
If not specified, default are guessed based on the shape and dtype.

src/zarr/core/group.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2476,12 +2476,11 @@ def create_array(
24762476
The name of the array relative to the group. If ``path`` is ``None``, the array will be located
24772477
at the root of the store.
24782478
shape : ChunkCoords, optional
2479-
Shape of the array. Can be ``None`` if ``data`` is provided.
2479+
Shape of the array. Must be ``None`` if ``data`` is provided.
24802480
dtype : npt.DTypeLike | None
2481-
Data type of the array. Can be ``None`` if ``data`` is provided.
2481+
Data type of the array. Must be ``None`` if ``data`` is provided.
24822482
data : Array-like data to use for initializing the array. If this parameter is provided, the
2483-
``shape`` and ``dtype`` parameters must be identical to ``data.shape`` and ``data.dtype``,
2484-
or ``None``.
2483+
``shape`` and ``dtype`` parameters must be ``None``.
24852484
chunks : ChunkCoords, optional
24862485
Chunk shape of the array.
24872486
If not specified, default are guessed based on the shape and dtype.

0 commit comments

Comments
 (0)