tensorstore.Schema.__getitem__(self, transform: IndexTransform) Schema

Transforms the schema using an explicit index transform.

Example

>>> schema = ts.Schema(
...     domain=ts.IndexDomain(labels=['x', 'y', 'z'],
...                           shape=[1000, 2000, 3000]),
...     chunk_layout=ts.ChunkLayout(grid_origin=[100, 200, 300],
...                                 inner_order=[0, 1, 2]),
... )
>>> transform = ts.IndexTransform(
...     input_shape=[3],
...     output=[
...         ts.OutputIndexMap(index_array=[1, 2, 3]),
...         ts.OutputIndexMap(index_array=[5, 4, 3])
...     ])
>>> schema[transform]
Traceback (most recent call last):
    ...
IndexError: Rank 3 -> 3 transform cannot be composed with rank 1 -> 2 transform...
Parameters:
transform: IndexTransform

Index transform, transform.output_rank must equal self.rank.

Returns:

New schema of rank transform.input_rank.

Raises:

ValueError – If self.rank is None.