-
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
catalog search handle from file edge case and implement max sources #3337
catalog search handle from file edge case and implement max sources #3337
Conversation
6e00ce6
to
bfb83ef
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3337 +/- ##
==========================================
+ Coverage 88.80% 88.84% +0.04%
==========================================
Files 125 125
Lines 19132 19179 +47
==========================================
+ Hits 16990 17040 +50
+ Misses 2142 2139 -3 ☔ View full report in Codecov by Sentry. |
6654e2b
to
12af427
Compare
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.
It looks like the entire GAIA search logic is uncovered - is it easy to add coverage here or if its out of scope, can you create a follow-up please?
Otherwise code looks good - thanks!
if len(query_region_result) > self.max_sources: | ||
query_region_result = query_region_result[:self.max_sources] |
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.
can we have a warning for this (maybe in-UI)?
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 added a snackbar message instead of a warning since the user manually enters the max_sources
themselves. Also added it for the Gaia (and SDSS) catalog with the custom logic for 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.
Code looks good - 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.
Tested this out, and I'm still seeing an issue when max_sources=1. If you select Gaia, max_sources=1, and 'search', nothing is added to the table or the viewer.
Nice catch, I must've reverted something from a past commit! It should work now and I just consolidated the logic now since each of the catalogs now have the same logic route to add to table. |
Would it be faster to apply 'max sources' when going through astroquery, rather than cutting down the size of the table after? I'm not sure if it would if the table is being sorted and then returned, unless it's just returning the first n sources? |
That was my thought too and so Gaia has the |
Description
This pull request is to address an edge case when there is only one source in a catalog search from file. It also implements the
max_sources
traitlet for all catalogs.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.