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

Adapt for later versions of TQDM #95

Merged
merged 2 commits into from
Dec 6, 2019

Conversation

adybbroe
Copy link
Collaborator

@adybbroe adybbroe commented Dec 6, 2019

Adjust ftp download chunk size and the number of expected iterations to an integer.

In the most recent version of tqdm (4.40 as opposed to 4.37) pyspectral fails if the total number of iterations when downloading data in chunks is not an integer.

tqdm is used to show status bar when downloading LUTs via ftp.

Thanks to @aronnem for reporting this!

  • Closes #xxxx
  • Tests added
  • Tests passed: Passes pytest pyspectral
  • Passes flake8 pyspectral
  • Fully documented

…ations to be an integer

Signed-off-by: Adam Dybbroe <Adam.Dybbroe@smhi.se>
Signed-off-by: Adam Dybbroe <Adam.Dybbroe@smhi.se>
@@ -433,7 +433,7 @@ def download_luts(**kwargs):
else:
aerosol_types = HTTPS_RAYLEIGH_LUTS.keys()

chunk_size = 10124
chunk_size = 4096
Copy link
Member

Choose a reason for hiding this comment

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

According to https://requests.readthedocs.io/en/master/api/#requests.Response.iter_content the chunk size is number of bytes so this is only 4K. I think we want something in the range of 1-10MB.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I just fixed that, you are too quick @djhoese ! :-)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We are downloading files in the order of 3-75 MB

@coveralls
Copy link

coveralls commented Dec 6, 2019

Coverage Status

Coverage remained the same at 71.06% when pulling 2907254 on adybbroe:fix4latest-tqdm into d438613 on pytroll:master.

@adybbroe adybbroe merged commit 0c8c8fb into pytroll:master Dec 6, 2019
@adybbroe adybbroe deleted the fix4latest-tqdm branch December 6, 2019 17:30
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