Example #1
0
def test_correct(yml, modified, error):
    config = OmegaConf.create(yml)
    with error as e:
        correct_model_config(config)
    if not e:
        assert OmegaConf.to_container(
            OmegaConf.create(modified)) == OmegaConf.to_container(config)
Example #2
0
def parse(cfg):
    assert isinstance(cfg, Config), cfg
    cfg = resolve_alias(ALIASES, cfg)
    check_nonempty(cfg, MUST_FIELDS)
    cfg = resolve_path(cfg)
    cfg.model = correct_model_config(cfg.model)
    return cfg
Example #3
0
def parse(cfg: Config):
    cfg = resolve_alias(ALIASES, cfg)
    check_nonempty(cfg, MUST_FIELDS)
    cfg = resolve_path(cfg)
    cfg.model = correct_model_config(cfg.model)
    return cfg