Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions src/zarr/core/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -1235,24 +1235,28 @@ def basename(self) -> str:
@property
def cdata_shape(self) -> tuple[int, ...]:
"""
The shape of the chunk grid for this array.
The number of chunks 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 chunks along each dimension.
"""
return self._chunk_grid_shape

@property
def _chunk_grid_shape(self) -> tuple[int, ...]:
"""
The shape of the chunk grid for this array.
The number of chunks 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 chunks along each dimension.
"""
return tuple(starmap(ceildiv, zip(self.shape, self.chunks, strict=True)))

Expand Down Expand Up @@ -2399,14 +2403,23 @@ 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 chunks along each dimension.

When sharding is used, this counts inner chunks (not shards) per dimension.
"""
return self.async_array._chunk_grid_shape

@property
def _chunk_grid_shape(self) -> tuple[int, ...]:
"""
The shape of the chunk grid for this array.
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 chunks along each dimension.
"""
return self.async_array._chunk_grid_shape

Expand Down
Loading