hvl_ccb.utils.typing

Additional Python typing module utilities

ConvertableTypes

Typing hint for data type that can be used in conversion

alias of Union[int, float, List[Union[int, float]], Tuple[Union[int, float], …], Dict[str, Union[int, float]], ndarray]

Number

Typing hint auxiliary for a Python base number types: int or float.

alias of Union[int, float]

check_generic_type(value, type_, name='instance')[source]

Check if value is of a generic type type_. Raises TypeError if it’s not.

Parameters
  • name – name to report in case of an error

  • value – value to check

  • type – generic type to check against

is_generic_type_hint(type_)[source]

Check if class is a generic type, for example Union[int, float], List[int], or List.

Parameters

type – type to check