-
Notifications
You must be signed in to change notification settings - Fork 749
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move run_algorithm into runner, compute filename from definitions
- Loading branch information
Showing
5 changed files
with
74 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,3 @@ | ||
import argparse | ||
import json | ||
from ann_benchmarks.datasets import DATASETS | ||
from ann_benchmarks.algorithms.definitions import Definition, instantiate_algorithm | ||
from ann_benchmarks.runner import run | ||
from ann_benchmarks.runner import run_from_cmdline | ||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument( | ||
'--dataset', | ||
choices=DATASETS.keys(), | ||
required=True) | ||
parser.add_argument( | ||
'--module', | ||
required=True) | ||
parser.add_argument( | ||
'--constructor', | ||
required=True) | ||
parser.add_argument( | ||
'--count', | ||
required=True, | ||
type=int) | ||
parser.add_argument( | ||
'--json-args', | ||
action='store_true') | ||
parser.add_argument( | ||
'-a', '--arg', | ||
dest='args', action='append') | ||
args = parser.parse_args() | ||
if args.json_args: | ||
algo_args = [json.loads(arg) for arg in args.args] | ||
else: | ||
algo_args = args.args | ||
|
||
definition = Definition( | ||
algorithm=None, # not needed | ||
docker_tag=None, # also not needed | ||
module=args.module, | ||
constructor=args.constructor, | ||
arguments=algo_args | ||
) | ||
run(definition, args.dataset, args.count) | ||
run_from_cmdline() |