tensorstore.Schema.__getitem__(self, domain: IndexDomain) Schema

Transforms the schema using an explicit index domain.

The domain of the resultant spec is computed as in IndexDomain.__getitem__(domain).

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

Index domain, must have dimension labels that can be aligned to self.domain.

Returns:

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

Raises:

ValueError – If self.rank is None.