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

BUG: Not all viewers have get_limits #3361

Merged
merged 1 commit into from
Dec 18, 2024
Merged

Conversation

pllim
Copy link
Contributor

@pllim pllim commented Dec 17, 2024

Description

This pull request is to fix broken pan/zoom on Plot Options histogram.

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. Bugfix milestone also needs an accompanying backport label.
  • After merge, any internal documentations need updating (e.g., JIRA, Innerspace)? 🐱

@pllim pllim added bug Something isn't working 💤backport-v4.0.x on-merge: backport to v4.0.x labels Dec 17, 2024
@pllim pllim modified the milestones: 4.0.1, 4.0.2 Dec 17, 2024
@pllim pllim removed the 💤backport-v4.0.x on-merge: backport to v4.0.x label Dec 17, 2024
@pllim pllim modified the milestones: 4.0.2, 4.1 Dec 17, 2024
@pllim pllim marked this pull request as ready for review December 17, 2024 16:34
Copy link

codecov bot commented Dec 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.77%. Comparing base (629fa62) to head (08fde20).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3361   +/-   ##
=======================================
  Coverage   88.77%   88.77%           
=======================================
  Files         125      125           
  Lines       19227    19227           
=======================================
  Hits        17068    17068           
  Misses       2159     2159           

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

jdaviz/core/tools.py Outdated Show resolved Hide resolved
@rosteen
Copy link
Collaborator

rosteen commented Dec 17, 2024

The histogram viewer actually does have previous zoom:

Screenshot 2024-12-17 at 12 44 04 PM

And now clicking it gives this error instead:

File [~/projects/jdaviz/jdaviz/core/tools.py:166](http://localhost:8888/lab/tree/testing/~/projects/jdaviz/jdaviz/core/tools.py#line=165), in PrevZoom.activate(self)
    165 def activate(self):
--> 166     if self.viewer._prev_limits is None:
    167         return
    168     prev_limits = self.viewer._prev_limits

AttributeError: 'BqplotHistogramView' object has no attribute '_prev_limits'

@pllim

This comment was marked as resolved.

@rosteen
Copy link
Collaborator

rosteen commented Dec 17, 2024

@kecnry thoughts? Probably not particularly needed here, it would be nice to have but maybe if we can't support it here we just remove it.

@kecnry
Copy link
Member

kecnry commented Dec 17, 2024

Is there another way to get the limits (or implement get_limits)?

@pllim

This comment was marked as resolved.

@pllim
Copy link
Contributor Author

pllim commented Dec 17, 2024

I think get_limits is something we invented in Jdaviz. It is not available for a viewer class we used directly from glue-jupyter, e.g., https://github.com/glue-viz/glue-jupyter/blob/main/glue_jupyter/bqplot/histogram/viewer.py

def get_limits(self):

@pllim
Copy link
Contributor Author

pllim commented Dec 17, 2024

bisect blame the breakage on #3262 (backport of #3249 which is Past Self again) . Pretty sure it broke between v4.0.0 and v4.0.1

Add test and change log.

Test was proven to fail on main locally.
@pllim
Copy link
Contributor Author

pllim commented Dec 17, 2024

Thanks for the review. I basically reverted the offending change that I added in #3249 . Should work now.

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.

Thanks!

@kecnry kecnry merged commit f41f4af into spacetelescope:main Dec 18, 2024
24 checks passed
@pllim pllim deleted the hist-zoom branch December 18, 2024 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Ready for final review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants