Skip to content

Commit

Permalink
Add documentation for command print_named_configs
Browse files Browse the repository at this point in the history
  • Loading branch information
thequilo committed Jul 7, 2018
1 parent a44bc90 commit 94a9248
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
28 changes: 27 additions & 1 deletion docs/command_line.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ The name of the command has to be first on the commandline::

>>> ./my_demo.py COMMAND_NAME with seed=123

If the COMMAND_NAME is ommitted it defaults to the main function, but the name
If the COMMAND_NAME is omitted it defaults to the main function, but the name
of that function can also explicitly used as the name of the command.
So for this experiment

Expand Down Expand Up @@ -263,6 +263,32 @@ The format for exporting the config is inferred from the filename and can be
any format supported for :ref:`config files <config_files>`.


.. _print_named_configs:

Print Named Configs
-------------------

The ``print_named_configs`` command prints all available named configurations.
Function docstrings for named config functions are copied and displayed colored
in **grey**.
For example::

>> ./named_config print_named_configs
INFO - hello_config - Running command 'print_named_configs'
INFO - hello_config - Started
Named Configurations (doc):
rude # A rude named config
INFO - hello_config - Completed after 0:00:00

If no named configs are available for the experiment, an empty list is printed::

>> ./01_hello_world print_named_configs
INFO - 01_hello_world - Running command 'print_named_configs'
INFO - 01_hello_world - Started
Named Configurations (doc):
No named configs
INFO - 01_hello_world - Completed after 0:00:00

Custom Commands
---------------
If you just run an experiment file it will execute the default command, that
Expand Down
1 change: 1 addition & 0 deletions examples/named_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

@ex.named_config
def rude():
"""A rude named config"""
recipient = "bastard"
message = "Fuck off you {}!".format(recipient)

Expand Down

0 comments on commit 94a9248

Please sign in to comment.