-
Notifications
You must be signed in to change notification settings - Fork 75
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
Catalog Search: Hide markers only when clear #1774
Conversation
Codecov ReportBase: 87.82% // Head: 87.82% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1774 +/- ##
=======================================
Coverage 87.82% 87.82%
=======================================
Files 95 95
Lines 10167 10178 +11
=======================================
+ Hits 8929 8939 +10
- Misses 1238 1239 +1
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.
Just a few questions before I do a full review. My original thought was that would could hide the layer before making the call to remove the markers, just so that it feels more responsive to the user... but I guess as long as this data collection entry is not exposed to the user, this might do the trick as well.
- is this actually faster than removing?
- will future searches overwrite the data and show the markers (of just the new search)?
Theoretically, yes. But I also don't have the exact workflow used in "stress test". How should I test this manually?
I think so but I should double check. |
@kecnry , overwriting the hidden markers (without completely removing first) seems ok. I tested it by created two ECSV files, one with 7 markers, another with just 3. Then I load one and then the other with this PR branch, seems to work as expected. |
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.
Very fast! Looks good to me.
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.
Probably out of scope, but I noticed that the data-collection entry for the "catalog results" shows in the data menu but is not recognized as loaded into the viewer. I can create a separate issue for this, but would you expect it to be hidden entirely or just shown as loaded and visible? Should it show as a layer in the legend and plot options?
Currently the following workflow results in unexpected behavior:
- search catalog that returns results (from file, for example)
- clear the markers (they are hidden, data collection entry still exists)
- do another search that returns zero results (nothing shows, but "catalog results" still contains the original search results)
Should this either set "catalog results" to be empty? Or should the original hide also delete the entry from the data collection as before (but just hide first so it feels snappier to the user)?
|
||
return skycoord_table | ||
|
||
def vue_do_search(self, *args, **kwargs): | ||
# calls self.search() which handles all of the searching logic | ||
self.search() | ||
|
||
def clear(self): | ||
if self.results_available: | ||
def clear(self, hide_only=True): |
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.
this isn't public API yet, so we can defer this decision if you prefer, but I wonder if separate hide
and clear/remove
methods would be more intuitive to the user (and then we could have the UI button always call hide
)?
If you prefer "hide first, clear in the background no matter what" I can do that, but keep in mind that other operations will be blocked until that is done, so that lag is still there but just deferred. Is that what you want? For the undefined behaviors:
|
We could probably do it with a message, but fair enough, probably not worth the extra effort and we can decide the expected behavior in the data-menu separately once the behavior here is converged (perhaps we just skip this entry in the data-menu entirely, in which case the user doesn't really realize the difference unless they dig into the API).
Ok, I agree. But if a search yields zero results and then the data collection object is manually set to be visible, would you expect to see nothing or see the results of the previous non-zero-results search (which is what currently happens)? Again, perhaps this point becomes moot if we decide to skip the entry in the data menu. |
Not sure if that is possible right now due to #773 . So if you create a new viewer, the markers won't show by default even though they are in data collection, so that menu is then useful to force them to show. 🙈 |
In the |
when clearing by default
Re: #1774 (comment) @kecnry , I added a second commit to implement what I think you meant. Does it look better now? |
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, thanks, I think this will do the trick for now and any remaining questions can be addressed if/when we refactor the catalog and work towards exposing the API. The apparent speed-up is definitely appreciated and worth getting in in the meantime!
Thanks for the reviews! |
Description
This pull request is to improve performance of the Clear button in Catalog Search plugin by merely hiding the markers instead of permanently removing them from glue data collection. This idea was originally given by @kecnry .
Dev notes
To create offline catalog table on-the-fly for testing:
For the new Imviz example notebook, I got the following file content:
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.