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

Make status printing look more like result printing. #715

Merged
merged 4 commits into from
Nov 14, 2023

Conversation

dmageeLANL
Copy link
Collaborator

@dmageeLANL dmageeLANL commented Nov 10, 2023

Status tables can now be sorted. Addresses issue #705.

Code review checklist:

  • Code is generally sensical and well commented
  • Variable/function names all telegraph their purpose and contents
  • Functions/classes have useful doc strings
  • Function arguments are typed
  • Added/modified unit tests to cover changes.
  • New features have documentation added to the docs.
  • New features and backwards compatibility breaks are noted in the RELEASE.md

@dmageeLANL dmageeLANL linked an issue Nov 10, 2023 that may be closed by this pull request
@dmageeLANL
Copy link
Collaborator Author

dmageeLANL commented Nov 13, 2023

  • Moved function sort_results from commands/results.py to utils.py and renamed to sort_table, since it sorts the rows argument of the draw_table function.
  • Changed the first argument of utils.sort_table from the entire args object to the value of args.sort_by (the key to sort on).
  • Assign table title string to variable and include series name if applicable.
  • In status_utils.print_status add sorter argument (use args.sort_by in commands/status.py when calling). In function status_utils.print_status, if sorter is given and is not false, use the same procedure as in commands/results.py:
    • Take the statuses list and make it into a list of flattened dictionaries.
    • Sort the list by the given key.
    • If sorter is not present just assign the new flat_sorted_statuses variable to the original 'statuses list and proceed as normal.

@dmageeLANL
Copy link
Collaborator Author

Now output is like this (snow):

~ pav status s11 --sort-by=part
 Test statuses
--------------+------------------+-----------------+-------+----------+----------+--------+----------
 Test         | Job id           | Name            | Nodes | Part     | State    | Result | Updated
--------------+------------------+-----------------+-------+----------+----------+--------+----------
 partisn.1310 | 258935_rocinante | partisn.cce_tes | 1     | hbm      | COMPLETE | FAIL   | Jul 31
              |                  | t.cce-cray-     |       |          |          |        | 14:45:48
              |                  | mpich_1nodes    |       |          |          |        |
 partisn.1304 | 258920_rocinante | partisn.cce_tes | 64    | hbm      | COMPLETE | PASS   | Jul 31
              |                  | t.cce-cray-     |       |          |          |        | 14:34:29
              |                  | mpich_64nodes   |       |          |          |        |
 partisn.1303 | 258922_rocinante | partisn.cce_tes | 16    | hbm      | COMPLETE | PASS   | Jul 31
              |                  | t.cce-cray-     |       |          |          |        | 14:34:22
              |                  | mpich_16nodes   |       |          |          |        |
 partisn.1302 | 258919_rocinante | partisn.cce_tes | 4     | hbm      | COMPLETE | PASS   | Jul 31
              |                  | t.cce-cray-     |       |          |          |        | 14:34:32
              |                  | mpich_4nodes    |       |          |          |        |
 partisn.1301 | 258917_rocinante | partisn.cce_tes | 2     | hbm      | COMPLETE | PASS   | Jul 31
              |                  | t.cce-cray-     |       |          |          |        | 14:34:32
              |                  | mpich_2nodes    |       |          |          |        |
 partisn.1300 | 258915_rocinante | partisn.cce_tes | 1     | hbm      | COMPLETE | PASS   | Jul 31
              |                  | t.cce-cray-     |       |          |          |        | 14:34:32
              |                  | mpich_1nodes    |       |          |          |        |
 partisn.1309 | 258933_rocinante | partisn.cce_tes | 64    | standard | COMPLETE | PASS   | Jul 31
              |                  | t.cce-cray-     |       |          |          |        | 14:44:46
              |                  | mpich_64nodes   |       |          |          |        |
 partisn.1308 | 258931_rocinante | partisn.cce_tes | 16    | standard | COMPLETE | PASS   | Jul 31
              |                  | t.cce-cray-     |       |          |          |        | 14:46:22
              |                  | mpich_16nodes   |       |          |          |        |
 partisn.1307 | 258929_rocinante | partisn.cce_tes | 4     | standard | COMPLETE | PASS   | Jul 31
              |                  | t.cce-cray-     |       |          |          |        | 14:46:26
              |                  | mpich_4nodes    |       |          |          |        |
 partisn.1306 | 258927_rocinante | partisn.cce_tes | 2     | standard | COMPLETE | PASS   | Jul 31
              |                  | t.cce-cray-     |       |          |          |        | 14:46:48
              |                  | mpich_2nodes    |       |          |          |        |
 partisn.1305 | 258925_rocinante | partisn.cce_tes | 1     | standard | COMPLETE | PASS   | Jul 31
              |                  | t.cce-cray-     |       |          |          |        | 14:47:12
              |                  | mpich_1nodes    |       |          |          |        |
 partisn.1299 | 258913_rocinante | partisn.cce_tes | 64    | standard | COMPLETE | PASS   | Jul 31
              |                  | t.cce-cray-     |       |          |          |        | 14:34:21
              |                  | mpich_64nodes   |       |          |          |        |

Copy link
Collaborator

@Paul-Ferrell Paul-Ferrell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm both bothered and amused by your serieses variable name.

@Paul-Ferrell Paul-Ferrell merged commit 758c149 into master Nov 14, 2023
7 checks passed
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 this pull request may close these issues.

Sort by in status doesn't work.
2 participants