Skip to content

Improved fetching of default filename extensions to avoid import-time configuration issues #80

@tennlee

Description

@tennlee

I know this was the existing code, but this can probably directly be called where its used (or using a helper function so that it is bound to the function during runtime rather than executed on import)

e.g.

# global default
DEFAULT_EXTENSION = ".nc"

def some_fn(..., ext=None):
    if ext is None:
        # if ext is not explicitly specified, try get from config, otherwise default to global
        xxx.config.get("xxx.default_extension", DEFAULT_EXTENSION)
    ...  # usual execution flow

Originally posted by @nikeethr in #68 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions