pipefunc.typing module#
Custom type hinting utilities for pipefunc.
- class pipefunc.typing.NoAnnotation[source]#
Bases:
objectMarker class for missing type annotations.
- class pipefunc.typing.ArrayElementType[source]#
Bases:
Generic[T]Marker class for the element type of an annotated numpy array.
- class pipefunc.typing.Array(shape, dtype=None, buffer=None, offset=0, strides=None, order=None)[source]#
Bases:
Generic[T],ndarray[Any,dtype[object_]]Annotated numpy array type hint with element type.
- class pipefunc.typing.TypeCheckMemo(globals: dict[str, Any] | None, locals: dict[str, Any] | None, self_type: type | None = None)[source]#
Bases:
NamedTupleNamed tuple to store memoization data for type checking.
- pipefunc.typing.is_type_compatible(incoming_type, required_type, memo=None)[source]#
Check if the incoming type is compatible with the required type, resolving forward references.
- Return type:
- pipefunc.typing.is_object_array_type(tp)[source]#
Check if the given type is similar to Array[T].
Specifically, this function checks if the type is either:
Annotated[numpy.ndarray[Any, numpy.dtype[numpy.object_]], T]
numpy.ndarray[Any, numpy.dtype[numpy.object_]]
- Return type:
- class pipefunc.typing.Unresolvable(type_str)[source]#
Bases:
objectClass to represent an unresolvable type hint.