feat(multipoint): restore channel settings when loading acquisition YAML#590
Open
hongquanli wants to merge 1 commit into
Open
feat(multipoint): restore channel settings when loading acquisition YAML#590hongquanli wants to merge 1 commit into
hongquanli wants to merge 1 commit into
Conversation
Dropping a previous acquisition onto the wellplate multipoint widget restored only the channel selection and order; exposure time, analog gain, and illumination intensity recorded in acquisition.yaml were ignored, so reproducing an acquisition required re-entering them by hand. - Parse per-channel settings from the channels section into a new ChannelYAMLSettings dataclass (None for values absent from older YAMLs). - Restore them via ConfigRepository.update_channel_setting — the same persistence path as live-control edits — respecting the current confocal/widefield mode. Out-of-range values are skipped with a warning since update_channel_setting bypasses pydantic assignment validation and a bad persisted value would break profile loading. Channels missing from the current configuration are skipped. - Z-offset is deliberately not restored: it is sample-dependent (relative to the laser AF reference), so an old acquisition's offsets don't transfer and could cause unwanted Z moves. - New signal_channel_settings_restored on both multipoint widgets, wired in gui_hcs to LiveControlWidget.refresh_current_mode_settings so the live panel re-reads the active channel's values without applying the live Z-offset. 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
Dragging a previous acquisition (folder or
acquisition.yaml) onto the Wellplate Multipoint widget restored only the channel selection and order — the per-channel exposure time, analog gain, and illumination intensity recorded in the YAML were ignored, so reproducing an acquisition still required re-entering them by hand. This PR restores those settings on drop.Changes
acquisition_yaml_loader.py: parse the fullchannels:section into a newChannelYAMLSettingsdataclass (exposure, gain, intensity). Values absent from older YAMLs or non-numeric parse toNoneand are simply not restored.AcquisitionYAMLDropMixin._restore_channel_settings: persist the parsed values throughConfigRepository.update_channel_setting()— the same path as live-control spinbox edits — respecting the current confocal/widefield mode.update_channel_settingbypasses pydantic assignment validation, so persisting a bad value from a hand-edited YAML would make the whole profile fail validation on next startup.signal_channel_settings_restoredon both multipoint widgets, connected ingui_hcs.pyto a newLiveControlWidget.refresh_current_mode_settings()that re-reads the active channel's values and re-applies the mode — without applying the live per-channel Z-offset, since the channel didn't change.Deliberately not restored
Z-offset.
z_offset_umis documented as sample-dependent (relative to the laser AF reference; "re-capture or reset when starting a new sample"), so importing an old sample's offsets could cause unwanted Z moves during acquisition.The Flexible Multipoint widget gets the same signal for consistency, but its drop handler still shows "not supported yet" and never loads — no behavior change there.
Testing
test_acquisition_yaml_channel_restore.py: restore + repo call args, confocal mode pass-through, unknown-channel /None/ out-of-range skips, repo failure not counted, signal emitted only when something was restored.test_HighContentScreeningGui.pyin my environment are unrelated — they fail identically on master (PyQt6 fallback vs the PyQt5-onlyactivated[str]overload atwidgets.py:4235).🤖 Generated with Claude Code