You are viewing the latest unreleased documentation 3.10.0.dev18. You can switch to a stable version.

iris.common.lenient#

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.

Parameters:

**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.

Examples

Lenient(maths=False)

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

context(**kwargs)[source]#

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