Skip to content

Commit

Permalink
Rename to object_only
Browse files Browse the repository at this point in the history
  • Loading branch information
javerbukh committed Mar 21, 2023
1 parent 8b3db42 commit 00de06d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions jdaviz/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ def get_subsets_from_viewer(self, viewer_reference, data_label=None, subset_type
return regions

def get_subsets(self, subset_name=None, spectral_only=False,
spatial_only=False, astropy_region=False):
spatial_only=False, object_only=False):
"""
Returns all branches of glue subset tree in the form that subset plugin can recognize.
Expand All @@ -861,8 +861,8 @@ def get_subsets(self, subset_name=None, spectral_only=False,
Return only spectral subsets.
spatial_only : bool
Return only spatial subsets.
astropy_region : bool
Return only astropy_region information and
object_only : bool
Return only object relevant information and
leave out the region class name and glue_state.
Returns
Expand Down Expand Up @@ -906,12 +906,12 @@ def get_subsets(self, subset_name=None, spectral_only=False,
if spectral_only and isinstance(subset_region, SpectralRegion):
all_subsets[label] = subset_region
elif spatial_only and not isinstance(subset_region, SpectralRegion):
if astropy_region:
if object_only:
all_subsets[label] = [reg['region'] for reg in subset_region]
else:
all_subsets[label] = subset_region
elif not spectral_only and not spatial_only:
if astropy_region and not isinstance(subset_region, SpectralRegion):
if object_only and not isinstance(subset_region, SpectralRegion):
all_subsets[label] = [reg['region'] for reg in subset_region]
else:
all_subsets[label] = subset_region
Expand Down
4 changes: 2 additions & 2 deletions jdaviz/tests/test_subsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,12 +378,12 @@ def test_composite_region_with_consecutive_and_not_states(cubeviz_helper):
width=3, height=6, angle=0.0 * u.deg)
assert reg[0] == {'name': 'EllipticalROI', 'glue_state': 'AndNotState', 'region': ellipse1}

regions_list = cubeviz_helper.app.get_subsets("Subset 1", astropy_region=True)
regions_list = cubeviz_helper.app.get_subsets("Subset 1", object_only=True)
assert len(regions_list) == 3
assert regions_list[0].width == 3

regions_list = cubeviz_helper.app.get_subsets("Subset 1", spatial_only=True,
astropy_region=True)
object_only=True)
assert len(regions_list) == 3
assert regions_list[0].width == 3

Expand Down

0 comments on commit 00de06d

Please sign in to comment.