File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ Reuse a constant ` ArraySpec ` during indexing when possible.
Original file line number Diff line number Diff line change @@ -5402,6 +5402,14 @@ def _get_default_chunk_spec(
54025402 For regular grids, all chunks have the same codec_shape, so we can
54035403 build the ArraySpec once and reuse it for every chunk — avoiding the
54045404 per-chunk ChunkGrid.__getitem__ + ArraySpec construction overhead.
5405+
5406+ .. note::
5407+ Ideally the per-chunk ArraySpec would not exist at all: dtype,
5408+ fill_value, config, and prototype are constant across chunks —
5409+ only the shape varies (and only for edge chunks). A cleaner
5410+ design would pass a single ArraySpec plus a per-chunk shape
5411+ override, which ChunkTransform.decode_chunk already supports
5412+ via its ``chunk_shape`` parameter.
54055413 """
54065414 if chunk_grid .is_regular :
54075415 return ArraySpec (
You can’t perform that action at this time.
0 commit comments