From 184cfc85fa2ed70fa1f787cef9b698746ff9f5c3 Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Thu, 9 Jan 2025 12:46:13 -0500 Subject: [PATCH 1/2] orientation: remove deprecated link_type, wcs_use_affine --- CHANGES.rst | 2 ++ .../imviz/plugins/orientation/orientation.py | 23 +------------------ jdaviz/configs/imviz/tests/test_helper.py | 3 --- 3 files changed, 3 insertions(+), 25 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index edc73564c7..ac80c8b589 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -42,6 +42,8 @@ Cubeviz Imviz ^^^^^ +- Orientation plugin: ``link_type`` and ``wcs_use_affine`` (previously deprecated) have now been removed. [#3385] + Mosviz ^^^^^^ diff --git a/jdaviz/configs/imviz/plugins/orientation/orientation.py b/jdaviz/configs/imviz/plugins/orientation/orientation.py index 61547b24dc..b5dbee71f2 100644 --- a/jdaviz/configs/imviz/plugins/orientation/orientation.py +++ b/jdaviz/configs/imviz/plugins/orientation/orientation.py @@ -1,5 +1,4 @@ from astropy import units as u -from astropy.utils import deprecated from astropy.wcs.wcsapi import BaseHighLevelWCS from glue.core.link_helpers import LinkSame from glue.core.message import ( @@ -152,33 +151,13 @@ def user_api(self): return PluginUserApi( self, expose=( - 'align_by', 'link_type', 'wcs_fast_approximation', 'wcs_use_affine', + 'align_by', 'wcs_fast_approximation', 'delete_subsets', 'viewer', 'orientation', 'rotation_angle', 'east_left', 'add_orientation', 'set_north_up_east_left', 'set_north_up_east_right', ) ) - @property - @deprecated(since="4.0", alternative="align_by") - def link_type(self): - return self.align_by - - @link_type.setter - @deprecated(since="4.0", alternative="align_by") - def link_type(self, link_type): - self.align_by = link_type - - @property - @deprecated(since="4.0", alternative="wcs_fast_approximation") - def wcs_use_affine(self): - return self.wcs_fast_approximation - - @wcs_use_affine.setter - @deprecated(since="4.0", alternative="wcs_fast_approximation") - def wcs_use_affine(self, wcs_use_affine): - self.wcs_fast_approximation = wcs_use_affine - def _link_image_data(self): self.linking_in_progress = True try: diff --git a/jdaviz/configs/imviz/tests/test_helper.py b/jdaviz/configs/imviz/tests/test_helper.py index dd5add87da..f2e4410cb7 100644 --- a/jdaviz/configs/imviz/tests/test_helper.py +++ b/jdaviz/configs/imviz/tests/test_helper.py @@ -1,9 +1,6 @@ import numpy as np -import pytest -@pytest.mark.filterwarnings(r"ignore:The link_type function is deprecated") -@pytest.mark.filterwarnings(r"ignore:The wcs_use_affine function is deprecated") def test_plugin_user_apis(imviz_helper): for plugin_name, plugin_api in imviz_helper.plugins.items(): plugin = plugin_api._obj From 424cfbe8c5dba48e740b58615e6ac647b56e3023 Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Thu, 9 Jan 2025 14:40:27 -0500 Subject: [PATCH 2/2] update notebooks/docs --- docs/imviz/plugins.rst | 2 +- notebooks/ImvizDitheredExample.ipynb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/imviz/plugins.rst b/docs/imviz/plugins.rst index 2d9d87c0c2..8986e89718 100644 --- a/docs/imviz/plugins.rst +++ b/docs/imviz/plugins.rst @@ -202,7 +202,7 @@ From the API within the Jupyter notebook (if linking by WCS): .. code-block:: python - imviz.link_data(link_type='wcs') + imviz.link_data(align_by='wcs') .. _imviz-orientation-rotation: diff --git a/notebooks/ImvizDitheredExample.ipynb b/notebooks/ImvizDitheredExample.ipynb index 2093167554..2fc6c824a4 100644 --- a/notebooks/ImvizDitheredExample.ipynb +++ b/notebooks/ImvizDitheredExample.ipynb @@ -568,7 +568,7 @@ "metadata": {}, "outputs": [], "source": [ - "imviz.link_data(link_type='wcs')" + "imviz.link_data(align_by='wcs')" ] }, {