colour.utilities.MixinDataclassArray#

class colour.utilities.MixinDataclassArray[source]#

Bases: MixinDataclassIterable

A mixin providing conversion methods for dataclass-like class conversion to numpy.ndarray class.

Methods

Notes

__array__(dtype: Optional[Type[DTypeNumber]] = None) ndarray[source]#

Implement support for dataclass-like class conversion to numpy.ndarray class.

A field set to None will be filled with np.nan according to the shape of the first field not set with None.

Parameters:

dtype (Optional[Type[DTypeNumber]]) – numpy.dtype to use for conversion to np.ndarray, default to the numpy.dtype defined by colour.constant.DEFAULT_FLOAT_DTYPE attribute.

Returns:

dataclass-like class converted to numpy.ndarray.

Return type:

numpy.ndarray