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

Improvement to tlo batch-list subcommand #1041

Merged
merged 10 commits into from
Aug 1, 2023
Merged

Conversation

tamuri
Copy link
Collaborator

@tamuri tamuri commented Jul 27, 2023

  • Display table of jobs
  • List jobs ordered by creation time, descending.
  • By default, only shows logged in user's jobs.
❯ tlo batch-list
Querying Batch...
                                                id               creation_time     state
          long_run_all_diseases-2023-07-13T100358Z  2023-07-13T10:03:59.52316Z completed
                 test_short_run-2023-06-26T082211Z 2023-06-26T08:22:16.988075Z completed
                 test_short_run-2023-06-26T080708Z 2023-06-26T08:07:16.668202Z completed
scenario_impact_of_healthsystem-2023-06-06T063118Z 2023-06-06T06:31:19.905089Z completed
          long_run_all_diseases-2023-06-01T153825Z 2023-06-01T15:38:26.615801Z completed
  • Use --username to view other user's jobs.
❯ tlo batch-list --username [email protected] -n 10 --active
Querying Batch...
                                             id               creation_time  state
sba_min_sensitivity_analysis-2023-07-17T153657Z 2023-07-17T15:36:57.857086Z active
 perfect_bemonc_sba_scenario-2023-07-17T153554Z 2023-07-17T15:35:55.080851Z active
anc_min_sensitivity_scenario-2023-07-17T153518Z 2023-07-17T15:35:18.937866Z active
      increased_anc_scenario-2023-07-17T153335Z 2023-07-17T15:33:37.706374Z active

  • -n, --active, --completed, --find options still supported

Fixes #434

- use the job directories in user's folder to see if jobs are theirs
- add `--username` argument to filter by a different user
- convert job results to dataframe and filter according to options
@tamuri tamuri requested a review from tbhallett July 31, 2023 22:46
@tamuri tamuri linked an issue Jul 31, 2023 that may be closed by this pull request
@tamuri tamuri marked this pull request as ready for review July 31, 2023 22:49
Copy link
Collaborator

@tbhallett tbhallett left a comment

Choose a reason for hiding this comment

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

It's brilliant. Thanks very much.

Two quick thoughts:

  • Should the help (tlo batch-list --help) say that it's (by default) only returning one's own runs?
  • Could the formatting of date/time be any "friendlier"? i.e. 2023-07-30T21:14:07.829666Z --> 2023/7/30 | 21:14:07

@tamuri
Copy link
Collaborator Author

tamuri commented Aug 1, 2023

Thanks, Tim. Made those changes:

tlo ❯ tlo batch-list --help
Usage: tlo batch-list [OPTIONS]

  List and find running and completed jobs. By default, the 5 most recent
  jobs are displayed for the current user.

Options:
  -f, --find TEXT  Show jobs where identifier contains supplied string
  --completed      Only display completed jobs
  --active         Only display active jobs
  -n INTEGER       Maximum number of jobs to list (default is 5)
  --help           Show this message and exit.
tlo ❯ tlo batch-list
Querying Batch...
                           id creation_date creation_time     state
playing_22-2023-08-01T094211Z    2023-08-01      09:42:12 completed
playing_22-2023-08-01T094202Z    2023-08-01      09:42:02 completed
playing_22-2023-07-26T142829Z    2023-07-26      14:28:30 completed

@tamuri tamuri merged commit a978e8b into master Aug 1, 2023
55 checks passed
@tamuri tamuri deleted the tamuri/batch-list-improvements branch August 1, 2023 11:56
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.

Updates to CLI tlo batch-list
2 participants