Skip to content

Determine interaction of namesake constants from cfdm #85

@sadielbartholomew

Description

@sadielbartholomew

There are some functions tied to constants that are named identically in cfdm & cf, e.g. ATOL, RTOL & LOG_LEVEL. Most if not all have the same role in each of the standalone libraries. But we noted that we are not sure how these interact in cf-python. We should check how they interact and that the behaviour is as expected (which may involve deciding how they should interact, if at all).

As an example, cf.LOG_LEVEL has been setup, initially at least, to only (directly) change the logging of modules in cf, but we may want to influence the log messages emerging in cf from the cfdm module, e.g. by having any setting of cf.LOG_LEVEL also simultaneously set cfdm.LOG_LEVEL. In fact, this may not be required because the Python logging module used in both cases may internally integrate the logging by the two libraries, such that changing the severity level on the root logger of cf may via change it effectively for the root logger of cfdm (in which case it the cfdm loggers would probably change in behaviour without a corresponding change in the cfdm.LOG_LEVEL as coded which would be a problem). But until we investigate I do not know.

This Issue may require no changes, but we should examine the interaction as otherwise this unknown could be or become a source of bugs.

A related question is whether we think it at all viable that users would need to or want to import both libraries:

import cf
import cfdm

<mixture of API calls to cf & to cfdm>
...

as in that case we will need to be thorough to ensure setting of any cf global does not influence the equivalent cfdm global and behaviour on cfdm calls in non-intuitive or undocumented ways. And if importing both would be a bad idea, we may wish to document that users should import either cf or cfdm, not both, depending on their needs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionGeneral question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions