Skip to content

ESA HST module PyVO migration#3367

Merged
bsipocz merged 15 commits into
astropy:mainfrom
esdc-esac-esa-int:ESA_ehst-pyvo_migration
Sep 4, 2025
Merged

ESA HST module PyVO migration#3367
bsipocz merged 15 commits into
astropy:mainfrom
esdc-esac-esa-int:ESA_ehst-pyvo_migration

Conversation

@JorgeHigueraFombuena

Copy link
Copy Markdown

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

@codecov

codecov Bot commented Jul 3, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.56604% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.48%. Comparing base (1becbba) to head (b918da4).
⚠️ Report is 273 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.48%   +0.39%     
==========================================
  Files         232      232              
  Lines       19890    19977      +87     
==========================================
+ Hits        13940    14080     +140     
+ Misses       5950     5897      -53     

☔ 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
Copy Markdown
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

bsipocz commented Jul 3, 2025

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
Author

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

@bsipocz

bsipocz commented Jul 21, 2025

Copy link
Copy Markdown
Member

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

@JorgeHigueraFombuena

Copy link
Copy Markdown
Author

@bsipocz
Thank you very much!

@bsipocz bsipocz added this to the v0.4.11 milestone Jul 31, 2025

@bsipocz bsipocz left a comment

Copy link
Copy Markdown
Member

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

Comment thread astroquery/esa/hubble/core.py Outdated
self.get_status_messages()

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

Copy link
Copy Markdown
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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

Comment thread astroquery/esa/hubble/core.py Outdated
def __init__(self, *, show_messages=True, auth_session=None):
super().__init__()

self._vo = None

Copy link
Copy Markdown
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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

Comment thread astroquery/esa/hubble/core.py Outdated
Comment on lines +778 to +779
while job.phase == 'EXECUTING':
time.sleep(3)

Copy link
Copy Markdown
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)

Copy link
Copy Markdown
Author

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 thread astroquery/esa/hubble/core.py Outdated
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
Copy Markdown
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)

Copy link
Copy Markdown
Author

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!

Comment thread astroquery/esa/hubble/core.py Outdated


ESAHubble = ESAHubbleClass()
# Neet to be false in order to avoid errors in tests

Copy link
Copy Markdown
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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Changed

@JorgeHigueraFombuena

JorgeHigueraFombuena commented Aug 4, 2025

Copy link
Copy Markdown
Author

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.

@JorgeHigueraFombuena

Copy link
Copy Markdown
Author

Hi @bsipocz
We've already finished the changes in our side.
All the remote tests are working fine!
So this PR could be reviewed again
Thanks and sorry for the delay

@bsipocz bsipocz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you @JorgeHigueraFombuena! I have two very minor comments, will just add them and then merge this PR.

Comment thread astroquery/esa/hubble/core.py Outdated
Comment thread CHANGES.rst Outdated
Comment thread astroquery/esa/hubble/core.py Outdated
@bsipocz bsipocz force-pushed the ESA_ehst-pyvo_migration branch from f80e854 to b918da4 Compare September 4, 2025 03:47
@bsipocz bsipocz merged commit 4904296 into astropy:main Sep 4, 2025
12 checks passed
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