class tensorstore.Schema

Driver-independent options for defining a TensorStore schema.

Constructors

Schema(json: Any)

Constructs from its JSON representation.

Schema(*, rank: int | None = None, dtype: dtype | None = None, ...)

Constructs from component parts.

Mutators

update(*, rank: int | None = None, ...) None

Adds additional constraints.

Accessors

rank : int | None

Rank of the schema, or None if unspecified.

ndim : int | None

Alias for rank.

dtype : dtype | None

Data type, or None if unspecified.

domain : IndexDomain | None

Domain of the schema, or None if unspecified.

chunk_layout : ChunkLayout

Chunk layout constraints specified by the schema.

codec : CodecSpec | None

Codec constraints specified by the schema.

fill_value : array_like | None

Fill value specified by the schema.

dimension_units : Tuple[Unit | None, ...] | None

Physical units of each dimension of the domain.

to_json(include_defaults: bool = False) Any

Converts to the JSON representation.

copy() Schema

Returns a copy of the schema.

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.

String representation

__repr__() str

Returns a string representation based on the JSON representation.

Indexing

__getitem__(transform: IndexTransform) Schema

Transforms the schema using an explicit index transform.

__getitem__(domain: IndexDomain) Schema

Transforms the schema using an explicit index domain.

__getitem__(expr: DimExpression) Schema

Transforms the schema using a dimension expression.

__getitem__(indices: NumpyIndexingSpec) Schema

Transforms the schema using NumPy-style indexing with default index array semantics.

oindex[indices: NumpyIndexingSpec] Schema

Transforms the schema using NumPy-style indexing with outer indexing semantics.

vindex[indices: NumpyIndexingSpec] Schema

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

T : Schema

View with transposed domain (reversed dimension order).

Comparison operators

__eq__(other: Schema) bool

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