-
Notifications
You must be signed in to change notification settings - Fork 76
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
remove BasicJupyterToolbar instance to avoid conflicts #1679
Conversation
f26628d
to
dd6af62
Compare
Codecov ReportBase: 87.26% // Head: 87.29% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1679 +/- ##
==========================================
+ Coverage 87.26% 87.29% +0.03%
==========================================
Files 95 95
Lines 10091 10076 -15
==========================================
- Hits 8806 8796 -10
+ Misses 1285 1280 -5
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 at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why, but while this seems to fix one issue with the single-pixel subset tool (reselecting an existing subset on click), it adds new unexpected behavior: when clicking and dragging with the single-pixel tool selected, it will not create a circular subset. Not sure if that should be fixed here or separately, since while it's apparently caused by this it's sort of unrelated and the fix is probably in the tool code.
I'm not quite following this. But I can reproduce that the |
Whoops, I meant it will create a circular subset when you have the single-pixel tool selected if you click and drag with it. However, now that I went to record a screen capture of the behavior, I can't reproduce it. I'll mess with it a little more and see if I can do it again... |
Ok, I think that's the same thing that I was able to reproduce (should happen whenever you have the circle tool enabled and then disable or enable another non-subset tool). I'll move this to draft until I can sort that out. Thanks for the catch! |
Ah yep there it is, have to click the single-pixel subset tool without disabling the circle-select tool first. Thanks for looking into it! |
Co-authored-by: Kyle Conroy <[email protected]>
self.toolbar = NestedJupyterToolbar(self, self.tools_nested, default_tool_priority) | ||
|
||
@property | ||
def tools(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage says this is not tested. Is this really used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't use it anywhere, but glue-jupyter defaults viewer.tools
to a list of strings for what BasicJupyterToolbar
would use. Since this PR now prevents BasicJupyterToolbar
from being created and replaces it with NestedJupyterToolbar
, I figured we shouldn't carry around the irrelevant list and so just replace it with the equivalent flat list of tool names in our toolbar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the upstream fix, do we still need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we still have our own toolbar implementation.
#1647 has been merged. Please rebase, thanks! |
dd6af62
to
9bfcf26
Compare
c1197b5
to
aca911c
Compare
aca911c
to
ecb35ec
Compare
I think this should work now, but we may want to carefully consider the implementation and if there are any "cleaner" options before accepting/merging. This also opens up the possibility for us to redefine when the subset selection is reset to "Create New". The current behavior (adopted from glue) is to reset whenever a subset selection tool is activated. This can be a bit unintuitive in some cases though, especially when switching between a subset selection tool and a zoom tool with the intention to continue revising the same selection. A similar annoyance is reported as #1653. (Work towards changing this behavior should probably be in a follow-up PR, I just wanted to note that we now have more control over the specific behavior now) |
ecb35ec
to
81bb5c4
Compare
Are we waiting for SME to weight in or you want to get this in regardless? |
81bb5c4
to
e1966d0
Compare
Updated to make use of glue-viz/glue-jupyter#320, I'll update the glue-jupyter pin once it is included in a release and then mark this as ready for review. If anyone feels like reviewing early, feel free to install that PR of glue-jupyter and do so, I only expect to change the version requirement on glue-jupyter. |
Unless glue-jupyter is getting released in a few hours, I propose we turn this back to draft and slap a "upstream fix required" label on it. Thanks! |
There was a problem hiding this 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, fixes all the bugs I'd seen previously. I couldn't break anything testing in Cubeviz.
This is marked as a bug, do we need to backport all the bug fixes or just the critical ones? |
If we want to backport, you might have to manually squash the irrelevant commits so we can use "Merge pull request" to create a merge commit. |
I think we can decide case-by-case. I'm on the fence here - this does fix a bug, but it also has to make somewhat significant changes under-the-hood to do so.
I can do that if we decide to backport this (although I think we should also be able to cherry pick the "squash and merge" as long as we're doing it manually). |
@kecnry , if you do not create merge commit, it is hard to verify using scripts like https://github.com/astropy/astropy-tools/blob/main/pr_consistency/4.check_consistency.py (not exactly that one because it is tailored for astropy but you get the idea) |
* improve nested toolbar * single pixel to reset subset selection * bump glue-jupyter
dd82caf
to
503d1c1
Compare
@pllim - squashed and re-milestoned as 3.0.2 (assuming we're ok with the version bump on glue-jupyter in the bugfix release) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of variable name comments, but otherwise fixes the behavior on my side! Thanks!
'jdaviz:panzoom', 'jdaviz:panzoom_x', | ||
'jdaviz:panzoom_y', 'bqplot:xrange', | ||
'jdaviz:selectslice', 'jdaviz:selectline'] | ||
|
||
# categories: zoom resets, zoom, pan, subset, select tools, shortcuts | ||
tools_nested = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does tools_nested
make sense anymore in context of this PR's changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so. This PR still exposes a property for viewer.tools
which is a read-only flattened version of this nested list to match the same format that is set as tools
by the parent classes. Alternatively we could call the nested list as tools
but then would probably need to set inherit_tools=False
to avoid conflicts with upstream logic.
'jdaviz:panzoom', 'bqplot:rectangle', | ||
'bqplot:circle'] | ||
|
||
class MosvizImageView(JdavizViewerMixin, BqplotImageView): | ||
# categories: zoom resets, zoom, pan, subset, select tools, shortcuts | ||
tools_nested = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as comment above
'jdaviz:panzoom', | ||
'jdaviz:panzoom_x', | ||
'bqplot:xrange'] | ||
|
||
# categories: zoom resets, zoom, pan, subset, select tools, shortcuts | ||
tools_nested = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as comment above
remove BasicJupyterToolbar instance to avoid conflicts (cherry picked from commit f14b99c)
Description
This pull request removes the
BasicJupyterToolbar
instance otherwise initialized by glue-jupyter so that it does not conflict with jdaviz's customNestedJupyterToolbar
.Fixes #1665
Change log entry
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, maintainershould 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.
trivial
label.