Skip to content

Validation types

Various types used to validate input data for correctness.

Available Data Types

diffusion.internal.validation

StrictTimedelta module-attribute

A datetime.timedelta instance.

StrictNonNegativeTimedelta module-attribute

A non-negative datetime.timedelta instance.

StrictTimedeltaClass

Bases: datetime.timedelta

Strictly validated version of datetime.timedelta. Accepts only a datetime.timedelta or any subclasses thereof.

StrictNonNegativeTimedeltaClass

Bases: datetime.timedelta

Strictly validated version of datetime.timedelta. Accepts only datetime.timedelta or any subclasses thereof. Must be non-negative.

pydantic

StrictPositiveInt module-attribute

StrictPositiveInt = typing.Union[
    StrictPositiveIntClass, pydantic.StrictInt
]

A positive int

StrictNonNegativeInt module-attribute

StrictNonNegativeInt = typing.Union[
    StrictNonNegativeIntClass, pydantic.StrictInt, int
]

A non-negative int

StrictNonNegativeFloat module-attribute

StrictNonNegativeFloat = typing.Union[
    StrictNonNegativeFloatClass, pydantic.StrictFloat
]

A non-negative float

StrictStr module-attribute

StrictStr = typing.Union[str, pydantic.StrictStr]

A string

StrictInt module-attribute

StrictInt = typing.Union[int, pydantic.StrictInt]

An `int``

StrictNonNegative module-attribute

A non-negative int or float

MaximumResultSize module-attribute

MaximumResultSize: TypeAlias = UnsignedInt32

The maximum result size

StrictPositiveIntClass

Bases: pydantic.StrictInt

Strictly validated version of int. Accepts only int or any subclasses thereof. Must be positive.

StrictNonNegativeIntClass

Bases: pydantic.StrictInt

Strictly validated version of int. Accepts only int or any subclasses thereof. Must be non-negative.

StrictNonNegativeFloatClass

Bases: pydantic.StrictFloat

Strictly validated version of float. Accepts only int or any subclasses thereof. Must be non-negative.

Int32

Bases: encoded_data.Int32

max_unsigned_int classmethod
max_unsigned_int() -> StrictNonNegativeInt

Returns:

Type Description
StrictNonNegativeInt

The maximum unsigned integer for this type width

max_signed_int classmethod
max_signed_int() -> StrictNonNegativeInt

Returns:

Type Description
StrictNonNegativeInt

The maximum signed integer for this type width

Int64

Bases: encoded_data.Int64

max_unsigned_int classmethod
max_unsigned_int() -> StrictNonNegativeInt

Returns:

Type Description
StrictNonNegativeInt

The maximum unsigned integer for this type width

max_signed_int classmethod
max_signed_int() -> StrictNonNegativeInt

Returns:

Type Description
StrictNonNegativeInt

The maximum signed integer for this type width

MinMaxStrictInt

Bases: pydantic.StrictInt

A constrained integer

max classmethod
max() -> STRICT_INT_T

Maximum value of this type

min classmethod
min() -> STRICT_INT_T

Minimum value of this type

UnsignedInt32

Bases: MinMaxStrictInt

An unsigned 32 bit integer

SignedInt32

Bases: MinMaxStrictInt

A signed 32 bit integer

NonNegativeSignedInt32

Bases: MinMaxStrictInt

An non-negative signed 32 bit integer

UnsignedInt64

Bases: MinMaxStrictInt

An unsigned 64 bit integer

SignedInt64

Bases: MinMaxStrictInt

A signed 64 bit integer

NonNegativeSignedInt64

Bases: MinMaxStrictInt

A non-negative signed 64 bit integer

diffusion.internal.validation.pydantic

StrictPositiveInt module-attribute

StrictPositiveInt = typing.Union[
    StrictPositiveIntClass, pydantic.StrictInt
]

A positive int

StrictNonNegativeInt module-attribute

StrictNonNegativeInt = typing.Union[
    StrictNonNegativeIntClass, pydantic.StrictInt, int
]

A non-negative int

StrictNonNegativeFloat module-attribute

StrictNonNegativeFloat = typing.Union[
    StrictNonNegativeFloatClass, pydantic.StrictFloat
]

A non-negative float

StrictStr module-attribute

StrictStr = typing.Union[str, pydantic.StrictStr]

A string

StrictInt module-attribute

StrictInt = typing.Union[int, pydantic.StrictInt]

An `int``

StrictNonNegative module-attribute

A non-negative int or float

MaximumResultSize module-attribute

MaximumResultSize: TypeAlias = UnsignedInt32

The maximum result size

StrictPositiveIntClass

Bases: pydantic.StrictInt

Strictly validated version of int. Accepts only int or any subclasses thereof. Must be positive.

StrictNonNegativeIntClass

Bases: pydantic.StrictInt

Strictly validated version of int. Accepts only int or any subclasses thereof. Must be non-negative.

StrictNonNegativeFloatClass

Bases: pydantic.StrictFloat

Strictly validated version of float. Accepts only int or any subclasses thereof. Must be non-negative.

Int32

Bases: encoded_data.Int32

max_unsigned_int classmethod

max_unsigned_int() -> StrictNonNegativeInt

Returns:

Type Description
StrictNonNegativeInt

The maximum unsigned integer for this type width

max_signed_int classmethod

max_signed_int() -> StrictNonNegativeInt

Returns:

Type Description
StrictNonNegativeInt

The maximum signed integer for this type width

Int64

Bases: encoded_data.Int64

max_unsigned_int classmethod

max_unsigned_int() -> StrictNonNegativeInt

Returns:

Type Description
StrictNonNegativeInt

The maximum unsigned integer for this type width

max_signed_int classmethod

max_signed_int() -> StrictNonNegativeInt

Returns:

Type Description
StrictNonNegativeInt

The maximum signed integer for this type width

MinMaxStrictInt

Bases: pydantic.StrictInt

A constrained integer

max classmethod

max() -> STRICT_INT_T

Maximum value of this type

min classmethod

min() -> STRICT_INT_T

Minimum value of this type

UnsignedInt32

Bases: MinMaxStrictInt

An unsigned 32 bit integer

SignedInt32

Bases: MinMaxStrictInt

A signed 32 bit integer

NonNegativeSignedInt32

Bases: MinMaxStrictInt

An non-negative signed 32 bit integer

UnsignedInt64

Bases: MinMaxStrictInt

An unsigned 64 bit integer

SignedInt64

Bases: MinMaxStrictInt

A signed 64 bit integer

NonNegativeSignedInt64

Bases: MinMaxStrictInt

A non-negative signed 64 bit integer