From d96c2020038a5339ee17af6755787c029939a073 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Thu, 24 Oct 2024 11:17:05 -0500 Subject: [PATCH] chunk info --- src/zarr/core/array.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/zarr/core/array.py b/src/zarr/core/array.py index 5dfc5d38d..184c70b9d 100644 --- a/src/zarr/core/array.py +++ b/src/zarr/core/array.py @@ -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,