fix(tomo_params): pin seed=0 in the OMNY fermat position estimate, as flomni/lamni
CI for csaxs_bec / test (pull_request) Successful in 3m29s
Read the Docs Deploy Trigger / trigger-rtd-webhook (push) Successful in 3s
CI for csaxs_bec / test (push) Successful in 3m39s

get_omny_fermat_spiral_pos() draws a random sub-step offset per call, so the
estimate (and its test against a second call) was not reproducible.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit was merged in pull request #334.
This commit is contained in:
Mirko HollerandClaude Opus 5.5 committed 2026-10-26 14:01:12 +01:00
1 parent 8a2ec8ee7d
commit 96c02b3367
2 files changed
+15 -2

No files matched your search

@@ -2767,6 +2767,11 @@ def _compute_fermat_positions_omny(params: dict[str, Any]) -> tuple[int, int]:
estimate can never drift out of sync. cenx/ceny/zshift left at their
defaults -- they only shift the final position, never affect the count.
The real scan also draws a fresh random sub-step offset on every call
(see get_omny_fermat_spiral_pos()'s `seed` argument), which can shift
the actual scan-time count by a point or two near the threshold. A
fixed seed is used here only so this estimate is itself reproducible.
Returns:
(estimated_count, minimum_required)
"""
@@ -2778,7 +2783,13 @@ def _compute_fermat_positions_omny(params: dict[str, Any]) -> tuple[int, int]:
if step <= 0:
return 0, OmnyFermatScan.MIN_POSITIONS
positions = OmnyFermatScan.get_omny_fermat_spiral_pos(
-abs(fovx / 2), abs(fovx / 2), -abs(fovy / 2), abs(fovy / 2), step=step, spiral_type=0
-abs(fovx / 2),
abs(fovx / 2),
-abs(fovy / 2),
abs(fovy / 2),
step=step,
spiral_type=0,
seed=0,
)
return len(positions), OmnyFermatScan.MIN_POSITIONS
@@ -138,8 +138,10 @@ def test_compute_fermat_positions_omny_matches_scan_class_below_threshold():
count, min_positions = _compute_fermat_positions_omny(params)
assert min_positions == OmnyFermatScan.MIN_POSITIONS
assert count < min_positions
# _compute_fermat_positions_omny() pins seed=0 for its own reproducibility --
# match it here rather than drawing an independent random offset.
expected = OmnyFermatScan.get_omny_fermat_spiral_pos(
-1.0, 1.0, -1.0, 1.0, step=2.0, spiral_type=0
-1.0, 1.0, -1.0, 1.0, step=2.0, spiral_type=0, seed=0
)
assert count == len(expected)