Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust gridtk list output to fit terminal width #13

Open
183amir opened this issue Oct 23, 2024 · 0 comments · May be fixed by #15
Open

Adjust gridtk list output to fit terminal width #13

183amir opened this issue Oct 23, 2024 · 0 comments · May be fixed by #15

Comments

@183amir
Copy link
Collaborator

183amir commented Oct 23, 2024

Issue:
When the job names, commands, or other column values in gridtk list are lengthy, the output table is difficult to read as it spans multiple lines, making the presentation cluttered and unclear. This can be frustrating when trying to quickly parse job-related information.

Suggested Improvement:
By default, we should implement a more user-friendly approach to formatting, such as limiting the width of selected columns (e.g., job-name, command) to fit within the current terminal window size or a fixed size of 80. Standard ellipses or truncation could be used to indicate when content is cut off. A flag or option can be provided for users to view the full output when needed.

This enhancement would improve readability without requiring users to resize their terminal or handling multiline, mixed-format outputs for each job.

Example output illustrating the problem:
In certain cases, long job names and commands can cause individual rows to break across multiple display lines:

job-id    slurm-id  nodes    state         job-name                       output                                       dependencies  command
--------  ----------  ------  -------------  ----------------------------  -----------------------------------------  -------------  ---------------------------------------------------------------------------------------------------------------------------------
     1      439883  hcne01  COMPLETED(0)    feat-ffhq-train-prune-1        logs/feat-ffhq-train-prune-1.439883.out    ...            gridtk submit --time 0-8 --- python -m face_benchmark.cli feature-extraction....                                                                                                               
@183amir 183amir changed the title Adjust gridtk list output to fit terminal width Adjust gridtk list output to fit terminal width Oct 23, 2024
183amir added a commit that referenced this issue Oct 23, 2024
Fixes #13

Adjust the `gridtk list` output to fit terminal width and add a `--full-output` option.

* **src/gridtk/cli.py**
  - Update the `list_jobs` function to adjust column widths based on terminal size.
  - Add logic to truncate long content with ellipses in the `list_jobs` function.
  - Add a new option `--full-output` to the `list_jobs` command to view the full output without truncation.

* **tests/test_gridtk.py**
  - Add unit tests to verify the new behavior of the `gridtk list` command.
  - Add unit tests to verify the `--full-output` option for the `gridtk list` command.

* **README.md**
  - Update the documentation to reflect the new behavior of the `gridtk list` command.
  - Add information about the `--full-output` option for the `gridtk list` command.

* **.devcontainer.json**
  - Add a devcontainer configuration file with tasks for testing, building, and launching the project.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/idiap/gridtk/issues/13?shareId=XXXX-XXXX-XXXX-XXXX).
@183amir 183amir linked a pull request Oct 23, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant