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

Make astroquery/utils/tap/model/job.Job.save_results() obey verbose setting #2299

Merged
merged 3 commits into from
Feb 22, 2022

Conversation

eerovaher
Copy link
Member

The following example

from astropy import units as u
from astropy.coordinates import SkyCoord
from astroquery.gaia import Gaia
sc = SkyCoord(ra=0*u.deg, dec=0*u.deg)
job = Gaia.cone_search(sc, radius=0.1*u.deg, columns=['source_id'], output_file='temp.vot.gz', dump_to_file=True)

writes the results to a file but does not print anything because the default verbose setting is False. However, the corresponding async method produces the following:

job = Gaia.cone_search_async(sc, radius=0.1*u.deg, columns=['source_id'], output_file='temp.vot.gz', dump_to_file=True)
Saving results to: temp.vot.gz

This is caused by a missing check of the verbose setting, which is fixed here.

The added test reveals that for async jobs the
`astroquery/utils/tap/model/job.Job.save_results()` method prints
messages about having saved the results regardless of the `verbose`
setting.
The `astroquery/utils/tap/model/job.Job.save_results()` method no longer
ignores the `verbose` setting in async jobs.
@codecov
Copy link

codecov bot commented Feb 21, 2022

Codecov Report

Merging #2299 (6f9c97f) into main (bb92dd1) will increase coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2299      +/-   ##
==========================================
+ Coverage   62.72%   62.82%   +0.09%     
==========================================
  Files         130      130              
  Lines       16847    16848       +1     
==========================================
+ Hits        10568    10584      +16     
+ Misses       6279     6264      -15     
Impacted Files Coverage Δ
astroquery/utils/tap/model/job.py 65.10% <100.00%> (+6.55%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bb92dd1...6f9c97f. Read the comment docs.

@bsipocz bsipocz added this to the v0.4.6 milestone Feb 22, 2022
@bsipocz bsipocz merged commit 5e9b817 into astropy:main Feb 22, 2022
@bsipocz
Copy link
Member

bsipocz commented Feb 22, 2022

Thanks @eerovaher!

@eerovaher eerovaher deleted the tap-silent-write branch March 8, 2022 17:27
syed-gilani pushed a commit to syed-gilani/astroquery that referenced this pull request Mar 11, 2022
mhsarmiento pushed a commit to esdc-esac-esa-int/astroquery that referenced this pull request May 24, 2022
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

2 participants