Skip to content

typing

These aliases name the shapes that recur throughout the metadata API. A constructor signature that accepts JSON, or an array shape, is written in terms of one of these names rather than its full expansion.

These aliases are documented here only to explain the names that appear in constructor signatures and attribute types. They are internal to the library and are not part of its public interface. Application code should not import them or depend on their definitions, which may change without notice.

abczarr._core.typing.JsonScalar module-attribute

JsonScalar = int | float | bool | str | None

A JSON scalar: a number, a boolean, a string, or null.

abczarr._core.typing.Json module-attribute

Json = JsonScalar | tx.Mapping[str, 'Json'] | BuiltinSequence['Json']

Any JSON value. A scalar, a mapping of string keys to JSON values, or a sequence of JSON values.

abczarr._core.typing.JsonDict module-attribute

JsonDict = tx.Mapping[str, Json]

A JSON object: a mapping of string keys to JSON values.

abczarr._core.typing.Shape module-attribute

Shape = tuple[BuiltinNonNegativeIntegral, ...]

An array or chunk shape: a tuple of non-negative integers, one per dimension.

The aliases above are built from these lower-level hints, shown so that each alias can be read all the way down.

abczarr._core.typing.BuiltinSequence module-attribute

BuiltinSequence = tuple[T, ...] | list[T]

A built-in sequence of one element type: a tuple or a list.

abczarr._core.typing.BuiltinNonNegativeIntegral module-attribute

BuiltinNonNegativeIntegral = tx.Annotated[BuiltinIntegral, ToNonNegative(compose=True)]

A built-in integer constrained to be zero or greater.