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

Transforms the spec using an explicit index domain.

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

Example

>>> spec = ts.Spec({
...     'driver': 'zarr',
...     'kvstore': {
...         'driver': 'memory'
...     },
...     'transform': {
...         'input_shape': [[60], [70], [80]],
...         'input_labels': ['x', 'y', 'z'],
...     }
... })
>>> domain = ts.IndexDomain(labels=['x', 'z'],
...                         inclusive_min=[5, 6],
...                         exclusive_max=[8, 9])
>>> spec[domain]
Spec({
  'driver': 'zarr',
  'kvstore': {'driver': 'memory'},
  'transform': {
    'input_exclusive_max': [8, [70], 9],
    'input_inclusive_min': [5, 0, 6],
    'input_labels': ['x', 'y', 'z'],
  },
})
Parameters:
domain: IndexDomain

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

Returns:

New spec with transform equal to self.transform[domain].

Raises:

ValueError – If self.transform is None.