Skip to content

Commit

Permalink
Change function name
Browse files Browse the repository at this point in the history
  • Loading branch information
pllim committed Jun 15, 2023
1 parent 41a8197 commit 3e4a7ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions glue_astronomy/translators/regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
PointPixelRegion, PixCoord, EllipsePixelRegion,
AnnulusPixelRegion, CircleAnnulusPixelRegion)

__all__ = ["range_to_rect", "roi_subset_state_to_spatial", "AstropyRegionsHandler"]
__all__ = ["range_to_rect", "roi_subset_state_to_region", "AstropyRegionsHandler"]

GLUE_LT_1_11 = Version(glue_version) < Version('1.11')

Expand Down Expand Up @@ -53,7 +53,7 @@ def range_to_rect(data, ori, low, high):
return RectanglePixelRegion(PixCoord(xcen, ycen), width, height)


def roi_subset_state_to_spatial(subset_state, to_sky=False):
def roi_subset_state_to_region(subset_state, to_sky=False):
"""Translate the given ``RoiSubsetState`` containing ROI
that is compatible with 2D spatial regions to proper
``regions`` shape. If ``to_sky=True`` is given, it will
Expand Down Expand Up @@ -198,7 +198,7 @@ def to_object(self, subset):
f"ROIs of type {roi.__class__.__name__} are not yet supported")

else:
return roi_subset_state_to_spatial(subset_state)
return roi_subset_state_to_region(subset_state)

elif isinstance(subset_state, RangeSubsetState):
x_pix_att, y_pix_att = _get_xy_pix_att_from_subset(subset)
Expand Down
4 changes: 2 additions & 2 deletions glue_astronomy/translators/tests/test_regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from glue import __version__ as glue_version

from glue_astronomy.translators.regions import (_annulus_to_subset_state, GLUE_LT_1_11,
roi_subset_state_to_spatial)
roi_subset_state_to_region)
from glue_astronomy.translators.tests.test_nddata import WCS_CELESTIAL


Expand Down Expand Up @@ -49,7 +49,7 @@ def test_rectangular_roi(self):
assert_allclose(reg.width, 2.5)
assert_allclose(reg.height, 3.5)

reg_sky = roi_subset_state_to_spatial(subset_state, to_sky=True)
reg_sky = roi_subset_state_to_region(subset_state, to_sky=True)
assert isinstance(reg_sky, RectangleSkyRegion)

def test_polygonal_roi(self):
Expand Down

0 comments on commit 3e4a7ab

Please sign in to comment.