Skip to content

Commit

Permalink
Fix parser, splitting back out to seperate interactive mode subcommand
Browse files Browse the repository at this point in the history
  • Loading branch information
EdmundGoodman committed Mar 11, 2024
1 parent 4f60013 commit 4ee0121
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 23 deletions.
39 changes: 20 additions & 19 deletions src/hpc_multibench/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ def get_parser() -> ArgumentParser: # pragma: no cover
parser_record = sub_parsers.add_parser(
"record", help="record data from running the test benches"
)
parser_interactive = sub_parsers.add_parser(
"interactive", help="show the interactive TUI"
)
sub_parsers.add_parser(
"report", help="report analysis about completed test bench runs"
)

parser_record.add_argument(
"-d",
"--dry-run",
Expand All @@ -38,21 +45,13 @@ def get_parser() -> ArgumentParser: # pragma: no cover
action="store_true",
help="wait for the submitted jobs to finish to exit",
)
parser_record.add_argument(
"-nc",
"--no-clobber",
action="store_true",
help="don't delete any previous run results of the test benches",
)
parser_report = sub_parsers.add_parser(
"report", help="report analysis about completed test bench runs"
)
parser_report.add_argument(
"-i",
"--interactive",
action="store_true",
help="show the interactive TUI",
)
for sub_parser in (parser_record, parser_interactive):
sub_parser.add_argument(
"-nc",
"--no-clobber",
action="store_true",
help="don't delete any previous run results of the test benches",
)
return parser


Expand All @@ -65,7 +64,9 @@ def main() -> None: # pragma: no cover
test_plan.record_all(args)

elif args.command == "report":
if args.interactive:
UserInterface(test_plan, args).run()
else:
test_plan.report_all(args)
test_plan.report_all(args)

else:
args.dry_run = False
args.wait = False
UserInterface(test_plan, args).run()
4 changes: 0 additions & 4 deletions src/hpc_multibench/tui/interactive_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,6 @@ def __init__( # type: ignore[no-untyped-def]
) -> None:
"""Initialise the user interface."""
self.test_plan: TestPlan = test_plan
# TODO: Fix this in the main function
command_args.dry_run = False
command_args.wait = False
command_args.no_clobber = False
self.command_args: Namespace = command_args
self.show_mode = ShowMode.Uninitialised
self.current_test_bench: TestBench | None = None
Expand Down

0 comments on commit 4ee0121

Please sign in to comment.