class tensorstore.IndexDomain

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.

See also

Constructors

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

Constructs an index domain from component vectors.

IndexDomain(dimensions: Sequence[Dim])

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

IndexDomain(*, json: Any)

Constructs an index domain from its JSON representation.

Accessors

rank : int

Number of dimensions in the index space.

ndim : int

Alias for rank.

origin : Tuple[int, ...]

Inclusive lower bound of the domain.

inclusive_min : Tuple[int, ...]

Inclusive lower bound of the domain, alias of origin.

shape : Tuple[int, ...]

Shape of the domain.

exclusive_max : Tuple[int, ...]

Exclusive upper bound of the domain.

inclusive_max : Tuple[int, ...]

Inclusive upper bound of the domain.

labels : Tuple[str, ...]

Dimension labels for each dimension.

implicit_lower_bounds : Tuple[bool, ...]

Indicates whether the lower bound of each dimension is implicit or explicit.

implicit_upper_bounds : Tuple[bool, ...]

Indicates whether the upper bound of each dimension is implicit or explicit.

size : int

Total number of elements in the domain.

index_exp : Tuple[slice, ...]

Equivalent NumPy-compatible index expression.

to_json() Any

Returns the JSON representation.

Sequence accessors

__len__() int

Returns the number of dimensions (rank).

__getitem__(identifier: int | str) Dim

Returns the single dimension specified by identifier.

Indexing

__getitem__(selection: DimSelectionLike) 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: IndexTransform) IndexDomain

Transforms the domain using an explicit index transform.

Geometric operations

intersect(other: IndexDomain) IndexDomain

Intersects with another domain.

hull(other: IndexDomain) IndexDomain

Computes the hull (minimum containing box) with another domain.

String representation

__repr__() str

Returns the string representation.