From 1f2f3d28104a06a3ec492935d17ac552c40e5a60 Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Tue, 1 Aug 2023 18:01:20 -0400 Subject: [PATCH] Use truecircle tool from https://github.com/glue-viz/glue-jupyter/pull/376 --- jdaviz/configs/cubeviz/plugins/viewers.py | 2 +- jdaviz/configs/imviz/plugins/viewers.py | 2 +- jdaviz/configs/imviz/tests/test_linking.py | 2 +- jdaviz/configs/imviz/tests/test_parser.py | 2 +- jdaviz/configs/imviz/tests/test_regions.py | 6 +++--- jdaviz/configs/imviz/tests/test_simple_aper_phot.py | 6 +++--- jdaviz/tests/test_subsets.py | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/jdaviz/configs/cubeviz/plugins/viewers.py b/jdaviz/configs/cubeviz/plugins/viewers.py index 5b5c668df5..82393abec3 100644 --- a/jdaviz/configs/cubeviz/plugins/viewers.py +++ b/jdaviz/configs/cubeviz/plugins/viewers.py @@ -24,7 +24,7 @@ class CubevizImageView(JdavizViewerMixin, BqplotImageView): ['jdaviz:homezoom', 'jdaviz:prevzoom'], ['jdaviz:pixelboxzoommatch', 'jdaviz:boxzoom', 'jdaviz:pixelpanzoommatch', 'jdaviz:panzoom'], - ['bqplot:circle', 'bqplot:rectangle', 'bqplot:ellipse'], + ['bqplot:truecircle', 'bqplot:rectangle', 'bqplot:ellipse'], ['jdaviz:spectrumperspaxel'], ['jdaviz:sidebar_plot', 'jdaviz:sidebar_export'] ] diff --git a/jdaviz/configs/imviz/plugins/viewers.py b/jdaviz/configs/imviz/plugins/viewers.py index 55de85dde2..8ed7aad8dd 100644 --- a/jdaviz/configs/imviz/plugins/viewers.py +++ b/jdaviz/configs/imviz/plugins/viewers.py @@ -24,7 +24,7 @@ class ImvizImageView(JdavizViewerMixin, BqplotImageView, AstrowidgetsImageViewer ['jdaviz:homezoom', 'jdaviz:prevzoom'], ['jdaviz:boxzoommatch', 'jdaviz:boxzoom'], ['jdaviz:panzoommatch', 'jdaviz:imagepanzoom'], - ['bqplot:circle', 'bqplot:rectangle', 'bqplot:ellipse', 'bqplot:circannulus', + ['bqplot:truecircle', 'bqplot:rectangle', 'bqplot:ellipse', 'bqplot:circannulus', 'jdaviz:singlepixelregion'], ['jdaviz:blinkonce', 'jdaviz:contrastbias'], ['jdaviz:sidebar_plot', 'jdaviz:sidebar_export', 'jdaviz:sidebar_compass'] diff --git a/jdaviz/configs/imviz/tests/test_linking.py b/jdaviz/configs/imviz/tests/test_linking.py index e3a67ce36e..94dd8b6ee9 100644 --- a/jdaviz/configs/imviz/tests/test_linking.py +++ b/jdaviz/configs/imviz/tests/test_linking.py @@ -113,7 +113,7 @@ def test_wcslink_affine_with_extras(self): self.viewer.cuts = (0, 100) # Add subsets, both interactive and static. - self.imviz._apply_interactive_region('bqplot:circle', (1.5, 2.5), (3.6, 4.6)) + self.imviz._apply_interactive_region('bqplot:truecircle', (1.5, 2.5), (3.6, 4.6)) self.imviz.load_regions([CirclePixelRegion(center=PixCoord(x=6, y=2), radius=5), PolygonPixelRegion(vertices=PixCoord(x=[1, 2, 2], y=[1, 1, 2])), PolygonPixelRegion(vertices=PixCoord(x=[2, 3, 3], y=[2, 2, 3]))]) diff --git a/jdaviz/configs/imviz/tests/test_parser.py b/jdaviz/configs/imviz/tests/test_parser.py index 2089401a4b..5b81a51d48 100644 --- a/jdaviz/configs/imviz/tests/test_parser.py +++ b/jdaviz/configs/imviz/tests/test_parser.py @@ -251,7 +251,7 @@ def test_parse_jwst_nircam_level2(self, imviz_helper): # --- Since download is expensive, we attach GWCS-specific tests here. --- # Ensure interactive region supports GWCS. Also see test_regions.py - imviz_helper._apply_interactive_region('bqplot:circle', + imviz_helper._apply_interactive_region('bqplot:truecircle', (965, 1122), (976.9, 1110.1)) # Star imviz_helper._apply_interactive_region('bqplot:rectangle', diff --git a/jdaviz/configs/imviz/tests/test_regions.py b/jdaviz/configs/imviz/tests/test_regions.py index 145ed2f1ad..bd5603e04d 100644 --- a/jdaviz/configs/imviz/tests/test_regions.py +++ b/jdaviz/configs/imviz/tests/test_regions.py @@ -116,7 +116,7 @@ def test_regions_pixel(self): def test_regions_sky_has_wcs(self): # Mimic interactive region (before) - self.imviz._apply_interactive_region('bqplot:circle', (1.5, 2.5), (3.6, 4.6)) + self.imviz._apply_interactive_region('bqplot:truecircle', (1.5, 2.5), (3.6, 4.6)) sky = SkyCoord(ra=337.5202808, dec=-20.833333059999998, unit='deg') # These will become indistinguishable from normal Subset. @@ -234,9 +234,9 @@ def test_ds9_load_one_good_one_bad(self, imviz_helper): class TestGetInteractiveRegions(BaseImviz_WCS_NoWCS): def test_annulus(self): # Outer circle - self.imviz._apply_interactive_region('bqplot:circle', (0, 0), (9, 9)) + self.imviz._apply_interactive_region('bqplot:truecircle', (0, 0), (9, 9)) # Inner circle - self.imviz._apply_interactive_region('bqplot:circle', (2, 2), (7, 7)) + self.imviz._apply_interactive_region('bqplot:truecircle', (2, 2), (7, 7)) # At this point, there should be two normal circles. subsets = self.imviz.get_interactive_regions() diff --git a/jdaviz/configs/imviz/tests/test_simple_aper_phot.py b/jdaviz/configs/imviz/tests/test_simple_aper_phot.py index 2b9953e54c..cb15067411 100644 --- a/jdaviz/configs/imviz/tests/test_simple_aper_phot.py +++ b/jdaviz/configs/imviz/tests/test_simple_aper_phot.py @@ -18,7 +18,7 @@ class TestSimpleAperPhot(BaseImviz_WCS_WCS): def test_plugin_wcs_dithered(self): self.imviz.link_data(link_type='wcs') # They are dithered by 1 pixel on X - self.imviz._apply_interactive_region('bqplot:circle', (0, 0), (9, 9)) # Draw a circle + self.imviz._apply_interactive_region('bqplot:truecircle', (0, 0), (9, 9)) # Draw a circle phot_plugin = self.imviz.app.get_tray_item_from_name('imviz-aper-phot-simple') @@ -171,7 +171,7 @@ def test_plugin_wcs_dithered(self): class TestSimpleAperPhot_NoWCS(BaseImviz_WCS_NoWCS): def test_plugin_no_wcs(self): # Most things already tested above, so not re-tested here. - self.imviz._apply_interactive_region('bqplot:circle', (0, 0), (9, 9)) # Draw a circle + self.imviz._apply_interactive_region('bqplot:truecircle', (0, 0), (9, 9)) # Draw a circle phot_plugin = self.imviz.app.get_tray_item_from_name('imviz-aper-phot-simple') phot_plugin.dataset_selected = 'has_wcs[SCI,1]' @@ -277,7 +277,7 @@ def test_annulus_background(imviz_helper): # Mark an object of interest # CirclePixelRegion(center=PixCoord(x=150, y=25), radius=7) - imviz_helper._apply_interactive_region('bqplot:circle', (143, 18), (157, 32)) + imviz_helper._apply_interactive_region('bqplot:truecircle', (143, 18), (157, 32)) # Load annulus (this used to be part of the plugin but no longer) annulus_1 = CircleAnnulusPixelRegion( diff --git a/jdaviz/tests/test_subsets.py b/jdaviz/tests/test_subsets.py index 461ccd9f21..030edfd57e 100644 --- a/jdaviz/tests/test_subsets.py +++ b/jdaviz/tests/test_subsets.py @@ -125,7 +125,7 @@ def test_region_from_subset_3d(cubeviz_helper): # Circular Subset flux_viewer = cubeviz_helper.app.get_viewer("flux-viewer") # We set the active tool here to trigger a reset of the Subset state to "Create New" - flux_viewer.toolbar.active_tool = flux_viewer.toolbar.tools['bqplot:circle'] + flux_viewer.toolbar.active_tool = flux_viewer.toolbar.tools['bqplot:truecircle'] cubeviz_helper.app.get_viewer('flux-viewer').apply_roi(CircularROI(xc=3, yc=4, radius=2.4)) assert subset_plugin.subset_selected == "Subset 2" assert subset_plugin.subset_types == ["CircularROI"]