Fix logic in _get_algorithm_definitions to avoid skipping algorithm definitions #498
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Maybe I'm missing something, but it seems like the logic in
_get_algorithm_definitions
leads to incorrectly skipping algorithm definitions, which I've attempted to fix here.For example, elastiknn has definitions for the "point types"
any
andeuclidean
: https://github.com/erikbern/ann-benchmarks/blob/main/ann_benchmarks/algorithms/elastiknn/config.ymlBut, if I run
python run.py --algorithm elastiknn-l2lsh --dataset random-xs-20-euclidean --run-disabled --timeout 30 --local --force --runs 1
, I get the "Nothing to run" exception. That doesn't make sense IMO. Elastiknn has definitions for theeuclidean
point type, so there is not "nothing to run".It seems that the non-any point type is skipped because of the logic in
_get_algorithm_definitions
. If an algorithm has definitions forany
, they take precedence over the definitions for a specific point type (euclidean). We can fix this by changing the logic so that it accumulates all matching point types, rather than just taking theany
type and skipping the rest. In other words, we change theelif
to a secondif
.