Skip to content

Commit

Permalink
chunk info
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAugspurger committed Oct 24, 2024
1 parent 5599da3 commit d96c202
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/zarr/core/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -1235,8 +1235,12 @@ def _info(self, extra: dict[str, int] | None = None) -> ArrayInfo:
kwargs["codecs"] = str(self.metadata.codecs)
kwargs["data_type"] = str(self.metadata.data_type)
# just regular?
if isinstance(self.metadata.chunk_grid, RegularChunkGrid):
kwargs["chunk_shape"] = self.metadata.chunk_grid.chunk_shape
chunk_grid = self.metadata.chunk_grid
if isinstance(chunk_grid, RegularChunkGrid):
kwargs["chunk_shape"] = chunk_grid.chunk_shape
else:
msg = f"'info' is not yet implemented for chunk grids of type {type(self.metadata.chunk_grid)}"
raise NotImplementedError(msg)

return ArrayInfo(
zarr_format=self.metadata.zarr_format,
Expand Down

0 comments on commit d96c202

Please sign in to comment.