From f7a9da468a38c2712c319b79b9459e171cf6fa56 Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Tue, 23 Apr 2024 14:40:52 -0400 Subject: [PATCH 1/2] fix reference to plugins in metadata * changed to be the human-friendly name in #2680, but missed updating a few cases, resulting in moment maps not being linked correctly --- jdaviz/app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jdaviz/app.py b/jdaviz/app.py index 5003dbd175..117eea8e17 100644 --- a/jdaviz/app.py +++ b/jdaviz/app.py @@ -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) ): @@ -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': From 375383fdb6a8cea90b75d7e82a13fbf00c50c526 Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Tue, 23 Apr 2024 15:49:35 -0400 Subject: [PATCH 2/2] TST: Add link cids check as regression test. This check currently fails on main but should be passing as part of PR 2826 --- .../cubeviz/plugins/moment_maps/tests/test_moment_maps.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jdaviz/configs/cubeviz/plugins/moment_maps/tests/test_moment_maps.py b/jdaviz/configs/cubeviz/plugins/moment_maps/tests/test_moment_maps.py index 912c546d6d..d919cf776b 100644 --- a/jdaviz/configs/cubeviz/plugins/moment_maps/tests/test_moment_maps.py +++ b/jdaviz/configs/cubeviz/plugins/moment_maps/tests/test_moment_maps.py @@ -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 + 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',