Skip to content

Commit

Permalink
remove "Imviz" from "Line Profiles XY" plugin name with deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Jul 30, 2024
1 parent dc2186e commit b8c897f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions jdaviz/configs/imviz/tests/test_line_profile_xy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions jdaviz/core/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b8c897f

Please sign in to comment.