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

Add Gaia catalog to plugin #3090

Merged
merged 8 commits into from
Aug 1, 2024
Merged

Conversation

javerbukh
Copy link
Contributor

Description

This pull request adds the Gaia catalog to the Catalog plugin.

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

@github-actions github-actions bot added imviz plugin Label for plugins common to multiple configurations labels Jul 16, 2024
@javerbukh javerbukh added this to the 4.0 milestone Jul 16, 2024
Copy link

codecov bot commented Jul 16, 2024

Codecov Report

Attention: Patch coverage is 36.36364% with 7 lines in your changes missing coverage. Please review.

Project coverage is 88.86%. Comparing base (23b3edd) to head (415f642).
Report is 170 commits behind head on main.

Files with missing lines Patch % Lines
jdaviz/configs/imviz/plugins/catalogs/catalogs.py 36.36% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3090      +/-   ##
==========================================
+ Coverage   88.73%   88.86%   +0.12%     
==========================================
  Files         111      112       +1     
  Lines       17262    17407     +145     
==========================================
+ Hits        15317    15468     +151     
+ Misses       1945     1939       -6     

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

Address review comments

Add max rows option for Gaia
@javerbukh javerbukh marked this pull request as ready for review July 16, 2024 18:54
Copy link
Contributor

@bmorris3 bmorris3 left a comment

Choose a reason for hiding this comment

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

Some improvements in comments below. Other thoughts:

  • Can we add a note somewhere in the UI that this feature uses astroquery's Gaia interface, with a link to the docs? There are lots of configurable features of the Gaia queries that we're not exposing, so referencing the astroquery docs allows us to delegate those docs.

  • Don't forget changelog.

jdaviz/configs/imviz/plugins/catalogs/catalogs.py Outdated Show resolved Hide resolved
jdaviz/configs/imviz/plugins/catalogs/catalogs.vue Outdated Show resolved Hide resolved
jdaviz/configs/imviz/plugins/catalogs/catalogs.py Outdated Show resolved Hide resolved
Gaia.ROW_LIMIT = self.max_rows
sources = Gaia.query_object(skycoord_center, radius=zoom_radius,
columns=('source_id', 'ra', 'dec'))
self.app._catalog_source_table = sources
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make this public in the user API?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there a reason making self.app._catalog_source_table public API belongs in a PR for enabling Gaia catalogs? I'm not really sure why we would do this so genuinely curious.

Copy link
Contributor

Choose a reason for hiding this comment

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

Looking more closely, I realize that this attr is on app and not the plugin, and the plugin has a table attr – I agree with you, let's not do that. Apologies 🙊

from astroquery.gaia import Gaia
from astroquery.gaia import conf

with conf.set_temp("ROW_LIMIT", self.max_sources):
Copy link
Member

Choose a reason for hiding this comment

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

would/should this apply to SDSS as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, it does not appear to have an option for that. I just renamed max_sources to max_gaia_sources.

jdaviz/configs/imviz/plugins/catalogs/catalogs.vue Outdated Show resolved Hide resolved
@@ -28,6 +28,24 @@
<g-file-import id="file-uploader"></g-file-import>
</plugin-file-import-select>

<v-row v-if="catalog_selected === 'Gaia'">
<j-docs-link>
See the <j-external-link link='https://astroquery.readthedocs.io/en/latest/gaia/gaia.html' linktext='astropy.gaia docs'></j-external-link> for details on other configurable features.
Copy link
Member

Choose a reason for hiding this comment

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

but do we allow for passing any of those optional arguments?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do not, but maybe a particularly knowledgeable user could use the astroquery api to enable them?

Copy link
Member

Choose a reason for hiding this comment

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

ok, since this is UI only, that is easy enough to increment on later if it causes any confusion.

jdaviz/configs/imviz/plugins/catalogs/catalogs.py Outdated Show resolved Hide resolved
Copy link
Contributor

@bmorris3 bmorris3 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, thanks @javerbukh! Two suggestions:

jdaviz/configs/imviz/plugins/catalogs/catalogs.py Outdated Show resolved Hide resolved
jdaviz/configs/imviz/plugins/catalogs/catalogs.vue Outdated Show resolved Hide resolved
@javerbukh
Copy link
Contributor Author

Thank you for the reviews and suggestions! I will merge once CI passes.

@javerbukh javerbukh enabled auto-merge (squash) August 1, 2024 21:01
@javerbukh javerbukh merged commit 146552b into spacetelescope:main Aug 1, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
imviz plugin Label for plugins common to multiple configurations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants