colour.utilities.numpy_print_options#

colour.utilities.numpy_print_options(*args: Any, **kwargs: Any) Generator[source]#

Define a context manager implementing context changes to Numpy print behaviour.

Parameters:
  • args (Any) – Arguments.

  • kwargs (Any) – Keywords arguments.

Return type:

Generator

Examples

>>> np.array([np.pi])  
array([ 3.1415926...])
>>> with numpy_print_options(formatter={'float': '{:0.1f}'.format}):
...      np.array([np.pi])
array([3.1])