Commit af58f1b3 authored by Antoine Kaufmann's avatar Antoine Kaufmann
Browse files

experiments: add --list arg for run.py

This only lists the experiment names
parent c7c55cdd
...@@ -42,6 +42,8 @@ def mkdir_if_not_exists(path): ...@@ -42,6 +42,8 @@ def mkdir_if_not_exists(path):
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('experiments', metavar='EXP', type=str, nargs='+', parser.add_argument('experiments', metavar='EXP', type=str, nargs='+',
help='An experiment file to run') help='An experiment file to run')
parser.add_argument('--list', action='store_const', const=True, default=False,
help='Only list available experiment names')
parser.add_argument('--filter', metavar='PATTERN', type=str, nargs='+', parser.add_argument('--filter', metavar='PATTERN', type=str, nargs='+',
help='Pattern to match experiment names against') help='Pattern to match experiment names against')
parser.add_argument('--pickled', action='store_const', const=True, parser.add_argument('--pickled', action='store_const', const=True,
...@@ -188,6 +190,11 @@ if not args.pickled: ...@@ -188,6 +190,11 @@ if not args.pickled:
spec.loader.exec_module(mod) spec.loader.exec_module(mod)
experiments += mod.experiments experiments += mod.experiments
if args.list:
for e in experiments:
print(e.name)
sys.exit(0)
for e in experiments: for e in experiments:
if args.auto_dist and not isinstance(e, exp.DistributedExperiment): if args.auto_dist and not isinstance(e, exp.DistributedExperiment):
e = runtime.auto_dist(e, executors, args.proxy_type) e = runtime.auto_dist(e, executors, args.proxy_type)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment