fix: AttributeError when selecting Simple Recording/Tracking tab - #584
Merged
Conversation
… tabs onTabChanged unconditionally called emit_selected_channels() on whatever record tab was selected, but only the multipoint widgets define it. Selecting the Simple Recording (or Tracking) tab raised AttributeError on machines with ENABLE_RECORDING/ENABLE_TRACKING on. toggleAcquisitionStart had the same latent issue with display_progress_bar() when a workflow/TCP acquisition starts while a non-multipoint tab is current. Guard both with hasattr, matching the existing pattern in _run_acquisition_for_workflow, and add a regression test that builds the simulated GUI with ENABLE_RECORDING on and exercises both paths. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…change Replace the hasattr guards with a structural fix: - The napari multichannel viewer's channel set is now initialized where its shape already is: at acquisition start, next to signal_acquisition_shape, in all three multipoint widgets (Wellplate's _set_ui_acquisition_running covers both the button and TCP paths). onTabChanged no longer calls anything on the selected tab, so non-multipoint tabs (Simple Recording, Tracking) are never asked for channel selections they don't have. - Drop the display_progress_bar call from toggleAcquisitionStart entirely: every widget with a progress bar already connects its own signal_acquisition_started to display_progress_bar, so the call was redundant for multipoint tabs and a crash for the rest. Add a test that signal_acquisition_channels is emitted at acquisition start with the selected channel names. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
hongquanli
added a commit
that referenced
this pull request
Jul 6, 2026
) master (PR #584) removed the duck-typed emit_selected_channels() / display_progress_bar() calls from gui_hcs.onTabChanged and toggleAcquisitionStart — channels are now emitted by each multipoint widget at acquisition start. RecordZStackMultiPointWidget's no-op stubs (added in 9b5be65 to satisfy the old contract) and their regression test are now unreachable dead code; remove them. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Alpaca233
pushed a commit
that referenced
this pull request
Jul 27, 2026
) master (PR #584) removed the duck-typed emit_selected_channels() / display_progress_bar() calls from gui_hcs.onTabChanged and toggleAcquisitionStart — channels are now emitted by each multipoint widget at acquisition start. RecordZStackMultiPointWidget's no-op stubs (added in 9b5be65 to satisfy the old contract) and their regression test are now unreachable dead code; remove them. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Selecting the Simple Recording tab (or Tracking tab) crashes with:
onTabChangedcalledemit_selected_channels()on whatever record tab was selected, but only the multipoint widgets (Flexible, Wellplate, Fluidics) define that method. Most machine configs haveENABLE_RECORDINGoff, which is why this went unnoticed.toggleAcquisitionStarthad the same latent bug withdisplay_progress_bar().Fix (structural, no hasattr guards)
The first commit guarded both calls with
hasattr; the second commit replaces that with a structural fix:Channels: emit at acquisition start, not tab change. The napari multichannel viewer needs two inputs: shape and channels. Shape was already emitted at acquisition start (next to
signal_acquisition_started); channels rode on tab change. Nowemit_selected_channels()is called at the same acquisition-start point in all three multipoint widgets — Wellplate's_set_ui_acquisition_runningcovers both the button path and the TCP/invokeMethodpath.onTabChangedno longer calls anything on the selected tab, so tabs without channel selections are never asked. Timing is safe: the only consumer of the channel set (updateLayers) runs exclusively during an acquisition, and the per-tabitemSelectionChangedconnections still keep it fresh in between.Progress bar: delete the gui_hcs call. Every widget with a progress bar already connects its own
signal_acquisition_startedto its owndisplay_progress_bar, andtoggleAcquisitionStartis only ever invoked via that same signal — the call in gui_hcs was redundant for multipoint tabs and a crash for the rest.Testing
ENABLE_RECORDINGpatched on, switches to the Simple Recording tab, and cyclestoggleAcquisitionStart— reproduced the exact AttributeError before the fix, passes after.signal_acquisition_channelsis emitted at acquisition start with the selected channel names.tests/control/test_HighContentScreeningGui.pypass locally withQT_API=pyqt5(this file is skipped in CI).blackclean.🤖 Generated with Claude Code