From f524021ccef0865e43bbb8ff88acf39a5146c0eb Mon Sep 17 00:00:00 2001 From: x01dc Date: Tue, 21 Jul 2026 16:21:05 +0200 Subject: [PATCH] feat/show estimated finish time and active hook in lamni progress ring Flomni's ring-progress center label already showed "Est. finish" and the active at-each-angle hook name; LamNI's equivalent (_lamnigui_update_progress()) was missing both. Ported the same formatting/display logic over so the two setups' progress displays match. Co-Authored-By: Claude Sonnet 5 --- .../plugins/LamNI/gui_tools.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/csaxs_bec/bec_ipython_client/plugins/LamNI/gui_tools.py b/csaxs_bec/bec_ipython_client/plugins/LamNI/gui_tools.py index ed118fe..e5efa97 100644 --- a/csaxs_bec/bec_ipython_client/plugins/LamNI/gui_tools.py +++ b/csaxs_bec/bec_ipython_client/plugins/LamNI/gui_tools.py @@ -250,6 +250,15 @@ class LamniGuiTools: else: eta_display = "N/A" + # Format estimated finish (wall-clock) time + finish_str = self.progress.get("estimated_finish_time") + if finish_str is not None: + finish_display = datetime.datetime.fromisoformat(finish_str).strftime( + "%Y-%m-%d %H:%M:%S" + ) + else: + finish_display = "N/A" + text = ( f"Progress report:\n" f" Tomo type: {self.progress['tomo_type']}\n" @@ -260,8 +269,15 @@ class LamniGuiTools: f" Current projection within subtomo: {self.progress['subtomo_projection']}\n" f" Total projections per subtomo: {int(self.progress['subtomo_total_projections'])}\n" f" Scan started: {start_display}\n" - f" Est. remaining: {eta_display}" + f" Est. remaining: {eta_display}\n" + f" Est. finish: {finish_display}" ) + # self._describe_active_hook() comes from LamNI itself (this is a + # mixin, always combined with it) -- shown only when a hook is + # actually active, mirrors Flomni's identical center-label note. + hook_description = self._describe_active_hook() + if hook_description: + text += f"\n Hook: {hook_description}" self.progressbar.set_center_label(text)