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

Log a warning if there are download duplicates for MAST #2510

Merged
merged 1 commit into from
Sep 8, 2022

Conversation

jdavies-st
Copy link
Contributor

This is a follow-up PR in response to #2497 (comment)

Instead of issuing a warnings.warn when duplicate downloads are culled, this PR uses log.warning. I've removed the warning class I'd created and instead just logged the warning. Test is updated as well.

@codecov
Copy link

codecov bot commented Sep 7, 2022

Codecov Report

Merging #2510 (b348489) into main (3a57b4c) will increase coverage by 0.01%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #2510      +/-   ##
==========================================
+ Coverage   62.97%   62.98%   +0.01%     
==========================================
  Files         133      133              
  Lines       17308    17308              
==========================================
+ Hits        10900    10902       +2     
+ Misses       6408     6406       -2     
Impacted Files Coverage Δ
astroquery/exceptions.py 0.00% <ø> (ø)
astroquery/mast/observations.py 76.66% <0.00%> (ø)
astroquery/svo_fps/core.py 95.45% <0.00%> (+0.21%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@bsipocz bsipocz added the mast label Sep 7, 2022
@@ -827,8 +827,8 @@ def _remove_duplicate_products(self, data_products):
unique_products = unique(data_products, keys="dataURI")
number_unique = len(unique_products)
if number_unique < number:
warnings.warn(f"{number - number_unique} of {number} products were duplicates."
f"Only downloading {number_unique} unique product(s).", DuplicateResultsWarning)
log.warning(f"{number - number_unique} of {number} products were duplicates. "
Copy link
Member

Choose a reason for hiding this comment

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

This feels more like an info level message, but we don't really have a clear policy on the boundaries, so you can keep it as a warning if you prefer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree. I will change it.

@bsipocz
Copy link
Member

bsipocz commented Sep 8, 2022

Thanks @jdavies-st!

@bsipocz bsipocz merged commit c9972e0 into astropy:main Sep 8, 2022
@bsipocz bsipocz added this to the v0.4.7 milestone Mar 8, 2024
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