From 0c513d4151b94869fdb6fb674baebfb2c64d4493 Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Thu, 27 Apr 2023 16:45:41 -0400 Subject: [PATCH] TST: Fix devdeps failures --- jdaviz/configs/imviz/tests/test_regions.py | 16 +++++++++++++--- tox.ini | 3 ++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/jdaviz/configs/imviz/tests/test_regions.py b/jdaviz/configs/imviz/tests/test_regions.py index 10072c7a9c..38a60fbc78 100644 --- a/jdaviz/configs/imviz/tests/test_regions.py +++ b/jdaviz/configs/imviz/tests/test_regions.py @@ -1,14 +1,18 @@ +import glue_astronomy import numpy as np from astropy import units as u from astropy.coordinates import SkyCoord, Angle from astropy.utils.data import get_pkg_data_filename +from packaging.version import Version from photutils.aperture import CircularAperture, SkyCircularAperture from regions import (PixCoord, CircleSkyRegion, RectanglePixelRegion, CirclePixelRegion, EllipsePixelRegion, PointSkyRegion, PolygonPixelRegion, - CircleAnnulusSkyRegion, Regions) + CircleAnnulusPixelRegion, CircleAnnulusSkyRegion, Regions) from jdaviz.configs.imviz.tests.utils import BaseImviz_WCS_NoWCS +GLUE_ASTRONOMY_LT_0_7_1 = not (Version(glue_astronomy.__version__) >= Version("0.7.1.dev")) + class BaseRegionHandler: """Test to see if region is loaded. @@ -230,10 +234,16 @@ def test_annulus(self): new_subset = subset_groups[0].subset_state & ~subset_groups[1].subset_state self.viewer.apply_subset_state(new_subset) - # Annulus is no longer accessible by API but also should not crash Imviz. + # In older glue-astronomy, annulus is no longer accessible by API + # but also should not crash Imviz. subsets = self.imviz.get_interactive_regions() assert len(self.imviz.app.data_collection.subset_groups) == 3 - assert list(subsets.keys()) == ['Subset 1', 'Subset 2'], subsets + if GLUE_ASTRONOMY_LT_0_7_1: + expected_subset_keys = ['Subset 1', 'Subset 2'] + else: + expected_subset_keys = ['Subset 1', 'Subset 2', 'Subset 3'] + assert isinstance(subsets['Subset 3'], CircleAnnulusPixelRegion) + assert list(subsets.keys()) == expected_subset_keys, subsets assert isinstance(subsets['Subset 1'], CirclePixelRegion) assert isinstance(subsets['Subset 2'], CirclePixelRegion) diff --git a/tox.ini b/tox.ini index 80e46204a7..52b0bda98f 100644 --- a/tox.ini +++ b/tox.ini @@ -50,7 +50,8 @@ deps = devdeps: git+https://github.com/spacetelescope/gwcs.git devdeps: git+https://github.com/asdf-format/asdf.git devdeps: git+https://github.com/astropy/asdf-astropy.git - devdeps: git+https://github.com/spacetelescope/stdatamodels.git + # FIXME: https://github.com/spacetelescope/stdatamodels/issues/159 + #devdeps: git+https://github.com/spacetelescope/stdatamodels.git devdeps: git+https://github.com/bqplot/bqplot.git@0.12.x devdeps: git+https://github.com/glue-viz/glue.git devdeps: git+https://github.com/voila-dashboards/voila.git