Skip to content

feat: add query_hierarchy#3175

Merged
bsipocz merged 1 commit into
astropy:mainfrom
cds-astro:simbad-hierarchy
Jan 14, 2025
Merged

feat: add query_hierarchy#3175
bsipocz merged 1 commit into
astropy:mainfrom
cds-astro:simbad-hierarchy

Conversation

@ManonMarchand

@ManonMarchand ManonMarchand commented Jan 14, 2025

Copy link
Copy Markdown
Member

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

@codecov

codecov Bot commented Jan 14, 2025

Copy link
Copy Markdown

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 367 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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@keflavich keflavich left a comment

Copy link
Copy Markdown
Contributor

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

ManonMarchand commented Jan 14, 2025

Copy link
Copy Markdown
Member Author

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

@bsipocz bsipocz left a comment

Copy link
Copy Markdown
Member

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
@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