Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: Fix devdeps failures #2170

Merged
merged 1 commit into from
Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is tracked by #2165 on our end, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, but the canonical issue is upstream.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wanted to make sure we had a reminder to remove it - thanks!

#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