()
| 39 | |
| 40 | |
| 41 | def 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 | |
| 61 | def init_logging(level=logging.INFO, dir="", verbose=False): |
nothing calls this directly
no test coverage detected