-
-
Notifications
You must be signed in to change notification settings - Fork 405
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
Feature simbad query tap #2856
Feature simbad query tap #2856
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2856 +/- ##
==========================================
+ Coverage 66.53% 66.56% +0.03%
==========================================
Files 235 235
Lines 18114 18162 +48
==========================================
+ Hits 12052 12090 +38
- Misses 6062 6072 +10 ☔ View full report in Codecov by Sentry. |
From the oldest dependencies test, it looks like |
Hello @ManonMarchand! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2024-01-26 16:41:53 UTC |
a9dce73
to
9d0abcb
Compare
On the coverage, some lines are marked as missed but are tested in |
9d0abcb
to
7769e25
Compare
Thank you so much! I'll try to get a timely review for this. To answer the questions above:
yes, do ignore the number here, its main purpose is to check whether there is a significant drop in coverage and we are aware that the actual percentage is most often larger when one includes the remote tests (I tend to run those numbers for significantly big PRs like this one as part of the review). Re pyvo 1.4.2: that version is a bit too new to mandate as a minimum required version. Maybe you could do a try/except import and later a version dependent conditional? |
I added the try/except clause for DALOverflowWarning 🙂 edit: the new failure does not seem related |
3cfe840
to
ba23c2c
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.
I made a couple of comments while travelling, will come back for another fine combing before merging, but honestly I don't think anything else critical will be found.
16784cf
to
b86d6aa
Compare
Oups, I was squashing my commits and rebased too far sorry. I have no idea how to fix that |
I suspect you rebased on an outdated commit, rather than the freshly fetched |
Will it be an issue when merging? |
No, I'll do a rebase before merge ;) |
I added caching on query_tap in today's commits (sorry for changing while you were reviewing). It only works when there are no uploaded tables in the query parameters since astropy tables are not hashable (and thus cannot be parameters in a function wrapped in lru_cache). I still think it can be very useful: uploaded tables are quite rare. It also made me realize that there were no examples of uploaded table in the narrative docs so I made one up. EDIT : and I'll stop changing stuff so that you can review, sorry again. |
No worries, do add as many changes as you wish, you can always add the review label, or ping me when done and I'll come back then. |
f658c8d
to
01256a3
Compare
All done :) |
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 have a couple nitpicky English comments, but this looks great and the documentation is super helpful.
All done for Adam comments |
SimbadClass.query_tap wraps the pyvo.dal.TAPService.run_async method. This commit also add the SimbadClass.simbad_mirrors and SimbadClass.tap attributes.
queries are now in three sections: - objects-related queries - bibliography-related queries - mixed type queries
this commit also adds two private methods useful when building queries from users input: _adql_parameter and _adql_name.
we also add a graphviz file that represents a quick view of simbad's tables
list_columns now accept a 'keyword' keyword argument to filter the output columns find_linked_tables is also renamed to list_linked_tables for homogenity
The caching decorator could not be applied for the uploaded tables because the astropy table objects are non-hashable. This implementation only caches calls without uploads as I could not find a workaround.
Co-authored-by: Adam Ginsburg <keflavich@gmail.com>
a script to regenerate the DOT file is here : https://github.com/ManonMarchand/simbad-ER-diagram/blob/main/simbad-and-graphviz.py
f776ef8
to
f446183
Compare
some fields have changed their datatype upstream following astropy#2916
f446183
to
1304824
Compare
b6cc855
to
ccf93cb
Compare
I removed the |
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.
Thank you @ManonMarchand, this should go in now.
Hello,
What this PR does
Add
Simbad.query tap
functionality to the simbad module. This is called like this:This feature comes with helpers methods to explore SIMBAD's relational schema.
Simbad.list_tables()
returns the public tables of SIMBADSimbad.list_columns(*args, keyword: str = None)
returns the columns corresponding to the entry table(s) and with matches for the given keywordSimbad.list_linked_tables(table: str)
returns the non obvious (i.e. the columns don't have the same names) possible joinsProperties to connect to the tap endpoint:
Simbad.simbad_mirrors
is a set of the two simbad's mirrorsSimbad.mirror
takes the value ofconf.server
at instantiation but can be switched laterSimbad.tap
is created from the currentSimbad.mirror
And the private method
_adql_parameter
that will be called when building adql queries from user inputs (to silently escape invalid characters and reserved sql vocabulary)
Documentation-wise
I took the liberty to add a graphviz graph of simbad's schema since sphinx-graphviz is already in the dependencies of sphinx-automodapi but we can remove it if needed.
The documentation on queries are now organized in a rough
This might need discussion too ?
That was also a lot of text and I'm not a native-english speaker, if someone has the time to point mistakes/unclear parts I'd love feedback.
Next steps
This PR only adds new methods. The rework to solve #1468 will be based on
Simbad.query_tap
and the two private functions introduced here.