Skip to content

Commit

Permalink
Merge pull request #2531 from bmorris3/fix-reparent-str
Browse files Browse the repository at this point in the history
Bugfix: enable str arguments for app._reparent_subsets
  • Loading branch information
pllim authored Oct 25, 2023
2 parents f5a2a46 + 526be14 commit 405ac06
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
^^^^^^^
Expand Down
4 changes: 2 additions & 2 deletions jdaviz/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 7 additions & 0 deletions jdaviz/configs/imviz/tests/test_delete_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 405ac06

Please sign in to comment.