fix(flomni): fix UnboundLocalError for dev in tomo_scan_projection
CI for csaxs_bec / test (push) Failing after 2m19s
CI for csaxs_bec / test (push) Failing after 2m19s
dev = builtins.__dict__.get("dev") was only executed inside the
`if not _internal:` block, but Python treats any name assigned
anywhere in a function as local to the whole function. The
unconditional dev.rtx.controller.laser_tracker_check_signalstrength()
call later in the function then raised UnboundLocalError whenever
_internal=True (e.g. tomo_alignment_scan() and the fermat branch of
_at_each_angle). Hoist the fetch above the guard so dev is always
bound.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018CUx5yV1iCBhL5sFEHEoPe
This commit is contained in:
1 parent
3bea6b1a30
commit
e65389376d
1 file changed
+1
-1
@@ -3363,8 +3363,8 @@ class Flomni(
|
||||
_at_each_angle, and tomo_alignment_scan, which needs real ptycho
|
||||
data) pass _internal=True to skip the prompt.
|
||||
"""
|
||||
dev = builtins.__dict__.get("dev")
|
||||
if not _internal:
|
||||
dev = builtins.__dict__.get("dev")
|
||||
all_out, offending = filters_out_of_beam(dev)
|
||||
if not all_out:
|
||||
warning = f"Not all filters are out of the beam: {', '.join(offending)}."
|
||||
|
||||
Reference in new issue
Block a user