Skip to content

Commit

Permalink
Merge pull request #2174 from meeseeksmachine/auto-backport-of-pr-217…
Browse files Browse the repository at this point in the history
…0-on-v3.4.x

Backport PR #2170 on branch v3.4.x (TST: Fix devdeps failures)
  • Loading branch information
pllim authored Apr 28, 2023
2 parents b9fe877 + f56b7cc commit 3a67302
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
16 changes: 13 additions & 3 deletions jdaviz/configs/imviz/tests/test_regions.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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)

Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,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/[email protected]
devdeps: git+https://github.com/glue-viz/glue.git
devdeps: git+https://github.com/voila-dashboards/voila.git
Expand Down

0 comments on commit 3a67302

Please sign in to comment.