Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rehome subsets after removing data from viewer. #2409

Merged
merged 40 commits into from
Oct 23, 2023

Conversation

rosteen
Copy link
Collaborator

@rosteen rosteen commented Aug 30, 2023

This builds off of Duy's work to delete data from the data collection. Once I've figured out/debugged the relevant subset rehoming code I'll split just that out into it's own PR.

@codecov
Copy link

codecov bot commented Sep 18, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Files Coverage Δ
...nfigs/cubeviz/plugins/tests/test_data_selection.py 100.00% <100.00%> (ø)
jdaviz/configs/imviz/helper.py 97.38% <100.00%> (+0.02%) ⬆️
jdaviz/configs/imviz/tests/test_delete_data.py 100.00% <100.00%> (ø)
jdaviz/configs/specviz/tests/test_helper.py 100.00% <100.00%> (ø)
jdaviz/app.py 86.02% <94.80%> (+0.67%) ⬆️

... and 4 files with indirect coverage changes

📢 Thoughts on this report? Let us know!.

@rosteen
Copy link
Collaborator Author

rosteen commented Sep 19, 2023

Here's a video of this in action. You can see that I hit the bug reported in #2085 at the end of this, or at least a very similar one.

Screen.Recording.2023-09-18.at.3.11.45.PM.mov

@rosteen rosteen force-pushed the duytnguyendtn-delete3 branch from 83d7b85 to 4e421c4 Compare September 19, 2023 13:50
@rosteen rosteen marked this pull request as ready for review September 19, 2023 14:46
@rosteen
Copy link
Collaborator Author

rosteen commented Sep 19, 2023

Marked this as ready for review, I think it's ready for people to try breaking it. I could still break out my code (the subset rehoming) into a separate PR from Duy's code to allow deleting data if there are other issues still to address with data deletion, but as far as I recall the subset problem was the main thing holding the deletion back, so we could potentially merge both together with this PR.

@camipacifici
Copy link
Contributor

I tried, but I do not see the same behavior as in the video. The subsets are not showing anymore and the subset plugin still points to the original coordinates. I was using multiple viewers...maybe that caused some glitch. Here is a screenshot.
Screen Shot 2023-09-20 at 10 22 54 AM

@rosteen
Copy link
Collaborator Author

rosteen commented Sep 20, 2023

I didn't consider that case, I'll have to refactor a bit. I was actually re-parenting the subsets in remove_data_from_viewer and looping through the layers in that viewer, but that won't catch data that's in another viewer. I'll see if it works to move the logic to happen when the data is actually deleted and loop through any existing viewers.

@rosteen
Copy link
Collaborator Author

rosteen commented Sep 20, 2023

@camipacifici I think I fixed that case. I realized that that re-parenting the subsets might only be possible if the user deletes the data from the data selection menu UI. If you just remove the data from the data_collection in the notebook, we'll get a DataCollectionDeleteMessage but at that point it may be too late to use the data to translate the subset bounds through WCS (because the data is already gone). I could be wrong on exactly why it was failing, but it was failing in a pretty messy way when I had this logic in the handler for DataCollectionDeleteMessage.

@rosteen
Copy link
Collaborator Author

rosteen commented Sep 20, 2023

Docs build failure is an unrelated timeout.

@kecnry

This comment was marked as outdated.

@pllim pllim mentioned this pull request Sep 21, 2023
11 tasks
@pllim pllim modified the milestones: 3.7, 3.8 Sep 21, 2023
@rosteen rosteen force-pushed the duytnguyendtn-delete3 branch 2 times, most recently from 7ee5b7d to 9ee3a9b Compare October 3, 2023 15:22
CHANGES.rst Outdated Show resolved Hide resolved
Copy link
Contributor

@pllim pllim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The print functions have to be removed before merging. If you want to keep them for debugging, consider the snackbar in debug mode or proper logger.

The new logic starting around L1884 in app.py, I am not sure about. The explicit checks for certain shapes would exclude all composite subsets, no? Even in Imviz, we still allow people to create weird composite subsets even though they cannot do much more with them besides grabbing them back as list of Region objects (minus the operators).

As for testing, I think all the viz needs to be tested. I can see this being a widely used feature, especially when the performance starts to slow with all them links.

@javerbukh
Copy link
Contributor

This all was in the Imviz notebook: when removing layer A (reference data) from the viewer, I see the subset move to layer B. I still see it's parent as layer A. However, if I then delete layer A, the subset is alone in the viewer with the viewer appearing as a black screen. In this case, the parent is now layer B.
If I repeat the first step and then link by WCS, the subset moves to a different part of the image.

Is all of this intended functionality? I think the subset should not be on it's own at any point. Does linking by a different type actually move the subset to a correct location (as the user would understand it)?

CHANGES.rst Outdated Show resolved Hide resolved
rosteen and others added 24 commits October 23, 2023 10:20
Fix codestyle

Resolve changelog conflict

Remove old changelog entry

Remove debugging prints
Remove stray print

Add third image for relinking test
Clarify Changelog

Update CHANGES.rst

Co-authored-by: Kyle Conroy <[email protected]>

Fix typo
…data

Fix codestyle

Remove debugging prints, add changelog
Fix codestyle in test
author Ricky O'Steen <[email protected]> 1697030633 -0400
committer Ricky O'Steen <[email protected]> 1697735725 -0400

Check Imviz for refdata

Fix errors

One more codestyle fix

Remove stray print

Add third image for relinking test

Make Specviz/Imviz display docs more consistent

Update jdaviz/configs/specviz/tests/test_helper.py

Co-authored-by: P. L. Lim <[email protected]>

Consolidate 1D spectrum creation in conftest

Apply suggestions for tests

Co-authored-by: P. L. Lim <[email protected]>

Also check xmax and ymax

Add more comments, use center() in other test
Commit suggestion

Co-authored-by: P. L. Lim <[email protected]>

Codestyle
Co-authored-by: P. L. Lim <[email protected]>

Add missing import
Codestyle

Add helpful note

Fix specviz case, remove debugging print
@rosteen rosteen force-pushed the duytnguyendtn-delete3 branch from ef0a98d to 95d0b7d Compare October 23, 2023 14:21
@rosteen
Copy link
Collaborator Author

rosteen commented Oct 23, 2023

Dev test failure is unrelated, due to scipy using something deprecated from numpy.

@rosteen rosteen merged commit 29cce1c into spacetelescope:main Oct 23, 2023
bmorris3 added a commit to bmorris3/jdaviz that referenced this pull request Jan 22, 2024
gibsongreen pushed a commit to gibsongreen/jdaviz that referenced this pull request Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants