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

(minimal) user API for catalog search #1636

Merged
merged 4 commits into from
Sep 14, 2022

Conversation

kecnry
Copy link
Member

@kecnry kecnry commented Sep 9, 2022

Description

This pull request extends on #1401 and provides user-API access to the catalog search plugin.

Plugin User API docs

TODO:

  • figure out why catalogs API are not being built in RTD
  • add PR to changelog if before next release, otherwise add new entry (waiting until PR is accepted otherwise to avoid constant merge conflicts)

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 change log needed? If yes, is it added to CHANGES.rst?
  • Is a milestone set?
  • After merge, any internal documentations need updating (e.g., JIRA, Innerspace)?

@kecnry kecnry added this to the 2.11 milestone Sep 9, 2022
@github-actions github-actions bot added the imviz label Sep 9, 2022
@codecov
Copy link

codecov bot commented Sep 9, 2022

Codecov Report

Base: 86.32% // Head: 86.32% // Decreases project coverage by -0.00% ⚠️

Coverage data is based on head (4f21270) compared to base (71ea380).
Patch coverage: 87.50% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1636      +/-   ##
==========================================
- Coverage   86.32%   86.32%   -0.01%     
==========================================
  Files          95       95              
  Lines        9596     9607      +11     
==========================================
+ Hits         8284     8293       +9     
- Misses       1312     1314       +2     
Impacted Files Coverage Δ
jdaviz/configs/imviz/plugins/compass/compass.py 69.76% <66.66%> (+0.32%) ⬆️
jdaviz/configs/imviz/plugins/catalogs/catalogs.py 95.65% <100.00%> (+0.06%) ⬆️
jdaviz/core/user_api.py 72.50% <100.00%> (+2.22%) ⬆️

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.
📢 Do you have feedback about the report comment? Let us know in this issue.

@kecnry kecnry force-pushed the api-catalog-search branch from 3c66a92 to 310ccb5 Compare September 9, 2022 18:35
@kecnry kecnry marked this pull request as ready for review September 9, 2022 21:01
@pllim
Copy link
Contributor

pllim commented Sep 13, 2022

The plugin is still in "experimental" mode and missing many features. Should we shelf this until it is more stable?

@kecnry
Copy link
Member Author

kecnry commented Sep 14, 2022

If we think there is high likelihood of changing any of the API exposed here, then I think that's a good idea to wait (although I think some API-compatibility improvements are still worth merging here, I'd just remove the user_api property so it defaults to just show and open_in_tray). If we just think we'll add more on top of whatever exists, then I see no harm in exposing the existing functionality.

@pllim
Copy link
Contributor

pllim commented Sep 14, 2022

👍 to hiding user API for now. When we revisit this plugin, there is a small chance we will refactor the design (e.g., if people want to upload their own catalogs and so on).

@kecnry
Copy link
Member Author

kecnry commented Sep 14, 2022

ok, I've removed the exposed functionality, but think the rest is still worth getting in (maybe the PR title needs a change though to avoid us thinking it was already done here? - I also created a follow-up ticket 🐱 so we don't forget).

@pllim
Copy link
Contributor

pllim commented Sep 14, 2022

maybe the PR title needs a change

I dunno, let's ask @ojustino 😸

@kecnry kecnry changed the title user API for catalog search (minimal) user API for catalog search Sep 14, 2022
@@ -111,6 +111,9 @@ Plugins
.. automodapi:: jdaviz.configs.imviz.plugins.aper_phot_simple.aper_phot_simple
:no-inheritance-diagram:

.. automodapi:: jdaviz.configs.imviz.plugins.catalogs.catalogs
Copy link
Contributor

Choose a reason for hiding this comment

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

That's weird. I remember suggesting this to Sabrina's PR but maybe it was lost in rebase. Thanks for adding this.

@@ -111,12 +125,13 @@ def search(self):
viewer.marker = {'color': 'red', 'alpha': 0.8, 'markersize': 5, 'fill': False}
viewer.add_markers(table=catalog_results, use_skycoord=True, marker_name='catalog_results')

return skycoord_table
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this added on purpose?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, we don't set it as a traitlet anywhere or show it in the plugin UI, so I figured you might as well be able to access the table of results from the API method instead of having to dig into markers. This technically won't be public yet now that I stripped out exposing it, so if you'd prefer, I can revert this change for now too.

Copy link
Contributor

Choose a reason for hiding this comment

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

No, I think this is good to have. Just want to make sure. Thanks!

Copy link
Contributor

@pllim pllim left a comment

Choose a reason for hiding this comment

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

LGTM. Time to add that change log. 😸 Thanks!

@kecnry kecnry merged commit 954f2b9 into spacetelescope:main Sep 14, 2022
@kecnry kecnry deleted the api-catalog-search branch September 14, 2022 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants