Skip to content

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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

JorgeHigueraFombuena
Copy link

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

Copy link

codecov bot commented Jul 3, 2025

Codecov Report

❌ Patch coverage is 90.56604% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.27%. Comparing base (1becbba) to head (3f6d625).
⚠️ Report is 33 commits behind head on main.

Files with missing lines Patch % Lines
astroquery/esa/hubble/core.py 90.69% 4 Missing ⚠️
astroquery/esa/utils/utils.py 75.00% 1 Missing ⚠️
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.
📢 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.

@jespinosaar
Copy link
Contributor

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!

@bsipocz
Copy link
Member

bsipocz commented Jul 3, 2025

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

@JorgeHigueraFombuena
Copy link
Author

Hi @bsipocz

I hope the code is clear enough to make reviewing easy!
Thanks!

@bsipocz bsipocz self-requested a review July 3, 2025 17:54
@JorgeHigueraFombuena
Copy link
Author

Hi @bsipocz !
Did you have time to review the pull request?

@bsipocz
Copy link
Member

bsipocz commented Jul 21, 2025

@JorgeHigueraFombuena - There is another big PR in front of this one, hopefully I can clear both this week.

@JorgeHigueraFombuena
Copy link
Author

@bsipocz
Thank you very much!

@bsipocz bsipocz added this to the v0.4.11 milestone Jul 31, 2025
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.

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

if show_messages:
self.get_status_messages()

@property
def vo(self) -> pyvo.dal.TAPService:
Copy link
Member

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

Choose a reason for hiding this comment

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

Done

def __init__(self, *, show_messages=True, auth_session=None):
super().__init__()

self._vo = None
Copy link
Member

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

Choose a reason for hiding this comment

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

Done

Comment on lines 778 to 779
while job.phase == 'EXECUTING':
time.sleep(3)
Copy link
Member

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)

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!

Comment on lines 789 to 790
@deprecated(since="0.4.7", alternative="query_tap")
def query_hst_tap(self, query, *, async_job=False, output_file=None,
Copy link
Member

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)

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!

@@ -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
Copy link
Member

Choose a reason for hiding this comment

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

I would rephrase

Suggested change
# 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

Choose a reason for hiding this comment

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

Changed

@JorgeHigueraFombuena
Copy link
Author

JorgeHigueraFombuena commented Aug 4, 2025

Hi @bsipocz !
We are currently working on the issue with the remote tests and need more time to resolve it.
In the meantime, the rest of the comments have been addressed.
Regarding the autochecks, I see that one of them is still failing, but I'm not sure how to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants