class tensorstore_demo.IndexDomain[source]

Domain (including bounds and optional dimension labels) of an N-dimensional index space.

Logically, an IndexDomain is the cartesian product of a sequence of Dim objects.

Note

Index domains are immutable, but dimension expressions may be applied using __getitem__(expr) to obtain a modified domain.

Constructors

IndexDomain(rank: int | None = None*...)

Constructs an index domain from component vectors.

IndexDomain(dimensions: collections.abc.Sequence[Dim])

Constructs an index domain from a :py:class`.Dim` sequence.

IndexDomain(*json: Any)

Constructs an index domain from its JSON representation.

Sequence accessors

__getitem__(identifier: int | str-> Dim

Returns the single dimension specified by identifier.

Indexing

__getitem__(selection: Any-> IndexDomain

Returns a new domain with a subset of the dimensions.

__getitem__(other: IndexDomain-> IndexDomain

Slices this domain by another domain.

__getitem__(expr: DimExpression-> IndexDomain

Transforms the domain by a dimension expression.

__getitem__(transform: Any-> IndexDomain

Transforms the domain using an explicit index transform.

Accessors

to_json(-> Any[source]

Returns the JSON representation.

property exclusive_maxtuple[int, ...]

Exclusive upper bound of the domain.

property inclusive_mintuple[int, ...]

Inclusive lower bound of the domain, alias of origin.

property labelstuple[str, ...]

Dimension labels for each dimension.

property origintuple[int, ...]

Inclusive lower bound of the domain.

property rankint

Number of dimensions in the index space.

property shapetuple[int, ...]

Shape of the domain.

property sizeint

Total number of elements in the domain.


Last update: Dec 16, 2024