Skip to content

Commit

Permalink
compose path with os.path.join for base/config.yml
Browse files Browse the repository at this point in the history
and revert previous check for None
  • Loading branch information
koron committed Mar 22, 2024
1 parent e245f56 commit bb36bd4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ann_benchmarks/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand All @@ -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]
Expand Down Expand Up @@ -361,4 +359,4 @@ def get_definitions(
)


return definitions
return definitions

0 comments on commit bb36bd4

Please sign in to comment.