diff --git a/CHANGES.rst b/CHANGES.rst index 21edc3b17e..df2e074fa4 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -11,7 +11,7 @@ New Features - The Plot Options plugin now include a 'spline' stretch feature. [#2525] -- User can now remove data from the app completely after removing it from viewers. [#2409] +- User can now remove data from the app completely after removing it from viewers. [#2409, #2531] Cubeviz ^^^^^^^ diff --git a/jdaviz/app.py b/jdaviz/app.py index dfd57f050b..e06a26924d 100644 --- a/jdaviz/app.py +++ b/jdaviz/app.py @@ -1910,10 +1910,10 @@ def _reparent_subsets(self, old_parent, new_parent=None): from astropy.wcs.utils import pixel_to_pixel if isinstance(old_parent, str): - old_parent = self.data_collection(old_parent) + old_parent = self.data_collection[old_parent] if isinstance(new_parent, str): - new_parent = self.data_collection(new_parent) + new_parent = self.data_collection[new_parent] elif new_parent is None: for data in self.data_collection: if data is not old_parent: diff --git a/jdaviz/configs/imviz/tests/test_delete_data.py b/jdaviz/configs/imviz/tests/test_delete_data.py index 9d7581a827..16d7273482 100644 --- a/jdaviz/configs/imviz/tests/test_delete_data.py +++ b/jdaviz/configs/imviz/tests/test_delete_data.py @@ -8,6 +8,13 @@ class TestDeleteData(BaseImviz_WCS_WCS): + def test_reparent_str(self): + for subset in self.imviz.app.data_collection.subset_groups: + self.imviz.app._reparent_subsets( + subset.subset_state.xatt.parent.label, + "has_wcs_1[SCI,1]" + ) + def test_delete_with_subset_wcs(self): # Add a third dataset to test relinking arr = np.ones((10, 10))