colour.utilities.set_default_complex_dtype#
- colour.utilities.set_default_complex_dtype(dtype: Type[DTypeComplex] = DTYPE_COMPLEX_DEFAULT) None[source]#
Set the Colour default
numpy.complexfloatingprecision by settingcolour.constant.DTYPE_COMPLEX_DEFAULTattribute with the specifiednumpy.dtypewherever the attribute is imported.- Parameters:
dtype (Type[DTypeComplex]) –
numpy.dtypeto setcolour.constant.DTYPE_COMPLEX_DEFAULTwith.- Return type:
None
Notes
It is possible to define the complex precision at import time by setting the COLOUR_SCIENCE__DEFAULT_COMPLEX_DTYPE environment variable, for example set COLOUR_SCIENCE__DEFAULT_COMPLEX_DTYPE=complex64.
Warning
Changing complex precision might result in various Colour functionality breaking entirely. With great power comes great responsibility.
Examples
>>> as_complex_array(np.ones(3)).dtype dtype('complex128') >>> set_default_complex_dtype(np.complex64) >>> as_complex_array(np.ones(3)).dtype dtype('complex64') >>> set_default_complex_dtype(np.complex128) >>> as_complex_array(np.ones(3)).dtype dtype('complex128')