From bb36bd425dea95e46bfb6ef641c67767e0230163 Mon Sep 17 00:00:00 2001 From: MURAOKA Taro Date: Fri, 22 Mar 2024 23:16:36 +0900 Subject: [PATCH] compose path with os.path.join for base/config.yml and revert previous check for None --- ann_benchmarks/definitions.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ann_benchmarks/definitions.py b/ann_benchmarks/definitions.py index bb2ee77d2..a557ddb5d 100644 --- a/ann_benchmarks/definitions.py +++ b/ann_benchmarks/definitions.py @@ -127,7 +127,7 @@ def get_config_files(base_dir: str = "ann_benchmarks/algorithms") -> List[str]: """Get config files for all algorithms.""" config_files = glob.glob(os.path.join(base_dir, "*", "config.yml")) return list( - set(config_files) - {f"{base_dir}/base/config.yml"} + set(config_files) - {os.path.join(base_dir, "base", config.yml")} ) def load_configs(point_type: str, base_dir: str = "ann_benchmarks/algorithms") -> Dict[str, Any]: @@ -138,8 +138,6 @@ def load_configs(point_type: str, base_dir: str = "ann_benchmarks/algorithms") - with open(config_file, 'r') as stream: try: config_data = yaml.safe_load(stream) - if config_data is None: - continue algorithm_name = os.path.basename(os.path.dirname(config_file)) if point_type in config_data: configs[algorithm_name] = config_data[point_type] @@ -361,4 +359,4 @@ def get_definitions( ) - return definitions \ No newline at end of file + return definitions