iris.common.lenient#

Provides the infrastructure to support lenient client/service behaviour.

class iris.common.lenient.Lenient(**kwargs)[source]#

Bases: _local

A container for managing the run-time lenient features and options.

Kwargs:

  • kwargs (dict)

    Mapping of lenient key/value options to enable/disable. Note that, only the lenient “maths” options is available, which controls lenient/strict cube arithmetic.

For example:

Lenient(maths=False)

Note that, the values of these options are thread-specific.

context(**kwargs)[source]#

Return a context manager which allows temporary modification of the lenient option state within the scope of the context manager.

On entry to the context manager, all provided keyword arguments are applied. On exit from the context manager, the previous lenient option state is restored.

For example::
with iris.common.Lenient.context(maths=False):

pass

iris.common.lenient.LENIENT = Lenient(maths=True)#

(Public) Instance that manages all Iris run-time lenient features.