tensorstore.Spec.to_json(self, include_defaults: bool = False) Any

Converts to the JSON representation.

Example

>>> spec = ts.Spec({
...     'driver': 'n5',
...     'kvstore': {
...         'driver': 'memory'
...     },
...     'metadata': {
...         'dimensions': [100, 200]
...     }
... })
>>> spec = spec[ts.d[0].translate_by[5]]
>>> spec.to_json()
{'driver': 'n5',
 'kvstore': {'driver': 'memory'},
 'metadata': {'dimensions': [100, 200]},
 'transform': {'input_exclusive_max': [[105], [200]],
               'input_inclusive_min': [5, 0],
               'output': [{'input_dimension': 0, 'offset': -5},
                          {'input_dimension': 1}]}}