Skip to content

bagof.validators.numpy

Validators for numpy types (dtype, ndarray).

Classes

IsDType

IsDType(hint: Any = UNSET, compose: bool = False)

Bases: Validator[T]

Validator for numpy.dtype.

IsNDArray

IsNDArray(hint: Any = UNSET, compose: bool = False)

Bases: ArrayValidator

Validator for numpy.ndarray.

Checks the array type, then the dtype and shape named in the hint (e.g. ndarray[Tuple[Literal[3], int], dtype[float64]]).