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

fix subset histogram bug in plot options #2393

Merged
merged 1 commit into from
Aug 25, 2023

Conversation

bmorris3
Copy link
Contributor

@bmorris3 bmorris3 commented Aug 25, 2023

Description

When subsets are selected in Plot Options in Imviz/Cubeviz, the stretch histogram update raises an error. This PR adds a return to drop out of the stretch histogram update method when the selected layer is a subset, avoiding the error.

This bug was discovered in #2387, splitting it out so it can be merged before 3.6.2.

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)?

@bmorris3 bmorris3 added this to the 3.6.2 milestone Aug 25, 2023
@bmorris3 bmorris3 added bug Something isn't working cubeviz imviz labels Aug 25, 2023
@bmorris3 bmorris3 force-pushed the subset-plot-opts-hist-bugfix branch from 33ab93b to 5377b9f Compare August 25, 2023 12:41
@bmorris3 bmorris3 marked this pull request as ready for review August 25, 2023 12:44
@codecov
Copy link

codecov bot commented Aug 25, 2023

Codecov Report

Patch coverage: 66.66% and project coverage change: +90.60% 🎉

Comparison is base (bbcdcc8) 0.00% compared to head (b5f4287) 90.60%.

Additional details and impacted files
@@            Coverage Diff            @@
##           main    #2393       +/-   ##
=========================================
+ Coverage      0   90.60%   +90.60%     
=========================================
  Files         0      159      +159     
  Lines         0    18189    +18189     
=========================================
+ Hits          0    16480    +16480     
- Misses        0     1709     +1709     
Files Changed Coverage Δ
...nfigs/default/plugins/plot_options/plot_options.py 93.15% <66.66%> (ø)

... and 158 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@kecnry kecnry left a comment

Choose a reason for hiding this comment

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

Would be great to add a regression test into test_plot_options.test_stretch_histogram if you have time, but otherwise looks good to me!

I am a little surprised that the existing if not self.stretch_function_sync.get('in_subscribed_states') check higher up didn't exclude this scenario (since that is what excludes the UI from being shown... 🤔 ), but an extra check below to avoid crashing doesn't hurt anything.

Thanks for the find and fix!

Copy link
Collaborator

@rosteen rosteen left a comment

Choose a reason for hiding this comment

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

Confirmed that it works, thanks! :shipit:

Copy link
Contributor

@haticekaratay haticekaratay left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thanks

@bmorris3 bmorris3 force-pushed the subset-plot-opts-hist-bugfix branch from 5377b9f to b5f4287 Compare August 25, 2023 18:15
@cshanahan1
Copy link
Contributor

shall we merge this?

@bmorris3 bmorris3 merged commit 914d6d5 into spacetelescope:main Aug 25, 2023
@kecnry
Copy link
Member

kecnry commented Aug 25, 2023

ah, this was never tagged for backport, I'll try to kickstart it manually

@kecnry kecnry added the 💤 backport-v3.6.x on-merge: backport to v3.6.x label Aug 25, 2023
@kecnry
Copy link
Member

kecnry commented Aug 25, 2023

@meeseeksdev backport to v3.6.x

@lumberbot-app
Copy link

lumberbot-app bot commented Aug 25, 2023

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout v3.6.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 914d6d5330a6e93c7778c00d619d5bef8583aead
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #2393: fix subset histogram bug in plot options'
  1. Push to a named branch:
git push YOURFORK v3.6.x:auto-backport-of-pr-2393-on-v3.6.x
  1. Create a PR against branch v3.6.x, I would have named this PR:

"Backport PR #2393 on branch v3.6.x (fix subset histogram bug in plot options)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

@kecnry
Copy link
Member

kecnry commented Aug 25, 2023

@meeseeksdev backport to v3.6.x

meeseeksmachine pushed a commit to meeseeksmachine/jdaviz that referenced this pull request Aug 25, 2023
cshanahan1 added a commit that referenced this pull request Aug 25, 2023
…3-on-v3.6.x

Backport PR #2393 on branch v3.6.x (fix subset histogram bug in plot options)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cubeviz imviz 💤 backport-v3.6.x on-merge: backport to v3.6.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants