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

Transforms the spec using a dimension expression.

Example

>>> spec = ts.Spec({
...     'driver': 'zarr',
...     'kvstore': {
...         'driver': 'memory'
...     },
...     'transform': {
...         'input_shape': [[60], [70], [80]],
...         'input_labels': ['x', 'y', 'z'],
...     }
... })
>>> spec[ts.d['x', 'z'][5:10, 6:9]]
Spec({
  'driver': 'zarr',
  'kvstore': {'driver': 'memory'},
  'transform': {
    'input_exclusive_max': [10, [70], 9],
    'input_inclusive_min': [5, 0, 6],
    'input_labels': ['x', 'y', 'z'],
  },
})
Returns:

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

Raises:

ValueError – If self.transform is None.