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

Move functionality from gaia/core.py to utils/tap/core.py. #2311

Merged
merged 3 commits into from
Mar 19, 2022

Conversation

mhsarmiento
Copy link
Contributor

Dear all, this is mhsarmiento, from esdc/gaia team.
As agreed with @eerovaher, we have moved a functionality that was only available for the Gaia package to the tap package so all packages can get benefit from it. (Please check discussion #2077 (comment))
This functionality prevents users to have problems when opening the downloaded file if they select a format which results are returned in zip and the name for the file selected by the user does not contain the right extension for the compress format.
Thank you very much in advance!
Maria

…ionality prevent users to have problems opening the downloaded file if they select a format which results are returned in zip and the name for the file selected by the user does not contain the right extension for the compress format.
@bsipocz bsipocz added this to the v0.4.6 milestone Feb 25, 2022
@codecov
Copy link

codecov bot commented Feb 25, 2022

Codecov Report

Merging #2311 (3db1dae) into main (6834ef9) will decrease coverage by 0.11%.
The diff coverage is 51.16%.

@@            Coverage Diff             @@
##             main    #2311      +/-   ##
==========================================
- Coverage   63.08%   62.97%   -0.12%     
==========================================
  Files         131      131              
  Lines       17005    17073      +68     
==========================================
+ Hits        10728    10752      +24     
- Misses       6277     6321      +44     
Impacted Files Coverage Δ
astroquery/gaia/core.py 71.94% <ø> (+5.91%) ⬆️
astroquery/utils/tap/taputils.py 67.85% <48.78%> (-11.69%) ⬇️
astroquery/utils/tap/core.py 42.69% <100.00%> (+0.10%) ⬆️
astroquery/utils/tap/model/modelutils.py 51.85% <0.00%> (-40.75%) ⬇️
...roquery/ipac/nexsci/nasa_exoplanet_archive/core.py 60.76% <0.00%> (-8.12%) ⬇️
astroquery/mast/missions.py 76.54% <0.00%> (-2.91%) ⬇️
astroquery/alma/core.py 41.16% <0.00%> (-0.60%) ⬇️
astroquery/exceptions.py 0.00% <0.00%> (ø)
astroquery/mast/services.py 79.56% <0.00%> (ø)
astroquery/mast/collections.py 90.25% <0.00%> (ø)
... and 3 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

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.

Minor comments only. No changelog is needed as the new method is not in the public API.

And thank you for the cleanups, too.

Some tests would be useful though, as I see only the output_file=None case is covered in the test suite.
Either as unit tests for the new method (then do iterate over all output format scenarios), or a remote test for querying the gaia server. An example in the gaia docs would be helpful, too, I see/grep no mention of output_file anywhere there. The examples in the docs now run in remote tests, so they do offer code coverage, too.

astroquery/utils/tap/taputils.py Outdated Show resolved Hide resolved
astroquery/utils/tap/taputils.py Outdated Show resolved Hide resolved
output_file_with_extension = output_file

if output_file is not None:
if output_format in format_with_results_compressed:
Copy link
Member

Choose a reason for hiding this comment

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

I only wondering out loud: is there any way for a user to force the output to be a non-compressed fits?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As far as I know the answer is not. However, I will bring this question to the team and will suggest if it would be that ca be implemented in a near future.

Copy link
Member

Choose a reason for hiding this comment

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

I really just wondered, I think you and the team know better the use cases. Either case, this should not hold up this PR.

astroquery/utils/tap/taputils.py Outdated Show resolved Hide resolved
@bsipocz
Copy link
Member

bsipocz commented Mar 18, 2022

@mhsarmiento - I'm planning to cut a release tomorrow, and will include this. I'll do some minimal fixes to get this merged in the morning (morning PDT), and would suggest adding the new tests we talked about above in a separate PR. Based on your comments above it seems that you already made some changes/commits, please do push them to this branch, so I can include those in the merge.

@mhsarmiento
Copy link
Contributor Author

@mhsarmiento - I'm planning to cut a release tomorrow, and will include this. I'll do some minimal fixes to get this merged in the morning (morning PDT), and would suggest adding the new tests we talked about above in a separate PR. Based on your comments above it seems that you already made some changes/commits, please do push them to this branch, so I can include those in the merge.

Thank you very much @bsipocz and sorry because I haven't had the time yet to include those unit test for this part. However next week we will start a new sprint and we have a few improvements to include in the Gaia/Tap+ modules. I will include this unit test together with those changes. Once again, thank you very much for your support. Have a nice weekend

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 test coverage part of the review has been moved to a separate issue #2328, so we can go ahead mergng this.

@bsipocz
Copy link
Member

bsipocz commented Mar 19, 2022

Something went very wrong with the gaia module, but it's separate from this PR, so I go ahead with the merge and open an issue for the new failures (and treat that as a release blocker, at least until we understand the reason, which maybe just a temporary glitch server side)

@bsipocz bsipocz merged commit e274a2b into astropy:main Mar 19, 2022
@bsipocz
Copy link
Member

bsipocz commented Mar 19, 2022

Thank you @mhsarmiento!

@mhsarmiento
Copy link
Contributor Author

Something went very wrong with the gaia module, but it's separate from this PR, so I go ahead with the merge and open an issue for the new failures (and treat that as a release blocker, at least until we understand the reason, which maybe just a temporary glitch server side)

Hi @bsipocz. Gaia archive is on maintenance. The downtime started last Friday at 17h (CET) and will last until today EOB (CET). Sorry for seeing this only now (I was on traveling this weekend).
In the coming weeks we plan to add a functionality to the Astroquery module so users can receive notifications of the status of the archive in the same way they are displayed in the UI of the GAIA. For example, during schedule maintenances of the archive or any other issue. This should prevent that the issue that you have had happen again in the future.
Sorry for the inconveniences. I will confirm when the archive is up again.

@bsipocz
Copy link
Member

bsipocz commented Mar 29, 2022

I'm afraid this had an effect on other ESA modules that relied on some default file extensions, etc.

I think fixing the tests is relatively straightforward, but I would love to hear the go ahead from the other ESA devs, too that they are OK with the assumptions here, e.g. the results for votable output formats are not 'xml' any more but 'vot.gz' etc.

I think it's more than reasonable to have all the modules behave the same way, and I suspect gaia may have most of the usage, so following what is sensible for gaia sounds logical.

@jespinosaar
Copy link
Contributor

Hi @bsipocz, I agree with these assumptions. As ESA TAP services are relying on the same architecture, we are offering the files the same way in all the Archives (same formats, compressed...). For this reason, all the modules will benefit from this PR, as the correct format will be set when users try to download the tables. Thanks for merging this!

@bsipocz
Copy link
Member

bsipocz commented Mar 29, 2022

@jespinosaar - failing remote tests, that are affected are tracked e.g. here: #2203

Specifically for all the esa modules you can run python setup.py test -P esa,esasky,gaia,utils.tap -R

It would be extremely useful if the ESA team could have a look at the failures. There is no time pressure on this though, I'm more interested in figuring out a way that gets the relevant person to know about these failures sooner.

@mhsarmiento mhsarmiento deleted the tap_1.1_rename_compressed branch June 14, 2022 13:29
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.

None yet

3 participants