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

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

Example

>>> spec = ts.Spec({
...     'driver': 'zarr',
...     'kvstore': {
...         'driver': 'memory'
...     },
...     'transform': {
...         'input_shape': [[70], [80]],
...     }
... })
>>> spec[[5, 10, 20], 6:10]
Spec({
  'driver': 'zarr',
  'kvstore': {'driver': 'memory'},
  'transform': {
    'input_exclusive_max': [3, 10],
    'input_inclusive_min': [0, 6],
    'output': [{'index_array': [[5], [10], [20]]}, {'input_dimension': 1}],
  },
})
Returns:

New spec with the indexing operation applied.

Raises:

ValueError – If self.transform is None.