colour.utilities.ndarray_copy_enable#

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

Bases: object

Define a context manager and decorator to temporarily set the Colour numpy.ndarray copy enabled state.

Parameters:

enable (bool) – Whether to enable or disable Colour numpy.ndarray copy.

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

enable (bool)

Return type:

None

__enter__() Self[source]#

Set the Colour numpy.ndarray copy enabled state upon entering the context manager.

Return type:

Self

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

Restore the Colour numpy.ndarray copy enabled state upon exiting the context manager.

Parameters:

args (Any)

Return type:

None

__call__(function: Callable) Callable[source]#

Decorate and call the specified function with array copy control.

Parameters:

function (Callable) – Function to be decorated with array copy state management.

Returns:

Decorated function that executes within the configured array copy state context.

Return type:

Callable

__weakref__#

list of weak references to the object