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

Enable TAP for ESO module #3141

Draft
wants to merge 71 commits into
base: main
Choose a base branch
from
Draft

Enable TAP for ESO module #3141

wants to merge 71 commits into from

Conversation

juanmcloaiza
Copy link
Contributor

@juanmcloaiza juanmcloaiza commented Nov 28, 2024

Addresses #3138

Changes:

  • list_instruments
  • list_surveys list_collections
  • query_instruments
  • query_surveys query_collections
  • query_main
  • query_apex_quicklooks
  • deprecate functions *_surveys(...) in favor of _*collections(...)
  • Make sure that ALMA collection is handled properly
  • Add type hints to all methods / functions

@pep8speaks
Copy link

pep8speaks commented Nov 28, 2024

Hello @juanmcloaiza! 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 2025-01-17 14:13:03 UTC

Copy link

codecov bot commented Nov 28, 2024

Codecov Report

Attention: Patch coverage is 59.18367% with 100 lines in your changes missing coverage. Please review.

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

Files with missing lines Patch % Lines
astroquery/eso/core.py 55.39% 91 Missing ⚠️
astroquery/eso/utils.py 78.04% 9 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3141   +/-   ##
=======================================
  Coverage        ?   67.96%           
=======================================
  Files           ?      230           
  Lines           ?    18405           
  Branches        ?        0           
=======================================
  Hits            ?    12509           
  Misses          ?     5896           
  Partials        ?        0           

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

@bsipocz bsipocz added the eso label Nov 28, 2024
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.

One comment for now regarding the deprecation, otherwise is looking good so far (I didn't dive into the details, but had a quick look

astroquery/eso/core.py Outdated Show resolved Hide resolved
astroquery/eso/core.py Outdated Show resolved Hide resolved
astroquery/eso/core.py Outdated Show resolved Hide resolved
astroquery/eso/core.py Outdated Show resolved Hide resolved
astroquery/eso/core.py Outdated Show resolved Hide resolved
try:
table_to_return = tap.search(query_str).to_table()
except pyvo.dal.exceptions.DALQueryError:
raise pyvo.dal.exceptions.DALQueryError(f"\n\nError executing the following query:\n\n{query_str}\n\n")
Copy link
Contributor

Choose a reason for hiding this comment

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

Why rethrowing the same exception with a different error message? Is the original error message not clear enough? I think it's also possible to chain the original exception with a custom one but I don't remember the syntax

Copy link
Contributor Author

@juanmcloaiza juanmcloaiza Dec 11, 2024

Choose a reason for hiding this comment

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

It is helpful to see the query that was being executed. In that way users can test it externally (for example here: http://archive.eso.org/programmatic/#TAP) and pinpoint the source of error. I found this to be the simplest way of achieving that goal, but I'm open to suggestions, if there's a better or standard way to do it.

Choose a reason for hiding this comment

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

One could wonder if this shouldn't be addressed in TAP itself -> after all TAP could return the query as part of the error message.

astroquery/eso/core.py Outdated Show resolved Hide resolved
astroquery/eso/core.py Outdated Show resolved Hide resolved
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.

5 participants