Keep header axes synced under ctrl+P propagation - #50
Merged
Conversation
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.
Problem
The top and side header axes are linked to the main seismic view, and ctrl+P propagates the link across windows. But a pyqtgraph
ViewBoxholds only one linked view per axis, so callingsetXLinktwice on the same viewbox overwrites the first link.The intra-window wiring put the link on the seismic viewbox (
seismic.setXLink(header_h)). Whenpropagate()then raneqc.seismic.setXLink(master.seismic), it clobbered that slot and detached the propagated windows' header axes.Fix
Reverse the intra-window link direction: link the header viewboxes to the seismic (
header_h.setXLink(seismic),header_v.setYLink(seismic)). This frees the seismic's X/Y link slots for cross-window propagation. Because linking is bidirectional and chains transitively, everything now stays in sync:header -> seismic -> master-seismic.Also harden
EasyQC._instances()(inherited byEphysViewer) to skip wrappers whose underlying C++ object has been deleted — these still passisinstancebut raiseRuntimeErroron any method call, which could surface during window lookup or ctrl+P propagation when a stale window lingered.Tests
test_header_axes_track_seismic: header viewboxes link to the seismic, the seismic's slots stay free, and panning propagates to the header strip.test_propagate_link_keeps_headers_attached: after the cross-window link, the other window's seismic follows the master and its header still follows its own seismic.test_instances_skips_deleted_wrappers:_instances()filters out deleted wrappers instead of raising.Full suite (53 tests) passes; ruff clean.