From b8c897fed4fe8d89c0d8bf34ceffe066a0d9a553 Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Tue, 30 Jul 2024 08:35:46 -0400 Subject: [PATCH] remove "Imviz" from "Line Profiles XY" plugin name with deprecation --- .../imviz/plugins/line_profile_xy/line_profile_xy.py | 2 +- jdaviz/configs/imviz/tests/test_line_profile_xy.py | 4 ++-- jdaviz/core/helpers.py | 7 +++++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/jdaviz/configs/imviz/plugins/line_profile_xy/line_profile_xy.py b/jdaviz/configs/imviz/plugins/line_profile_xy/line_profile_xy.py index d44bc6f55b..d71914aeaa 100644 --- a/jdaviz/configs/imviz/plugins/line_profile_xy/line_profile_xy.py +++ b/jdaviz/configs/imviz/plugins/line_profile_xy/line_profile_xy.py @@ -11,7 +11,7 @@ __all__ = ['LineProfileXY'] -@tray_registry('imviz-line-profile-xy', label="Imviz Line Profiles (XY)") +@tray_registry('imviz-line-profile-xy', label="Line Profiles (XY)") class LineProfileXY(PluginTemplateMixin, ViewerSelectMixin): template_file = __file__, "line_profile_xy.vue" uses_active_status = Bool(True).tag(sync=True) diff --git a/jdaviz/configs/imviz/tests/test_line_profile_xy.py b/jdaviz/configs/imviz/tests/test_line_profile_xy.py index adb1a884c0..50f54dec1a 100644 --- a/jdaviz/configs/imviz/tests/test_line_profile_xy.py +++ b/jdaviz/configs/imviz/tests/test_line_profile_xy.py @@ -9,7 +9,7 @@ class TestLineProfileXY(BaseImviz_WCS_NoWCS): def test_plugin_linked_by_pixel(self): """Go through plugin logic but does not check plot contents.""" - lp_plugin = self.imviz.plugins['Imviz Line Profiles (XY)']._obj + lp_plugin = self.imviz.plugins['Line Profiles (XY)']._obj lp_plugin.plugin_opened = True assert lp_plugin.viewer.labels == ['imviz-0'] @@ -79,7 +79,7 @@ def test_line_profile_with_nan(imviz_helper): arr[5, 5] = np.nan imviz_helper.load_data(arr) - lp_plugin = imviz_helper.plugins['Imviz Line Profiles (XY)']._obj + lp_plugin = imviz_helper.plugins['Line Profiles (XY)']._obj lp_plugin.plugin_opened = True lp_plugin.selected_x = 5 lp_plugin.selected_y = 5 diff --git a/jdaviz/core/helpers.py b/jdaviz/core/helpers.py index 3e82de5e57..0bc1bc36a1 100644 --- a/jdaviz/core/helpers.py +++ b/jdaviz/core/helpers.py @@ -137,13 +137,20 @@ def plugins(self): # handle renamed plugins during deprecation if 'Orientation' in plugins: + # renamed in 3.9 plugins['Links Control'] = plugins['Orientation']._obj.user_api plugins['Links Control']._deprecation_msg = 'in the future, the formerly named \"Links Control\" plugin will only be available by its new name: \"Orientation\".' # noqa if 'Canvas Rotation' in plugins: + # removed in 3.9 plugins['Canvas Rotation']._deprecation_msg = 'this functionality will be removed in favor of the implementation for rotation in the \"Orientation\" plugin.' # noqa if 'Export' in plugins: + # renamed in 3.9 plugins['Export Plot'] = plugins['Export']._obj.user_api plugins['Export Plot']._deprecation_msg = 'in the future, the formerly named \"Export Plot\" plugin will only be available by its new name: \"Export\".' # noqa + if 'Line Profiles (XY)' in plugins: + # renamed in 4.0 + plugins['Imviz Line Profiles (XY)'] = plugins['Line Profiles (XY)']._obj.user_api + plugins['Imviz Line Profiles (XY)']._deprecation_msg = 'in the future, the formerly named \"Imviz Line Profiles (XY)\" plugin will only be available by its new name: \"Line Profiles (XY)\".' # noqa return plugins