tensorstore.Spec.vindex[self, indices: NumpyIndexingSpec] Spec

Transforms the spec using NumPy-style indexing with vectorized indexing semantics.

This is similar to __getitem__(indices), but differs in that if indices specifies any array indexing terms, the broadcasted array dimensions are unconditionally added as the first dimensions of the result domain.

Example

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

New spec with the indexing operation applied.

Raises:

ValueError – If self.transform is None.