Skip to content

Commit

Permalink
skip None for loaded config data
Browse files Browse the repository at this point in the history
yaml.safe_load() returns None for empty steam.
(https://pyyaml.org/wiki/PyYAMLDocumentation)
load_configs failed always because of
ann_benchmarks/algorithms/base/config.yaml is empty.
  • Loading branch information
koron committed Mar 16, 2024
1 parent 708c67f commit e245f56
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ann_benchmarks/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ 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

0 comments on commit e245f56

Please sign in to comment.