Beispiel #1
0
def _has_config_content(cfg: DictConfig) -> bool:
    if cfg._is_none() or cfg._is_missing():
        return False

    for key in cfg.keys():
        if not OmegaConf.is_missing(cfg, key):
            return True
    return False
Beispiel #2
0
def _has_config_content(cfg: DictConfig) -> bool:
    if cfg._is_none() or cfg._is_missing():
        return False

    for key in cfg.keys():
        if not OmegaConf.is_missing(cfg, key) and key not in (
                "defaults",
                "__HYDRA_REMOVE_TOP_LEVEL_DEFAULTS__",
        ):
            return True
    return False
Beispiel #3
0
def test_shallow_copy_none() -> None:
    cfg = DictConfig(content=None)
    c = cfg.copy()
    c._set_value({"foo": 1})
    assert c.foo == 1
    assert cfg._is_none()