-
-
Notifications
You must be signed in to change notification settings - Fork 427
Addresses Issue #3138 - ESO - Enable Table Access Protocol (TAP) queries #3339
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
Conversation
720fbd9 to
22d0c30
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3339 +/- ##
==========================================
+ Coverage 70.54% 71.31% +0.76%
==========================================
Files 232 234 +2
Lines 20022 20034 +12
==========================================
+ Hits 14125 14287 +162
+ Misses 5897 5747 -150 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
a987745 to
4b775f8
Compare
|
Hi @bsipocz , could you please give us a time estimate of the review process? No pressure at all though, we only need to plan our activities internally. Thanks a lot in advance. |
|
@juanmcloaiza - sorry for the delay. I'll try to get to the review this week. |
bsipocz
left a comment
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'm sorry to have this many comments and thank you for your patience while waiting for this review.
I acknowledge that this seems to a lot, but most of them are minor and/or helping API consistency with the other modules and/or making the code cleaner and easier to read and follow; which will be helpful for the future maintenance.
3742bb9 to
d3be2af
Compare
|
@bsipocz, thanks a lot for your comments, I have addressed most of them (the easy ones); for the rest, I'd still need some feedback from you. If you can give me feedback today, I can work immediately on it and push and update by tomorrow. Afterwards, I won't be able to work on Astroquery for the next couple of weeks. Just so you know, in case you can squeeze this review in your day 🤓 Thanks again! 👍 |
|
@juanmcloaiza - I'm sorry, it's very unlikely that I can get back to this today, but I'll try to do it soon so you can pick it up again in a few weeks time. |
|
Hi @bsipocz , just a ping about the second review round. Have you had some time for it? We're looking forward to hearing back from you. |
f4a18a6 to
9d713ee
Compare
|
There's no field for me to reply to your las two comments (strange...), but here are my replies: About the maxrec - Sure thing, About the deprecated keys message - The problem is that the astroquery ESO module (like many others) is currently using the keywords of the underlying querying engine directly in its API (like The messages users get are, for example, Without @ashleythomasbarnes has already an extensive documentation with examples ready to be submitted after this PR. For the moment, the changes to the documentation in this PR, include a warning and a how-to regarding the incompatibility between WDB and TAP:
Thanks for the feedback, @keflavich, I'll get everything done this week. Please just let me know about my question regarding the deprecation of arguments; for the rest everything is clear 👍 |
|
@keflavich, your comments have been taken into account, thanks for having taken the time. [cc @bsipocz, @ashleythomasbarnes, @szampier]. -- EDIT: Apologies, I went again one by one through all the conversations and I noticed three comments that had escaped my sight. I have taken them into account now. Please double check and let me know if anything is still missing. |
4dbc87c to
aef5c0f
Compare
|
@keflavich, @bsipocz, just FYI, on making the requested changes I introduced a bug that is now fixed in commit aef5c0f [@ashleythomasbarnes, @szampier]. |
bsipocz
left a comment
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.
A batch of, I hope not too difficult to address, comments, most of them are OK to be done in a follow-up (especially when it concerns a non public method or something internal etc.)
I've also unresolved a couple of conversations where we said the item is for a follow-up; ideally we should collect those out into a separate issue.
| "To retrieve all the records set to None the maxrec attribute", | ||
| MaxResultsWarning) | ||
|
|
||
| def _try_download_pyvo_table(self, |
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.
but what is a pyvo_table, and is this really a download or instead of running a query?
(we usually use "download" to refer to downloading files from an archive as opposed to run a table query.
Having a parser method is quite usual in the other modules, especially if it can be reused for multiple methods; but here I don't see we gain that much readibility with the added complexity.
| table_with_an_extra_row = tap.search(query=query_str, maxrec=row_limit_plus_one).to_table() | ||
| self._maybe_warn_about_table_length(table_with_an_extra_row, row_limit_plus_one) | ||
| except DALQueryError: | ||
| log.error(message(query_str)) |
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.
Why don't we raise this error, and why swallow the original exception type from the log?
|
|
||
| @deprecated_renamed_argument(('open_form', 'cache'), (None, None), | ||
| since=['0.4.11', '0.4.11']) | ||
| def query_main( |
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.
Keeping this unresolved so it's easier to pick up the comment for a follow-up PR
| astropy.conf.max_lines = n_ | ||
| astropy.conf.max_width = m_ | ||
|
|
||
| def _query_on_allowed_values( |
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.
Unresolve this to make it easier to find for a follow-up
| >>> dptbl = Eso.query_instrument('apex', pi_coi='ginsburg') | ||
| >>> dpids = [row['DP.ID'] for row in dptbl if 'Map' in row['Object']] | ||
| >>> files = Eso.retrieve_data(dpids) | ||
| dptbl = Eso.query_instrument('apex', pi_coi='ginsburg') | ||
| dpids = [row['DP.ID'] for row in dptbl if 'Map' in row['Object']] | ||
| files = Eso.retrieve_data(dpids) |
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.
Why did you remove the doctesting here? IMO if there are examples included they should be runable (meaning that they will also likely need to be fixed up with an import line)
bsipocz
left a comment
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.
OK, let's go ahead with the merge, I do one more batch commits for the simpler review comments, and will unresolve a bunch more conversations so it will be easier to pick them up in the follow-up.
| return username, password | ||
|
|
||
| def _login(self, *, username: str = None, store_password: bool = False, | ||
| def _login(self, username: str = None, store_password: bool = False, |
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.
Why did you remove the mandatoriness of kwargs here? general rule of thumb to not allow function calls with long positional signatures.
| def query_surveys( | ||
| self, | ||
| surveys: Union[List[str], str] = None, *, | ||
| cone_ra: float = None, cone_dec: float = None, cone_radius: float = None, |
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.
oh, I've just noticed these to be named weirdly. Please in a follow-up make it change to the usual API to rename cone_ra/dec to one argument that is called coordinates and which takes a SkyCoord object (or a string that can be turned to a SkyCoord/etc, this is very similar to all the other modules.
And also rename cone_radius to just radius.
|
|
||
| - Switch querying interface from WDB to TAP in querying functions. [#3339] | ||
| - Allow plain ADQL queries via ``query_tap_service`` (with authentication as well). [#3339] | ||
| - Cone search using ``cone_ra`, ``cone_dec`, ``cone_radius`` arguments. [#3339] |
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.
These will need to be renamed/refactored to match other modules.
ff18444 to
2272c91
Compare
|
RTD failure is unrelated and is due to a recent plugin release which I'll resolved in a separate PR. |
|
Thanks @juanmcloaiza for the patience here. I'm looking fwd for the follow-up PRs. |
|
@bsipocz , thanks a lot for your time today and the careful review. Looking forward for a continuous and fruitful collaboration! 🚀 |
Closes #3138
Changes:
Switch querying interface from WDB to TAP in querying functions:
Deprecate arguments:
open_formcacheNew functionality:
query_tap_service(with authentication as well)cone_ra,cone_dec,cone_radiusargumentscount_onlyargument