[tune] add filter flag for Tune CLI (#4337)

## What do these changes do?

Adds filter flag (--filter) to ls / lsx commands for Tune CLI.

Usage: `tune ls [path] --filter [column] [operator] [value]`
e.g. `tune lsx ~/ray_results/my_project --filter total_trials == 1`
This commit is contained in:
Andrew Tan
2019-03-27 11:19:25 -07:00
committed by Richard Liaw
parent c6f12e5219
commit 12db684f72
4 changed files with 107 additions and 12 deletions
+20 -6
View File
@@ -20,10 +20,17 @@ def cli():
"-o",
default=None,
type=str,
help="Output information to a pickle file.")
def list_trials(experiment_path, sort, output):
help="Select file to output information to.")
@click.option(
"--filter",
"filter_op",
nargs=1,
default=None,
type=str,
help="Select filter in the format '<column> <operator> <value>'.")
def list_trials(experiment_path, sort, output, filter_op):
"""Lists trials in the directory subtree starting at the given path."""
commands.list_trials(experiment_path, sort, output)
commands.list_trials(experiment_path, sort, output, filter_op)
@cli.command()
@@ -35,10 +42,17 @@ def list_trials(experiment_path, sort, output):
"-o",
default=None,
type=str,
help="Select filename to output information to.")
def list_experiments(project_path, sort, output):
help="Select file to output information to.")
@click.option(
"--filter",
"filter_op",
nargs=1,
default=None,
type=str,
help="Select filter in the format '<column> <operator> <value>'.")
def list_experiments(project_path, sort, output, filter_op):
"""Lists experiments in the directory subtree."""
commands.list_experiments(project_path, sort, output)
commands.list_experiments(project_path, sort, output, filter_op)
@cli.command()