Skip to content

Path resolver

Module-level singleton for resolving ${config_root}, ${data_root}, ${output_root} template variables in YAML path strings.

Call init() once at startup (after loading config.yaml). resolve() is a no-op until init() is called, so bare paths continue to work unchanged.

resolve(path)

Resolve template variables in path. No-op if init() has not been called.

Source code in may/utils/path_resolver.py
38
39
40
41
42
def resolve(path: str) -> str:
    """Resolve template variables in path. No-op if init() has not been called."""
    if _resolver is None:
        return path
    return _resolver.resolve(path)