colour.utilities.MixinDataclassArray#
- class colour.utilities.MixinDataclassArray[source]#
Bases:
MixinDataclassIterableProvide conversion methods for
dataclass-like classes tonumpy.ndarrayobjects.This mixin extends dataclass functionality to enable seamless conversion to NumPy arrays, facilitating numerical operations on structured data.
Methods
Notes
The
colour.utilities.MixinDataclassArrayclass inherits the methods from the following classes:
- __array__(dtype: Type[DTypeReal] | None = None, copy: bool = True) NDArray[source]#
Implement support for
dataclass-like class conversion tonumpy.ndarrayclass.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 (Type[DTypeReal] | None) –
numpy.dtypeto use for conversion to np.ndarray, default to thenumpy.dtypedefined bycolour.constant.DTYPE_FLOAT_DEFAULTattribute.copy (bool) – Whether to return a copy of the underlying data, will always be True, irrespective of the parameter value.
- Returns:
dataclass-like class converted tonumpy.ndarray.- Return type: