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

aperture photometry: do not hide prev results when resetting #2112

Merged
merged 3 commits into from
Mar 27, 2023

Conversation

kecnry
Copy link
Member

@kecnry kecnry commented Mar 23, 2023

Description

This pull request prevents resetting the internal traitlets in aperture photometry when failing to find a dataset/subset or raising an error, and only clears them when needed for the next successful run. This also then keeps the log table visible.

Fixes #2111

Change log entry

  • Is a change log needed? If yes, is it added to CHANGES.rst? If you want to avoid merge conflicts,
    list the proposed change log here for review and add to CHANGES.rst before merge. If no, maintainer
    should add a no-changelog-entry-needed label.

Checklist for package maintainer(s)

This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.

  • Are two approvals required? Branch protection rule does not check for the second approval. If a second approval is not necessary, please apply the trivial label.
  • Do the proposed changes actually accomplish desired goals? Also manually run the affected example notebooks, if necessary.
  • Do the proposed changes follow the STScI Style Guides?
  • Are tests added/updated as required? If so, do they follow the STScI Style Guides?
  • Are docs added/updated as required? If so, do they follow the STScI Style Guides?
  • Did the CI pass? If not, are the failures related?
  • Is a milestone set? Set this to bugfix milestone if this is a bug fix and needs to be released ASAP; otherwise, set this to the next major release milestone.
  • After merge, any internal documentations need updating (e.g., JIRA, Innerspace)?

@github-actions github-actions bot added the imviz label Mar 23, 2023
@codecov
Copy link

codecov bot commented Mar 23, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.05 🎉

Comparison is base (5510486) 91.90% compared to head (de06d52) 91.95%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2112      +/-   ##
==========================================
+ Coverage   91.90%   91.95%   +0.05%     
==========================================
  Files         143      143              
  Lines       15605    15665      +60     
==========================================
+ Hits        14342    14405      +63     
+ Misses       1263     1260       -3     
Impacted Files Coverage Δ
...imviz/plugins/aper_phot_simple/aper_phot_simple.py 92.87% <100.00%> (+0.65%) ⬆️

... and 4 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@kecnry
Copy link
Member Author

kecnry commented Mar 23, 2023

@pllim - I originally was just going to move the table out of the v-if, but then realized that we probably want everything to act the same and just keep showing until there are new results. Can you think of any workflow/case where this isn't the intended/desired behavior?

And I'm not sure how to milestone or where to put the changelog - does this count as a bugfix or a change in behavior?

@pllim
Copy link
Contributor

pllim commented Mar 24, 2023

Will not clearing get confusing at some point? You have result from previous run, but then unsuccessful but don't bother reading the snackbar. Now you still see numbers and you are in a rush, won't you mistaken the numbers for the new run?

@@ -249,7 +238,6 @@ def _bg_subset_selected_changed(self, event={}):

def vue_do_aper_phot(self, *args, **kwargs):
if self._selected_data is None or self._selected_subset is None:
self.reset_results()
Copy link
Contributor

Choose a reason for hiding this comment

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

I still think you need to reset when new calculation is requested.

Copy link
Member Author

Choose a reason for hiding this comment

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

can you show a case where that is needed? I think everything just gets overwritten for a successful run and the code is redundant, but I'm not 100% sure.

Copy link
Contributor

Choose a reason for hiding this comment

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

The point is, when this button is pressed, things should be cleared and only show new calculated results. If there is any failure at all (this, or the except Exception as e below), no numbers should show, to make it clear that something has gone wrong.

The logic here should not affect the issue you are trying to fix. Deleting a Subset should not trigger this method.

Or am I misunderstanding the situtation?

Copy link
Member Author

Choose a reason for hiding this comment

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

Deleting all subsets does trigger resetting the results and ends up hiding both the most recent results and the entire table. I can move the entire table outside of that logic and to its own logic (just checking the length of the table or something), but that feels like extraneous logic and inconsistent behavior to me.

Screen.Recording.2023-03-24.at.11.13.49.AM.mov

Copy link
Contributor

Choose a reason for hiding this comment

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

Delete subset event triggers vue_do_aper_phot? 🤯

Copy link
Member Author

Choose a reason for hiding this comment

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

No, but the subset selection itself becomes blank, and then _subset_selected_changed clears the results.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, we can stop clearing for that. But I am saying it should still clear within vue_do_aper_phot.

Copy link
Member Author

Choose a reason for hiding this comment

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

Should all the previous results (including the table) disappear? What if instead we show a message that the previous run failed above all of those so they are not lost?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, so what if we show the error message in the UI in place of the results and keep the table?

This might be a good enough compromise.

@kecnry
Copy link
Member Author

kecnry commented Mar 24, 2023

You have result from previous run, but then unsuccessful but don't bother reading the snackbar. Now you still see numbers and you are in a rush, won't you mistaken the numbers for the new run?

Ok, so what if we show the error message in the UI in place of the results and keep the table?

@kecnry kecnry added this to the 3.4.1 milestone Mar 27, 2023
@kecnry kecnry marked this pull request as ready for review March 27, 2023 13:29
Copy link
Contributor

@javerbukh javerbukh left a comment

Choose a reason for hiding this comment

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

Tried this a few times adding and deleting subsets and all data stayed in the table and the results from the previous run persisted until there was a new subset selected for analysis. All of that makes sense to me!

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.

Thanks!

@pllim pllim added the 💤backport-v3.4.x on-merge: backport to v3.4.x label Mar 27, 2023
@pllim pllim merged commit 4cd8c30 into spacetelescope:main Mar 27, 2023
meeseeksmachine pushed a commit to meeseeksmachine/jdaviz that referenced this pull request Mar 27, 2023
@kecnry kecnry deleted the aper-phot-keep-prev-results branch March 27, 2023 17:50
pllim added a commit that referenced this pull request Mar 27, 2023
…2-on-v3.4.x

Backport PR #2112 on branch v3.4.x (aperture photometry: do not hide prev results when resetting)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Aperture photometry: if delete all subsets, no more access to table in the GUI
3 participants