-
-
Notifications
You must be signed in to change notification settings - Fork 407
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
ESA Integral Science Legacy Archive Astroquery module #3154
ESA Integral Science Legacy Archive Astroquery module #3154
Conversation
Hello @jespinosaar! 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-22 12:29:15 UTC |
Ok, the tests are not working in the CI/CD environment. It seems that, at some point, it tries to connect to the URL. I would need some support on this. Maybe I should define the tap parameter as a property, similar to what is done for other modules. What do you think, @bsipocz ? Do you recommend any other alternative? |
e9d45f3
to
8368fd6
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3154 +/- ##
==========================================
+ Coverage 67.49% 68.18% +0.68%
==========================================
Files 232 231 -1
Lines 18446 19048 +602
==========================================
+ Hits 12450 12987 +537
- Misses 5996 6061 +65 ☔ View full report in Codecov by Sentry. |
I applied the changes I commented before and it seems all checks are passing now! So we can now check if everything is ok, iterate on changes and, when possible, merge it. Please let me know your thoughts and thanks in advance for the feedback! |
Thanks @jespinosaar. I'll bump this into the new year as it's unrealistic to promise a review before we're off for a break. |
Of course, no problem! thanks @bsipocz and Merry Christmas! |
af9d8e6
to
dc9f7c8
Compare
Hi again, and happy new year! I just fixed some conflicts that appeared after some pull requests were merged. |
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.
Thank you @jespinosaar!
Could you please add some remote_data tests as I see everything is mocked at the moment or skipped when part of the documentation.
Beyond that I had only a few comments mostly focusing on concentrating the API into fewer new methods.
docs/esa/integral/integral.rst
Outdated
@@ -0,0 +1,357 @@ | |||
.. doctest-skip-all |
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 are the tests skipped in here?
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 removed that line.
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.
Some test coverage would be nice for these functionalities
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 have added the tests to almost all the features.
astroquery/esa/utils/utils.py
Outdated
return response | ||
|
||
|
||
def plot_result(x, y, x_title, y_title, plot_title, *, error_x=None, error_y=None, log_scale=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.
We don't usually do any add-on to data access functionality, such as plotting, so I'm a bit hesitant about these ones
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.
Totally agree, we should use astroquery to retrieve data only. I removed them.
astroquery/esa/utils/utils.py
Outdated
return super()._request(method, url, **kwargs) | ||
|
||
|
||
def get_coord_input(value, msg): |
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.
most of these are generic enough, so may need to be cleaned up/consolidated. E.g. why not just use commons.parse_coordinates
in the integral module?
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/integral/core.py
Outdated
except Exception as e: | ||
log.error('No science windows have been found with these inputs. {}'.format(e)) | ||
|
||
def get_timeline(self, ra, dec, *, radius=14, plot=False, plot_revno=False, plot_distance=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.
I wonder if this could take a SkyCoord input instead of the floats
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/integral/core.py
Outdated
query = conf.ISLA_EPOCH_QUERY.format(instrument_oid, band_oid) | ||
return self.query_tap(query) | ||
|
||
def get_long_term_timeseries(self, target_name, *, instrument=None, band=None, plot=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.
I wonder if the get_* and download* methods can be merged into one where the download is just a parameter, after all they are almost identical? Would that make sense?
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.
They were providing different outputs, but it is true that the valid ones are retrieved using download methods. So, I have removed the original get_* methods and renamed the download_* to get_*, plus other features.
Many thanks for your feedback, @bsipocz ! I will work on them |
Just answered some of your comments. Now I am working on the remote tests and the ones for utils.py. |
I have pushed the code to address the rest of your comments, @bsipocz . Please let me know if further changes are required. It would be great if we could have a pre-release version containing this new module. Thanks in advance! |
Unfortunately, I see a bunch of test failures (I don't see why they didn't fail in CI), e.g the ones below. But also I see a lot of unclosed file warnings in the remote tests: However, while this may be a local to me issue I also run into a bunch of data files downloaded into the main repo directory during the tests as opposed to a tempdir. Doing that may solve the unclosed file warnings out of the box.
|
As for the release: we're doing a quick turnaround for 0.4.9, the plan is to do it this week, but I can certainly wait for this PR to get merged. |
Hi @bsipocz , I have modified the tests so now the downloaded files should be stored in a temporary path that is cleaned after the tests. So the warnings should have gone. I am curious about the failing tests. These errors appeared to me when the dummy files were not included yet. But now they should be there. The tests are working in the CI/CD environment and in my local as well (using python setup.py test and tox to execute them). Maybe you can try executing them again. But, in any case, could you please let me know which command you are using to execute them in your local? So I can trace the issue in my local. Many thanks! |
That is great! thanks for letting me know and waiting for this PR! |
I do use |
I have the strong suspicion this is about the tarfile extractions and that we need to add the fully trusted filter option. [edit:] yes, it was a tarfile related issue. I'm pushing changes to this PR to get it fixed, but first also changes to the CI so we see the issue in CI, too. |
… it triggers the issue we see locally
OK, local test failures are fixed. I suspect some of the issues only shown locally when the tests were run for only one module (some of the settings/etc are reused in the same test run). Anyway, the one remaining issue is that there are still file dumps done with the |
These are the still dumped files:
However, I would say this is a small enough issue with the PR that if I get to the point being close to a release, I may just merge the PR as is and leave this issue for a follow-up cleanup as I don't expect much changes is needed to the API. |
Many thanks for finding this! This will improve the CI workflow for sure |
I just pushed some small changes, so now the uncompressed files are copied to a temp folder before and they are removed after the tests. So no untracked files should appear now. Please, let me know if you still see them and more changes are required. |
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.
Thank you. It all looks good now.
…query ESA Integral Science Legacy Archive Astroquery module
Many thanks for your support, @bsipocz !! |
Dear Astroquery team,
This PR aims to integrate a new module for the ESA Integral Science Legacy Archive. The main difference with other modules is that this is the first integration of an ESA module using PyVO, instead of the deprecated astroquery.utils.tap module. We have developed a fully functional module that can be used as reference to migrate the rest. Please let us know your thoughts and we will iterate on this to merge it. Thanks for your support!
Would it be possible to create a release, right after this module has been merged? Thank you very much.
Kind regards,
@jespinosaar
cc @esdc-esac-esa-int