class tensorstore.Spec

Specification for opening or creating a TensorStore.

Constructors

Spec(json: Any)

Constructs from the JSON representation.

Accessors

dtype : dtype | None

Data type, or None if unspecified.

transform : IndexTransform | None

The index transform, or None if unspecified.

domain : IndexDomain | None

Effective index domain, including any constraints implied by driver-specific options.

rank : int | None

Returns the rank of the domain, or None if unspecified.

ndim : int | None

Alias for rank.

schema : Schema

Effective schema, 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.

to_json(include_defaults: bool = False) Any

Converts to the JSON representation.

copy() Spec

Returns a copy of the spec.

origin : tuple[int, ...]

Inclusive lower bound of the domain.

shape : tuple[int, ...]

Shape of the domain.

size : int

Total number of elements in the domain.

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.

T : Spec

View with transposed domain (reversed dimension order).

Comparison operators

__eq__(other: Spec) bool

Compares with another Spec for equality based on the JSON representation.

Mutators

update(*, open: bool | None = None, ...) None

Adds additional constraints or changes the open mode.

String representation

__repr__() str

Returns a string representation based on the JSON representation.