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

feat: add query_hierarchy #3175

Merged
merged 1 commit into from
Jan 14, 2025
Merged

feat: add query_hierarchy #3175

merged 1 commit into from
Jan 14, 2025

Conversation

ManonMarchand
Copy link
Member

@ManonMarchand ManonMarchand commented Jan 14, 2025

Hello astroquery maintainers 🙂 !

In the former API, we had two fields membership and link_bibcode that would hint whether the object had parents. I did not replace those in the rewrite from #2954 as I didn't find them easy to use, and they did not have a direct equivalent in the relational schema.

This PR, adds a new query method query_hierarchy to replace them. The behavior is based on what people can see on the webpages in the hierarchy section. You can either ask for parents, children, or siblings of the object.

Ex on NGC4038's page:
image

The two fields from before (membership and link_bibcode) are only returned if the users ask for them with the argument detailed_hierarchy. This is toggled off by default as it has a tendency of duplicating the results a lot (see the example in the new documentation section).

Copy link

codecov bot commented Jan 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@94dbe5c). Learn more about missing BASE report.
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3175   +/-   ##
=======================================
  Coverage        ?   67.72%           
=======================================
  Files           ?      229           
  Lines           ?    18388           
  Branches        ?        0           
=======================================
  Hits            ?    12453           
  Misses          ?     5935           
  Partials        ?        0           

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

Copy link
Contributor

@keflavich keflavich left a comment

Choose a reason for hiding this comment

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

This looks great! I read through the code and docs, and it looks solid. This is a neat addition!

@ManonMarchand
Copy link
Member Author

ManonMarchand commented Jan 14, 2025

Thanks!
Since your approval I amended the commit for tiny docs modifs and to improve the coverage

@bsipocz bsipocz added this to the v0.4.8 milestone Jan 14, 2025
Copy link
Member

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

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

Thanks @ManonMarchand!

@bsipocz bsipocz merged commit e13430f into astropy:main Jan 14, 2025
11 checks passed
@ManonMarchand ManonMarchand deleted the simbad-hierarchy branch January 17, 2025 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants