mirror of
https://github.com/vale981/ray
synced 2025-03-06 10:31:39 -05:00
[tune] Add documentation to --output flag (#4518)
## What do these changes do? Add documentation for the `--output` flag for ls / lsx in the Tune CLI. ## Related issue number Closes #4511 ## Linter - [x] I've run `scripts/format.sh` to lint the changes in this PR.
This commit is contained in:
parent
50b2aa0740
commit
bfd0af52bc
2 changed files with 16 additions and 13 deletions
|
@ -465,11 +465,11 @@ Tune CLI (Experimental)
|
|||
|
||||
Here are a few examples of command line calls.
|
||||
|
||||
- ``tune list-trials``: List tabular information about trials within an experiment. Add the ``--sort`` flag to sort the output by specific columns. Add the ``--filter`` flag to filter the output in the format ``"<column> <operator> <value>"``.
|
||||
- ``tune list-trials``: List tabular information about trials within an experiment. Empty columns will be dropped by default. Add the ``--sort`` flag to sort the output by specific columns. Add the ``--filter`` flag to filter the output in the format ``"<column> <operator> <value>"``. Add the ``--output`` flag to write the trial information to a specific file (CSV or Pickle).
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ tune list-trials [EXPERIMENT_DIR]
|
||||
$ tune list-trials [EXPERIMENT_DIR] --output note.csv
|
||||
|
||||
+------------------+-----------------------+------------+
|
||||
| trainable_name | experiment_tag | trial_id |
|
||||
|
@ -481,6 +481,8 @@ Here are a few examples of command line calls.
|
|||
| MyTrainableClass | 4_height=90,width=69 | ae4e02fb |
|
||||
+------------------+-----------------------+------------+
|
||||
Dropped columns: ['status', 'last_update_time']
|
||||
Please increase your terminal size to view remaining columns.
|
||||
Output saved at: note.csv
|
||||
|
||||
$ tune list-trials [EXPERIMENT_DIR] --filter "trial_id == 7b99a28a"
|
||||
|
||||
|
@ -490,12 +492,13 @@ Here are a few examples of command line calls.
|
|||
| MyTrainableClass | 3_height=54,width=21 | 7b99a28a |
|
||||
+------------------+-----------------------+------------+
|
||||
Dropped columns: ['status', 'last_update_time']
|
||||
Please increase your terminal size to view remaining columns.
|
||||
|
||||
- ``tune list-experiments``: List tabular information about experiments within a project. Add the ``--sort`` flag to sort the output by specific columns. Add the ``--filter`` flag to filter the output in the format ``"<column> <operator> <value>"``.
|
||||
- ``tune list-experiments``: List tabular information about experiments within a project. Empty columns will be dropped by default. Add the ``--sort`` flag to sort the output by specific columns. Add the ``--filter`` flag to filter the output in the format ``"<column> <operator> <value>"``. Add the ``--output`` flag to write the trial information to a specific file (CSV or Pickle).
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ tune list-experiments [PROJECT_DIR]
|
||||
$ tune list-experiments [PROJECT_DIR] --output note.csv
|
||||
|
||||
+----------------------+----------------+------------------+---------------------+
|
||||
| name | total_trials | running_trials | terminated_trials |
|
||||
|
@ -505,6 +508,8 @@ Here are a few examples of command line calls.
|
|||
| hyperband_test | 1 | 0 | 1 |
|
||||
+----------------------+----------------+------------------+---------------------+
|
||||
Dropped columns: ['error_trials', 'last_updated']
|
||||
Please increase your terminal size to view remaining columns.
|
||||
Output saved at: note.csv
|
||||
|
||||
$ tune list-experiments [PROJECT_DIR] --filter "total_trials <= 1" --sort name
|
||||
|
||||
|
@ -515,6 +520,7 @@ Here are a few examples of command line calls.
|
|||
| test | 1 | 0 | 0 |
|
||||
+----------------------+----------------+------------------+---------------------+
|
||||
Dropped columns: ['error_trials', 'last_updated']
|
||||
Please increase your terminal size to view remaining columns.
|
||||
|
||||
|
||||
Further Questions or Issues?
|
||||
|
|
|
@ -194,16 +194,14 @@ def list_trials(experiment_path,
|
|||
print_format_output(checkpoints_df)
|
||||
|
||||
if output:
|
||||
experiment_path = os.path.expanduser(experiment_path)
|
||||
output_path = os.path.join(experiment_path, output)
|
||||
file_extension = os.path.splitext(output)[1].lower()
|
||||
if file_extension in (".p", ".pkl", ".pickle"):
|
||||
checkpoints_df.to_pickle(output_path)
|
||||
checkpoints_df.to_pickle(output)
|
||||
elif file_extension == ".csv":
|
||||
checkpoints_df.to_csv(output_path, index=False)
|
||||
checkpoints_df.to_csv(output, index=False)
|
||||
else:
|
||||
raise ValueError("Unsupported filetype: {}".format(output))
|
||||
print("Output saved at:", output_path)
|
||||
print("Output saved at:", output)
|
||||
|
||||
|
||||
def list_experiments(project_path,
|
||||
|
@ -295,15 +293,14 @@ def list_experiments(project_path,
|
|||
print_format_output(info_df)
|
||||
|
||||
if output:
|
||||
output_path = os.path.join(base, output)
|
||||
file_extension = os.path.splitext(output)[1].lower()
|
||||
if file_extension in (".p", ".pkl", ".pickle"):
|
||||
info_df.to_pickle(output_path)
|
||||
info_df.to_pickle(output)
|
||||
elif file_extension == ".csv":
|
||||
info_df.to_csv(output_path, index=False)
|
||||
info_df.to_csv(output, index=False)
|
||||
else:
|
||||
raise ValueError("Unsupported filetype: {}".format(output))
|
||||
print("Output saved at:", output_path)
|
||||
print("Output saved at:", output)
|
||||
|
||||
|
||||
def add_note(path, filename="note.txt"):
|
||||
|
|
Loading…
Add table
Reference in a new issue