-
-
Notifications
You must be signed in to change notification settings - Fork 422
ESA HST module PyVO migration #3367
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
base: main
Are you sure you want to change the base?
ESA HST module PyVO migration #3367
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3367 +/- ##
==========================================
+ Coverage 70.08% 70.27% +0.19%
==========================================
Files 232 232
Lines 19890 19897 +7
==========================================
+ Hits 13940 13983 +43
+ Misses 5950 5914 -36 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Hi @JorgeHigueraFombuena , great to see your first PR to Astroquery! @bsipocz , he is a new team member at ESA and I have been supporting him on this branch. It seems all the checks are passing now, great! Please let us know if you have comments or concerns. Thanks! |
Welcome @JorgeHigueraFombuena! And straight into the deep end. I have some deadlines to meet before the long weekend and will be at a conference next week. But I'll try to get this reviewed quickly (passing the tests is already a great sign, but I expect to have some comments on making the API more consistent with the other modules). |
Hi @bsipocz I hope the code is clear enough to make reviewing easy! |
Hi @bsipocz ! |
@JorgeHigueraFombuena - There is another big PR in front of this one, hopefully I can clear both this week. |
@bsipocz |
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.
The property/attribute renames are blockers for the merge, the rest of the inline comments are minor.
Also, I do see 2 test failures (on main
, too, so it's separate), but two other ones triggered only with this PR. Could you please have a look into them?
(pytest -P esa.hubble -R
should pick them up once all the test requirements are installed)
=============================================== short test summary info ================================================
FAILED astroquery/esa/hubble/tests/test_esa_hubble_remote.py::TestEsaHubbleRemoteData::test_query_tap_async - pyvo.dal.exceptions.DALServiceError: 500 Server Error: 500 for url: https://hst.esac.esa.int/tap-server/tap/async/0...
FAILED astroquery/esa/hubble/tests/test_esa_hubble_remote.py::TestEsaHubbleRemoteData::test_cone_search - AttributeError: 'ESAHubbleClass' object has no attribute '_tap'
FAILED astroquery/esa/hubble/tests/test_esa_hubble_remote.py::TestEsaHubbleRemoteData::test_get_datalabs_path_image - UserWarning: File ib4x04ivq_flt.jpg is not accessible. Please ensure the WFC3/UVIS volume is mounted in your ESA Da...
FAILED astroquery/esa/hubble/tests/test_esa_hubble_remote.py::TestEsaHubbleRemoteData::test_get_datalabs_path_fits - UserWarning: File ib4x04ivq_flt.fits.gz is not accessible. Please ensure the WFC3/UVIS volume is mounted in your ES...
astroquery/esa/hubble/core.py
Outdated
if show_messages: | ||
self.get_status_messages() | ||
|
||
@property | ||
def vo(self) -> pyvo.dal.TAPService: |
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.
call this tap
to be consistent with the other modules
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.
Done
astroquery/esa/hubble/core.py
Outdated
def __init__(self, *, show_messages=True, auth_session=None): | ||
super().__init__() | ||
|
||
self._vo = 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.
call this self._tap
to be consistent with the other modules
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.
Done
astroquery/esa/hubble/core.py
Outdated
while job.phase == 'EXECUTING': | ||
time.sleep(3) |
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 don't think you need to add a manual sleep in here. Also, why not just run it with run_async
instead of doing the submission/run/fetch cycle? (genuine question, you may have good reasons to prefer this way)
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've changed it to the method you proposed, and it works fine. Thank you!
astroquery/esa/hubble/core.py
Outdated
@deprecated(since="0.4.7", alternative="query_tap") | ||
def query_hst_tap(self, query, *, async_job=False, output_file=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.
unrelated so can be done in a separate PR, but given this backend change, the deprecations could be also cleaned up (but we can also keep them in longer if you prefer that)
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.
The method was cleaned up!
astroquery/esa/hubble/core.py
Outdated
@@ -1061,4 +1086,5 @@ def get_datalabs_path(self, filename, default_volume=None): | |||
return full_path | |||
|
|||
|
|||
ESAHubble = ESAHubbleClass() | |||
# Neet to be false in order to avoid errors in tests |
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 would rephrase
# Neet to be false in order to avoid errors in tests | |
# Need to be False in order to avoid reaching out to the remote server at import time |
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.
Changed
Hi @bsipocz ! |
Dear astroquery team, this ticket aims to update the HST to make use of the PyVO module.
Happy to contribute!!
CC @esdc-esac-esa-int