From fa7b65cb6e31967025a6e678f6bea557cd8b6757 Mon Sep 17 00:00:00 2001 From: EdmundGoodman Date: Sun, 18 Feb 2024 03:43:18 +0000 Subject: [PATCH] Disable TUI from main invocation --- src/hpc_multibench/main.py | 5 ++--- src/hpc_multibench/tui/user_interface.py | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/hpc_multibench/main.py b/src/hpc_multibench/main.py index 9282314..f20cec7 100755 --- a/src/hpc_multibench/main.py +++ b/src/hpc_multibench/main.py @@ -5,7 +5,7 @@ from enum import Enum, auto from pathlib import Path -from hpc_multibench.tui.user_interface import UserInterface +# from hpc_multibench.tui.user_interface import UserInterface from hpc_multibench.yaml_model import TestPlan @@ -21,8 +21,7 @@ def main(yaml_path: Path, mode: Mode = Mode.RUN) -> None: # pragma: no cover """Run the tool.""" test_plan = TestPlan.from_yaml(yaml_path) - UserInterface(test_plan).run() - return + # UserInterface(test_plan).run() if mode in (Mode.RUN, Mode.ALL): test_plan.run() diff --git a/src/hpc_multibench/tui/user_interface.py b/src/hpc_multibench/tui/user_interface.py index 3abfb43..9db8f73 100644 --- a/src/hpc_multibench/tui/user_interface.py +++ b/src/hpc_multibench/tui/user_interface.py @@ -92,19 +92,27 @@ def on_mount(self) -> None: tree = self.query_one(TestPlanTree) tree.populate() - plt = self.query_one(RunAnalysisPlot).plt + plt = self.query_one("#metrics_plot", RunAnalysisPlot).plt plt.title("Scatter Plot") - plt.scatter(plt.sin()) + plt.plot(plt.sin()) def handle_tree_selection(self, node: TreeNode[TestPlanTreeType]) -> None: """.""" info_box = self.app.query_one("#information-box", Static) + metrics_table = self.app.query_one("#metrics-table", DataTable) + metrics_plot = self.query_one("#metrics_plot", RunAnalysisPlot).plt output_string = f"{type(node.data)} {node.label}" if isinstance(node.data, BenchModel): + # Run tab output_string = "\n".join([str(x) for x in node.data.matrix_iterator]) + # Metrics tab + metrics_table.add_columns(*node.data.analysis.metrics.keys()) + for results in node.data.get_analysis(str(node.label)): + metrics_table.add_row(*[str(x) for x in results.values()]) + # Plot tab + metrics_plot.title("Run time / Mesh width") + metrics_plot.plot([100, 200, 300], [100, 200, 300]) else: - # TODO: Could be a text area output_string = node.data.realise("", str(node.label), {}).sbatch_contents - info_box.update(output_string)