daf.typing.descriptions¶
Support functions for describing data in messages.
Functions:
|
Return a not-too-long description of some (hopefully 1D/2D) data for error messages and logging. |
|
Assert that the |
- daf.typing.descriptions.data_description(data: Any) str [source]¶
Return a not-too-long description of some (hopefully 1D/2D) data for error messages and logging.
- daf.typing.descriptions.assert_data(condition: bool, kind: str, data: Any, *, dtype: Optional[Union[str, dtype, Collection[str], Collection[dtype], Collection[Union[str, dtype]]]] = None, shape: Optional[Tuple[int, int]] = None, size: Optional[int] = None, layout: Optional[AnyMajor] = None) None [source]¶
Assert that the
data
satisfies somecondition
, which tested whether it is of somekind
(and optionallydtype
and/orshape
and/orlayout
), with a friendly message if it fails.