From 00de06d0e37e63a932641630f16ee57352667c55 Mon Sep 17 00:00:00 2001 From: Jesse Averbukh Date: Tue, 21 Mar 2023 14:54:17 -0400 Subject: [PATCH] Rename to object_only --- jdaviz/app.py | 10 +++++----- jdaviz/tests/test_subsets.py | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/jdaviz/app.py b/jdaviz/app.py index 115ccd0d12..c1ea1ff5a8 100644 --- a/jdaviz/app.py +++ b/jdaviz/app.py @@ -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. @@ -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 @@ -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 diff --git a/jdaviz/tests/test_subsets.py b/jdaviz/tests/test_subsets.py index c56eb5da1a..377a71a46a 100644 --- a/jdaviz/tests/test_subsets.py +++ b/jdaviz/tests/test_subsets.py @@ -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