Provides the infrastructure to support lenient client/service behaviour.

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

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

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

Bases: _local

Container for managing the run-time lenient features and options.


**kwargs (dict, optional) – Mapping of lenient key/value options to enable/disable. Note that, only the lenient “maths” options is available, which controls lenient/strict cube arithmetic.



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


Context manager supporting temporary modification of lenient state.

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):