From 887c732865f2bd1a9140000630e959cbfa74efce Mon Sep 17 00:00:00 2001 From: x01dc Date: Tue, 21 Jul 2026 15:41:25 +0200 Subject: [PATCH] fix/tomo queue GUI projection count for tomo_type 3 _format_projections() computed type 3's count with type 1's fixed "N*8 sub-tomograms" formula, ignoring golden_max_number_of_projections -- the value that actually bounds a type-3 run (lamni.py/flomni.py's type-3 scan loop has no sub-tomogram cap, it stops only once ii > golden_max_number_of_projections, same as type 2). This produced an ~8x-inflated "Projections" column (e.g. 240 instead of 30) for any type-3 job. Merged type 3 into type 2's branch since both share the same uncapped/golden_max_number_of_projections model. Co-Authored-By: Claude Sonnet 5 --- .../widgets/tomo_params/tomo_params.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/csaxs_bec/bec_widgets/widgets/tomo_params/tomo_params.py b/csaxs_bec/bec_widgets/widgets/tomo_params/tomo_params.py index a8b1771..7f4ed37 100644 --- a/csaxs_bec/bec_widgets/widgets/tomo_params/tomo_params.py +++ b/csaxs_bec/bec_widgets/widgets/tomo_params/tomo_params.py @@ -2340,14 +2340,15 @@ def _format_projections(params: dict) -> str: see ``_lamni_compute_type1``/``_lamni_requested_to_stepsize``) without this module-level helper needing to know which setup is active: - type 1: flomni int(180/stepsize)*8, lamni int(360/stepsize)*8 - - type 3: flomni int(180/stepsize)*8, lamni int(360/stepsize)*8 - - type 2: golden ratio has no fixed count -> configured max, or ∞ if unset + - type 2 and 3: golden ratio-flavored, no fixed sub-tomogram count -> + configured max (golden_max_number_of_projections), or ∞ if unset. + Type 3 shifts sub-tomogram starting angles by the golden ratio but + is otherwise capped exactly like type 2, not type 1's fixed grid. """ try: tomo_type = int(params.get("tomo_type", 1)) stepsize = float(params.get("tomo_angle_stepsize", 0) or 0) is_flomni_job = "tomo_angle_range" in params - base_angle = 180.0 if is_flomni_job else 360.0 compute_type1 = _compute_type1 if is_flomni_job else _lamni_compute_type1 if tomo_type == 1: @@ -2355,13 +2356,7 @@ def _format_projections(params: dict) -> str: actual_total, _, _ = compute_type1(angle_range, stepsize) return str(actual_total) - if tomo_type == 3: - if stepsize <= 0: - return "?" - n = int(base_angle / stepsize) - return str(n * 8) - - if tomo_type == 2: + if tomo_type in (2, 3): max_prj = params.get("golden_max_number_of_projections", 0) or 0 try: max_prj = int(float(max_prj))