colour.utilities.is_array_api_enabled#

colour.utilities.is_array_api_enabled() → bool[source]#

Determine whether Colour Array API dispatch is enabled.

The Array API dispatch state is controlled by the global COLOUR_SCIENCE__ARRAY_API environment variable and can be temporarily modified using the set_array_api_enabled() function or the array_api_enable context manager.

Returns:

Whether Colour Array API dispatch is enabled.

Return type:

bool

Examples

>>> with array_api_enable(False):
...     is_array_api_enabled()
False
>>> with array_api_enable(True):
...     is_array_api_enabled()
True