MCPcopy Create free account
hub / github.com/DeepGraphLearning/graphvite / load_global_config

Function load_global_config

python/graphvite/base.py:41–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39
40
41def load_global_config():
42 config_file = os.path.join(root, "config.yaml")
43 if os.path.exists(config_file):
44 with open(config_file, "r") as fin:
45 cfg = EasyDict(yaml.safe_load(fin))
46 cfg = recursive_default(cfg, default)
47 else:
48 cfg = default
49
50 assert_in(["graphvite", "torch"], backend=cfg.backend)
51 if not os.path.exists(cfg.dataset_path):
52 os.mkdir(cfg.dataset_path)
53 if isinstance(cfg.float_type, str):
54 cfg.float_type = eval(cfg.float_type)
55 if isinstance(cfg.index_type, str):
56 cfg.index_type = eval(cfg.index_type)
57
58 return cfg
59
60
61def init_logging(level=logging.INFO, dir="", verbose=False):

Callers

nothing calls this directly

Calls 2

recursive_defaultFunction · 0.85
assert_inFunction · 0.85

Tested by

no test coverage detected