Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix reference to plugins in metadata #2826

Merged
merged 2 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions jdaviz/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,8 +709,8 @@ def _link_new_data(self, reference_data=None, data_to_be_linked=None):
dc.add_link(links)
return

elif (linked_data.meta.get('Plugin', None) == 'SpectralExtraction' or
(linked_data.meta.get('Plugin', None) == ('GaussianSmooth') and
elif (linked_data.meta.get('Plugin', None) == 'Spectral Extraction' or
(linked_data.meta.get('Plugin', None) == ('Gaussian Smooth') and
linked_data.ndim < 3 and # Cube linking requires special logic. See below
ref_data.ndim < 3)
):
Expand Down Expand Up @@ -749,7 +749,7 @@ def _link_new_data(self, reference_data=None, data_to_be_linked=None):
ref_index = ind
if (len_linked_pixel == 2 and
(linked_data.meta.get("Plugin", None) in
['MomentMap', 'Collapse'])):
['Moment Maps', 'Collapse'])):
if pixel_coord == 'z':
linked_index = pc_linked.index('x')
elif pixel_coord == 'y':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ def test_moment_calculation(cubeviz_helper, spectrum1d_cube, tmp_path):
assert len(dc.links) == 22
assert len(dc.external_links) == 4 # pixel linked
# Link 3D z to 2D x and 3D y to 2D y
assert (dc.external_links[0].cids1[0].label == "Pixel Axis 0 [z]" and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirmed locally that this test fails on main without this patch as follows:

E       AssertionError: assert ('Pixel Axis 0 [z]' == 'Pixel Axis 0 [z]'
E
E           Pixel Axis 0 [z] and 'Pixel Axis 0 [y]' == 'Pixel Axis 1 [x]'
E
E         - Pixel Axis 1 [x]
E         ?            ^  ^
E         + Pixel Axis 0 [y]
E         ?            ^  ^)

dc.external_links[0].cids2[0].label == "Pixel Axis 1 [x]" and
dc.external_links[1].cids1[0].label == "Pixel Axis 1 [y]" and
dc.external_links[1].cids2[0].label == "Pixel Axis 0 [y]")

# Coordinate display should be unaffected.
label_mouseover._viewer_mouse_event(flux_viewer, {'event': 'mousemove',
Expand Down
Loading