-
tensorstore.ChunkLayout(*, rank: int | None =
None
, inner_order: Sequence[int] | None =None
, inner_order_soft_constraint: Sequence[int] | None =None
, grid_origin: Sequence[int | None] | None =None
, grid_origin_soft_constraint: Sequence[int | None] | None =None
, chunk: ChunkLayout.Grid | None =None
, write_chunk: ChunkLayout.Grid | None =None
, read_chunk: ChunkLayout.Grid | None =None
, codec_chunk: ChunkLayout.Grid | None =None
, chunk_shape: Sequence[int | None] | None =None
, chunk_shape_soft_constraint: Sequence[int | None] | None =None
, write_chunk_shape: Sequence[int | None] | None =None
, write_chunk_shape_soft_constraint: Sequence[int | None] | None =None
, read_chunk_shape: Sequence[int | None] | None =None
, read_chunk_shape_soft_constraint: Sequence[int | None] | None =None
, codec_chunk_shape: Sequence[int | None] | None =None
, codec_chunk_shape_soft_constraint: Sequence[int | None] | None =None
, chunk_aspect_ratio: Sequence[float | None] | None =None
, chunk_aspect_ratio_soft_constraint: Sequence[float | None] | None =None
, write_chunk_aspect_ratio: Sequence[float | None] | None =None
, write_chunk_aspect_ratio_soft_constraint: Sequence[float | None] | None =None
, read_chunk_aspect_ratio: Sequence[float | None] | None =None
, read_chunk_aspect_ratio_soft_constraint: Sequence[float | None] | None =None
, codec_chunk_aspect_ratio: Sequence[float | None] | None =None
, codec_chunk_aspect_ratio_soft_constraint: Sequence[float | None] | None =None
, chunk_elements: int | None =None
, chunk_elements_soft_constraint: int | None =None
, write_chunk_elements: int | None =None
, write_chunk_elements_soft_constraint: int | None =None
, read_chunk_elements: int | None =None
, read_chunk_elements_soft_constraint: int | None =None
, codec_chunk_elements: int | None =None
, codec_chunk_elements_soft_constraint: int | None =None
, finalize: bool | None =None
) Constructs from component parts.
- Parameters:¶
- rank: int | None =
None
¶ Specifies the number of dimensions.
- inner_order: Sequence[int] | None =
None
¶ Permutation specifying the element storage order within the innermost chunks. Corresponds to the JSON
ChunkLayout.inner_order
member. This must be a permutation of[0, 1, ..., rank-1]
. Lexicographic order (i.e. C order/row-major order) is specified as[0, 1, ..., rank-1]
, while colexicographic order (i.e. Fortran order/column-major order) is specified as[rank-1, ..., 1, 0]
.- inner_order_soft_constraint: Sequence[int] | None =
None
¶ Specifies a preferred value for
inner_order
rather than a hard constraint. Corresponds to the JSONChunkLayout.inner_order_soft_constraint
member. Ifinner_order
is also specified, it takes precedence.- grid_origin: Sequence[int | None] | None =
None
¶ Hard constraints on the origin of the chunk grid. Corresponds to the JSON
ChunkLayout.grid_origin
member.- grid_origin_soft_constraint: Sequence[int | None] | None =
None
¶ Soft constraints on the origin of the chunk grid. Corresponds to the JSON
ChunkLayout.grid_origin_soft_constraint
member.- chunk: ChunkLayout.Grid | None =
None
¶ Common constraints on write, read, and codec chunks. Corresponds to the JSON
ChunkLayout.chunk
member. Theshape
andelements
constraints apply only to write and read chunks, while theaspect_ratio
constraints apply to write, read, and codec chunks.- write_chunk: ChunkLayout.Grid | None =
None
¶ Constraints on write chunks. Corresponds to the JSON
ChunkLayout.write_chunk
member.- read_chunk: ChunkLayout.Grid | None =
None
¶ Constraints on read chunks. Corresponds to the JSON
ChunkLayout.read_chunk
member.- codec_chunk: ChunkLayout.Grid | None =
None
¶ Constraints on codec chunks. Corresponds to the JSON
ChunkLayout.codec_chunk
member.- chunk_shape: Sequence[int | None] | None =
None
¶ Hard constraints on both the write and read chunk shape. Corresponds to the JSON
shape
member ofChunkLayout.chunk
. Equivalent to specifying bothwrite_chunk_shape
andread_chunk_shape
.- chunk_shape_soft_constraint: Sequence[int | None] | None =
None
¶ Soft constraints on both the write and read chunk shape. Corresponds to the JSON
shape_soft_constraint
member ofChunkLayout.chunk
. Equivalent to specifying bothwrite_chunk_shape_soft_constraint
andread_chunk_shape_soft_constraint
.- write_chunk_shape: Sequence[int | None] | None =
None
¶ Hard constraints on the write chunk shape. Corresponds to the JSON
shape
member ofChunkLayout.write_chunk
.- write_chunk_shape_soft_constraint: Sequence[int | None] | None =
None
¶ Soft constraints on the write chunk shape. Corresponds to the JSON
shape_soft_constraint
member ofChunkLayout.write_chunk
.- read_chunk_shape: Sequence[int | None] | None =
None
¶ Hard constraints on the read chunk shape. Corresponds to the JSON
shape
member ofChunkLayout.read_chunk
.- read_chunk_shape_soft_constraint: Sequence[int | None] | None =
None
¶ Soft constraints on the read chunk shape. Corresponds to the JSON
shape_soft_constraint
member ofChunkLayout.read_chunk
.- codec_chunk_shape: Sequence[int | None] | None =
None
¶ Soft constraints on the codec chunk shape. Corresponds to the JSON
shape
member ofChunkLayout.codec_chunk
.- codec_chunk_shape_soft_constraint: Sequence[int | None] | None =
None
¶ Soft constraints on the codec chunk shape. Corresponds to the JSON
shape_soft_constraint
member ofChunkLayout.codec_chunk
.- chunk_aspect_ratio: Sequence[float | None] | None =
None
¶ Hard constraints on the write, read, and codec chunk aspect ratio. Corresponds to the JSON
aspect_ratio
member ofChunkLayout.chunk
. Equivalent to specifyingwrite_chunk_aspect_ratio
,read_chunk_aspect_ratio
, andcodec_chunk_aspect_ratio
.- chunk_aspect_ratio_soft_constraint: Sequence[float | None] | None =
None
¶ Soft constraints on the write, read, and codec chunk aspect ratio. Corresponds to the
aspect_ratio_soft_constraint
member ofChunkLayout.chunk
. Equivalent to specifyingwrite_chunk_aspect_ratio_soft_constraint
,read_chunk_aspect_ratio_soft_constraint
, andcodec_chunk_aspect_ratio_soft_constraint
.- write_chunk_aspect_ratio: Sequence[float | None] | None =
None
¶ Hard constraints on the write chunk aspect ratio. Corresponds to the JSON
aspect_ratio
member ofChunkLayout.write_chunk
.- write_chunk_aspect_ratio_soft_constraint: Sequence[float | None] | None =
None
¶ Soft constraints on the write chunk aspect ratio. Corresponds to the JSON
aspect_ratio_soft_constraint
member ofChunkLayout.write_chunk
.- read_chunk_aspect_ratio: Sequence[float | None] | None =
None
¶ Hard constraints on the read chunk aspect ratio. Corresponds to the JSON
aspect_ratio
member ofChunkLayout.read_chunk
.- read_chunk_aspect_ratio_soft_constraint: Sequence[float | None] | None =
None
¶ Soft constraints on the read chunk aspect ratio. Corresponds to the JSON
aspect_ratio_soft_constraint
member ofChunkLayout.read_chunk
.- codec_chunk_aspect_ratio: Sequence[float | None] | None =
None
¶ Soft constraints on the codec chunk aspect ratio. Corresponds to the JSON
aspect_ratio
member ofChunkLayout.codec_chunk
.- codec_chunk_aspect_ratio_soft_constraint: Sequence[float | None] | None =
None
¶ Soft constraints on the codec chunk aspect ratio. Corresponds to the JSON
aspect_ratio_soft_constraint
member ofChunkLayout.codec_chunk
.- chunk_elements: int | None =
None
¶ Hard constraints on the target number of elements for write and read chunks. Corresponds to the JSON
elements
member ofChunkLayout.chunk
. Equivalent to specifying bothwrite_chunk_elements
andread_chunk_elements
.- chunk_elements_soft_constraint: int | None =
None
¶ Soft constraints on the target number of elements for write and read chunks. Corresponds to the JSON
elements_soft_constraint
member ofChunkLayout.chunk
. Equivalent to specifying bothwrite_chunk_elements_soft_constraint
andread_chunk_elements_soft_constraint
.- write_chunk_elements: int | None =
None
¶ Hard constraints on the target number of elements for write chunks. Corresponds to the JSON
elements
member ofChunkLayout.write_chunk
.- write_chunk_elements_soft_constraint: int | None =
None
¶ Soft constraints on the target number of elements for write chunks. Corresponds to the JSON
elements_soft_constraint
member ofChunkLayout.write_chunk
.- read_chunk_elements: int | None =
None
¶ Hard constraints on the target number of elements for read chunks. Corresponds to the JSON
elements
member ofChunkLayout.read_chunk
.- read_chunk_elements_soft_constraint: int | None =
None
¶ Soft constraints on the target number of elements for read chunks. Corresponds to the JSON
elements_soft_constraint
member ofChunkLayout.read_chunk
.- codec_chunk_elements: int | None =
None
¶ Hard constraints on the target number of elements for codec chunks. Corresponds to the JSON
elements
member ofChunkLayout.codec_chunk
.- codec_chunk_elements_soft_constraint: int | None =
None
¶ Soft constraints on the target number of elements for codec chunks. Corresponds to the JSON
elements_soft_constraint
member ofChunkLayout.codec_chunk
.- finalize: bool | None =
None
¶ Validates and converts the layout into a precise chunk layout.
All dimensions of
grid_origin
must be specified as hard constraints.Any write/read/codec chunk
shape
soft constraints are cleared.Any unspecified dimensions of the read chunk shape are set from the write chunk shape.
Any write/read/codec chunk
aspect_ratio
orelements
constraints are cleared.
- rank: int | None =