Fix docstring for cli_viz() and cli_learn() in polaris.py
polaris/polaris.py has this docstring for
@click.command('viz', short_help='Display results') @click.argument('graph_file', nargs=1, required=True) def cli_viz(graph_file): """ Serving HTML5 visualization from directory with JSON graph file :param graph_file: JSON data file with graph information about nodes and edges. """ launch_webserver(graph_file)
:param notation would be fine; however, the click library turns this into the help string for the viz subcommand, which is less than ideal:
20:26 $ polaris viz --help Usage: polaris viz [OPTIONS] GRAPH_FILE Serving HTML5 visualization from directory with JSON graph file :param graph_file: JSON data file with graph information about nodes and edges. Options: --help Show this message and exit.
A few things need fixing:
- the docstring should be just a one-sentence summary of the command, as is already the case for
cli_fetch(); the click library will take care of the rest;
- that summary should include the main argument for
GRAPH_FILE), as is already the case for
- make sure that the output of
polaris viz --helplooks similar to the output of
polaris fetch --help, with help strings for the various arguments and options.
Currently, the helpstring for
polaris viz ooks like this:
20:32 $ polaris learn --help Usage: polaris learn [OPTIONS] INPUT_FILE INPUT_FILE in csv or json format [snip]
That isn't terribly helpful. That summary should include a description of the command, along with the already-existing documentation for
INPUT_FILE. As above, look at the docstring for
polaris fetch for a good example.