From b2d7049d3eee18205b81bab7283a12dadb21707f Mon Sep 17 00:00:00 2001 From: Max Jones <14077947+maxrjones@users.noreply.github.com> Date: Wed, 11 Mar 2026 13:26:14 -0400 Subject: [PATCH 1/3] docs: fix docstring for Array.cdata_shape --- src/zarr/core/array.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/zarr/core/array.py b/src/zarr/core/array.py index 564d0e915a..5a0777350b 100644 --- a/src/zarr/core/array.py +++ b/src/zarr/core/array.py @@ -1235,12 +1235,14 @@ def basename(self) -> str: @property def cdata_shape(self) -> tuple[int, ...]: """ - The shape of the chunk grid for this array. + The number of independently compressible units along each dimension. + + When sharding is used, this counts inner chunks (not shards) per dimension. Returns ------- tuple[int, ...] - The shape of the chunk grid for this array. + The number of independently compressible units along each dimension. """ return self._chunk_grid_shape @@ -2399,7 +2401,9 @@ def compressors(self) -> tuple[Numcodec, ...] | tuple[BytesBytesCodec, ...]: @property def cdata_shape(self) -> tuple[int, ...]: """ - The shape of the chunk grid for this array. + The number of independently compressible units along each dimension. + + When sharding is used, this counts inner chunks (not shards) per dimension. """ return self.async_array._chunk_grid_shape From 75c5bc555fe72d357e6124f704ca60a35a3bf5c9 Mon Sep 17 00:00:00 2001 From: Max Jones <14077947+maxrjones@users.noreply.github.com> Date: Wed, 11 Mar 2026 13:31:56 -0400 Subject: [PATCH 2/3] Fix more docstrings --- src/zarr/core/array.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/zarr/core/array.py b/src/zarr/core/array.py index 5a0777350b..8980f1ee1f 100644 --- a/src/zarr/core/array.py +++ b/src/zarr/core/array.py @@ -1249,12 +1249,14 @@ def cdata_shape(self) -> tuple[int, ...]: @property def _chunk_grid_shape(self) -> tuple[int, ...]: """ - The shape of the chunk grid for this array. + The number of independently compressible units along each dimension. + + When sharding is used, this counts inner chunks (not shards) per dimension. Returns ------- tuple[int, ...] - The shape of the chunk grid for this array. + The number of independently compressible units along each dimension. """ return tuple(starmap(ceildiv, zip(self.shape, self.chunks, strict=True))) @@ -2410,7 +2412,14 @@ def cdata_shape(self) -> tuple[int, ...]: @property def _chunk_grid_shape(self) -> tuple[int, ...]: """ - The shape of the chunk grid for this array. + The number of independently compressible units along each dimension. + + When sharding is used, this counts inner chunks (not shards) per dimension. + + Returns + ------- + tuple[int, ...] + The number of independently compressible units along each dimension. """ return self.async_array._chunk_grid_shape From 3c4b6db4d26010cb6534082ecb7a6e5dfadb3ac3 Mon Sep 17 00:00:00 2001 From: Max Jones <14077947+maxrjones@users.noreply.github.com> Date: Wed, 11 Mar 2026 13:38:17 -0400 Subject: [PATCH 3/3] Update array.py --- src/zarr/core/array.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/zarr/core/array.py b/src/zarr/core/array.py index 8980f1ee1f..486216fa32 100644 --- a/src/zarr/core/array.py +++ b/src/zarr/core/array.py @@ -1235,28 +1235,28 @@ def basename(self) -> str: @property def cdata_shape(self) -> tuple[int, ...]: """ - The number of independently compressible units along each dimension. + The number of chunks along each dimension. When sharding is used, this counts inner chunks (not shards) per dimension. Returns ------- tuple[int, ...] - The number of independently compressible units along each dimension. + The number of chunks along each dimension. """ return self._chunk_grid_shape @property def _chunk_grid_shape(self) -> tuple[int, ...]: """ - The number of independently compressible units along each dimension. + The number of chunks along each dimension. When sharding is used, this counts inner chunks (not shards) per dimension. Returns ------- tuple[int, ...] - The number of independently compressible units along each dimension. + The number of chunks along each dimension. """ return tuple(starmap(ceildiv, zip(self.shape, self.chunks, strict=True))) @@ -2403,7 +2403,7 @@ def compressors(self) -> tuple[Numcodec, ...] | tuple[BytesBytesCodec, ...]: @property def cdata_shape(self) -> tuple[int, ...]: """ - The number of independently compressible units along each dimension. + The number of chunks along each dimension. When sharding is used, this counts inner chunks (not shards) per dimension. """ @@ -2412,14 +2412,14 @@ def cdata_shape(self) -> tuple[int, ...]: @property def _chunk_grid_shape(self) -> tuple[int, ...]: """ - The number of independently compressible units along each dimension. + The number of chunks along each dimension. When sharding is used, this counts inner chunks (not shards) per dimension. Returns ------- tuple[int, ...] - The number of independently compressible units along each dimension. + The number of chunks along each dimension. """ return self.async_array._chunk_grid_shape