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

Computes a virtual view using a dimension expression.

Example

>>> dataset = await ts.open(
...     {
...         'driver': 'n5',
...         'kvstore': {
...             'driver': 'memory'
...         }
...     },
...     dtype=ts.uint32,
...     domain=ts.IndexDomain(shape=[60, 70, 80], labels=['x', 'y', 'z']),
...     create=True)
>>> dataset[ts.d['x', 'z'][5:10, 6:9]]
TensorStore({
  'context': {
    'cache_pool': {},
    'data_copy_concurrency': {},
    'memory_key_value_store': {},
  },
  'driver': 'n5',
  'dtype': 'uint32',
  'kvstore': {'driver': 'memory'},
  'metadata': {
    'axes': ['x', 'y', 'z'],
    'blockSize': [60, 70, 80],
    'compression': {
      'blocksize': 0,
      'clevel': 5,
      'cname': 'lz4',
      'shuffle': 1,
      'type': 'blosc',
    },
    'dataType': 'uint32',
    'dimensions': [60, 70, 80],
  },
  'transform': {
    'input_exclusive_max': [10, [70], 9],
    'input_inclusive_min': [5, 0, 6],
    'input_labels': ['x', 'y', 'z'],
  },
})
Returns:

Virtual view with the dimension expression applied.