fatf.utils.array.validation.is_flat_dtype

fatf.utils.array.validation.is_flat_dtype(dtype: numpy.dtype) → bool[source]

Determines whether a numpy dtype object is flat.

Checks whether the dtype just encodes one element or a shape. A dtype can characterise an array of other base types, which can then be embedded as an element of another array.

Parameters
dtypenumpy.dtype

The dtype to be checked.

Returns
is_flatboolean

True if the dtype is flat, False otherwise.

Raises
TypeError

The input is not a numpy’s dtype object.

ValueError

The dtype is structured – this function only accepts plane dtypes.