colour.utilities.array_api_enable#

class colour.utilities.array_api_enable(enable: bool)[source]#

Bases: object

Define a context manager and decorator to temporarily set the Colour Array API dispatch enabled state.

Parameters:

enable (bool) – Whether to enable or disable Colour Array API dispatch.

__init__(enable: bool) → None[source]#
Parameters:

enable (bool)

Return type:

None

__enter__() → Self[source]#

Enter the context and set the Array API dispatch state.

Return type:

Self

__exit__(*args: Any) → None[source]#

Exit the context and restore the previous Array API state.

Parameters:

args (Any)

Return type:

None

__call__(function: Callable) → Callable[source]#

Decorate and call the specified function with Array API control.

Parameters:

function (Callable)

Return type:

Callable

__weakref__#

list of weak references to the object