- class tensorstore.Spec
Specification for opening or creating a
TensorStore
.Constructors¶
- Spec(json: Any)
Constructs from the
JSON representation
.
Accessors¶
- transform : IndexTransform | None
The index transform, or
None
if unspecified.
- domain : IndexDomain | None
Effective index domain, including any constraints implied by driver-specific options.
- chunk_layout : ChunkLayout
Effective chunk layout, including any constraints implied by driver-specific options.
- codec : CodecSpec | None
Effective codec, including any constraints implied by driver-specific options.
- fill_value : ArrayLike | None
Effective fill value, including any constraints implied by driver-specific options.
- dimension_units : tuple[Unit | None, ...] | None
Effective physical units of each dimension of the domain, including any constraints implied by driver-specific options.
- kvstore : KvStore.Spec | None
Spec of the associated key-value store used as the underlying storage.
- base : Spec | None
Spec of the underlying
TensorStore
, if this is an adapter of a single underlyingTensorStore
.
-
to_json(include_defaults: bool =
False
) Any Converts to the
JSON representation
.
Indexing¶
- __getitem__(transform: IndexTransform) Spec
Transforms the spec using an explicit index transform.
- __getitem__(domain: IndexDomain) Spec
Transforms the spec using an explicit index domain.
- __getitem__(expr: DimExpression) Spec
Transforms the spec using a dimension expression.
- __getitem__(indices: NumpyIndexingSpec) Spec
Transforms the spec using NumPy-style indexing with default index array semantics.
- oindex[indices: NumpyIndexingSpec] Spec
Transforms the spec using NumPy-style indexing with outer indexing semantics.
- vindex[indices: NumpyIndexingSpec] Spec
Transforms the spec using NumPy-style indexing with vectorized indexing semantics.
- translate_to[origins: Sequence[int | None] | int | None] Spec
Returns a new view with
origin
translated to the specified origin.
- translate_by[offsets: Sequence[int | None] | int | None] Spec
Returns a new view with the
origin
translated by the specified offsets.
- translate_backward_by[offsets] Spec
Returns a new view with the
origin
translated backward by the specified offsets.
- mark_bounds_implicit[implicit: bool | None | slice] Spec
Returns a new view with the lower/upper bounds changed to implicit/explicit.
-
transpose(axes: DimSelectionLike | None =
None
) Spec Returns a view with a transposed domain.
Comparison operators¶
Mutators¶
-
update(*, open_mode: OpenMode | None =
None
, ...) None Adds additional constraints or changes the open mode.
String representation¶
- __repr__() str
Returns a string representation based on the
JSON representation
.