tensorstore.Schema.__getitem__(self, expr: DimExpression) Schema

Transforms the schema using a dimension expression.

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]),
... )
>>> schema[ts.d['x', 'z'][5:10, 6:9]]
Schema({
  'chunk_layout': {'grid_origin': [100, 200, 300], 'inner_order': [0, 1, 2]},
  'domain': {
    'exclusive_max': [10, 2000, 9],
    'inclusive_min': [5, 0, 6],
    'labels': ['x', 'y', 'z'],
  },
  'rank': 3,
})
Returns:

New schema with domain equal to self.domain[expr].

Raises:

ValueError – If self.rank is None.