move chunk grid off metadata#6
Conversation
| shape: tuple[int, ...], | ||
| dtype: ZDType[TBaseDType, TBaseScalar], | ||
| chunk_grid: ChunkGrid, | ||
| chunk_grid: ChunkGridMetadata, |
There was a problem hiding this comment.
this change will affect downstream implementations of the codec pipeline. I think that's just zarrs-python at this time.
| array_config: ArrayConfig, | ||
| prototype: BufferPrototype, | ||
| ) -> ArraySpec: | ||
| """Build an ArraySpec for a single chunk using the behavioral ChunkGrid.""" |
There was a problem hiding this comment.
claude is calling this a "behavioral chunkgrid" which is not my preferred phrasing. We would probably benefit from a different name to distinguish this python object from the chunk_grid field in array metadata
|
one thing that I struggled with is explaining to myself why the The reason for this is API we have not built yet: when we implement lazy slicing, we can use the chunk grid to model the set of chunks that support a sliced array. This leads to the following set of layers:
|
|
in zarr-python today, we have only formalized levels 1 and 3. The middle level is missing, but that's where the chunkgrid should sit |
|
Thanks @d-v-b! |
This PR moves the chunk grid object off the array metadata objects and on to the
AsyncArray.ArrayV3Metadata.chunk_gridis now a plain dataclass that serves to model the contents of array metadata.The logic for this change is that we want to keep the array metadata classes scoped to modelling the contents of array metadata. Giving these classes methods for array indexing complicates or even interferes with roles as models for array metadata documents.
TODO:
docs/user-guide/*.mdchanges/