From 13ad8bbf7a64be01e6f82b68365ce344744df967 Mon Sep 17 00:00:00 2001 From: x01dc Date: Mon, 13 Jul 2026 22:07:00 +0200 Subject: [PATCH] feat(flomni): fire the single-point acquisition warning on the off->on transition Previously the tomo_acquire_at_angle()-vs-tomo_scan_projection() reminder only printed when tomo_parameters() happened to be called afterward -- easy to miss if you just flip single_point_instead_of_fermat_scan directly. Its setter now prints the same note immediately when the value transitions False->True. Gated on the transition (checked via the property's own getter before the write) so restoring an already-True value across consecutive queued jobs doesn't reprint it every time -- sim-verified: silent on False->False, True->True (repeat), and True->False; prints exactly once per False->True flip. Co-Authored-By: Claude Sonnet 5 --- .../bec_ipython_client/plugins/flomni/flomni.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/csaxs_bec/bec_ipython_client/plugins/flomni/flomni.py b/csaxs_bec/bec_ipython_client/plugins/flomni/flomni.py index d9e3de0..6528aa7 100644 --- a/csaxs_bec/bec_ipython_client/plugins/flomni/flomni.py +++ b/csaxs_bec/bec_ipython_client/plugins/flomni/flomni.py @@ -2184,6 +2184,18 @@ class Flomni( @single_point_instead_of_fermat_scan.setter def single_point_instead_of_fermat_scan(self, val: bool): + # Fire the reminder right at the moment it's switched on, not just + # when tomo_parameters() happens to be called afterward. Gated on + # the off->on transition (reading the property itself for the old + # value, before the write below) so restoring the same True value + # across consecutive queued jobs doesn't reprint it every time. + if val and not self.single_point_instead_of_fermat_scan: + print( + "\x1b[93mNote: with single-point mode on, acquire a single projection " + "(including inside a custom at_each_angle hook) with " + "tomo_acquire_at_angle(angle), not tomo_scan_projection(angle) -- the " + "latter always runs a full Fermat scan regardless of this setting.\x1b[0m" + ) self.client.set_global_var("single_point_instead_of_fermat_scan", val) @property