colour.utilities.MixinDataclassArray#
- class colour.utilities.MixinDataclassArray[source]#
Bases:
MixinDataclassIterable
A mixin providing conversion methods for
dataclass
-like class conversion tonumpy.ndarray
class.Methods
Notes
The
colour.utilities.MixinDataclassArray
class inherits the methods from the following classes:
- __array__(dtype: Type[DTypeReal] | None = None, copy=None) ndarray[Any, dtype[_ScalarType_co]] [source]#
Implement support for
dataclass
-like class conversion tonumpy.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 (Type[DTypeReal] | None) –
numpy.dtype
to use for conversion to np.ndarray, default to thenumpy.dtype
defined bycolour.constant.DTYPE_FLOAT_DEFAULT
attribute.copy – 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: