tensorstore.Schema.__getitem__(self, indices: NumpyIndexingSpec) Schema

Transforms the schema using NumPy-style indexing with default index array semantics.

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[[5, 10, 20], 6:10]
Schema({
  'chunk_layout': {'grid_origin': [None, 200, 300], 'inner_order': [1, 2, 0]},
  'domain': {
    'exclusive_max': [3, 10, 3000],
    'inclusive_min': [0, 6, 0],
    'labels': ['', 'y', 'z'],
  },
  'rank': 3,
})
Returns:

New schema with the indexing operation applied.

Raises:

ValueError – If self.rank is None.