Skip to content

Allow global constants to be controlled by a context manager #154

@davidhassell

Description

@davidhassell

This is so we can stop doing things like:

>>> old = cf.log_level('DEBUG')
>>> <execute some code>
>>> cf.log_level(old)

and start doing things like:

>>> with cf.log_level('DEBUG'):
...     <execute some code>
...
>>>

The core implementation is inherited from cfdm (NCAS-CMS/cfdm#100), which needs to be extended for the extra constants in extra cf-python

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions