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

Fix angle generation caching occassionally swapping results #2013

Merged
merged 4 commits into from
Feb 8, 2022

Conversation

djhoese
Copy link
Member

@djhoese djhoese commented Feb 7, 2022

This PR fixes angle generation caching in the rare case that glob (which is defined as not being sorted) would return the list of zarr directories in the wrong order. My caching code assumed that it was getting the zarr files in the same order as the return results of the function being cached. And even though I know that glob behaves this way I somehow missed the sorted on the call. 🤷‍♂️

@djhoese
Copy link
Member Author

djhoese commented Feb 7, 2022

Note in the stacked area definition test case I "moved" the area definitions over in the X dimension because them being centered on the reference longitude of the projection made them not fail my new reversed glob tests.

@codecov
Copy link

codecov bot commented Feb 7, 2022

Codecov Report

Merging #2013 (92c6e29) into main (94fc4f7) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2013   +/-   ##
=======================================
  Coverage   93.55%   93.55%           
=======================================
  Files         282      282           
  Lines       41538    41548   +10     
=======================================
+ Hits        38860    38870   +10     
  Misses       2678     2678           
Flag Coverage Δ
behaviourtests 4.77% <0.00%> (-0.01%) ⬇️
unittests 94.08% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
satpy/modifiers/angles.py 96.68% <100.00%> (ø)
satpy/tests/test_modifiers.py 100.00% <100.00%> (ø)

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 94fc4f7...92c6e29. Read the comment docs.

@coveralls
Copy link

coveralls commented Feb 7, 2022

Coverage Status

Coverage increased (+0.001%) to 94.013% when pulling 92c6e29 on djhoese:bugfix-angle-caching-zarr-order into 94fc4f7 on pytroll:main.

Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

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

LGTM! great 🕵️ work!

@djhoese djhoese merged commit d00db57 into pytroll:main Feb 8, 2022
@djhoese djhoese deleted the bugfix-angle-caching-zarr-order branch February 8, 2022 14:39
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.

AHI HSD true_color incorrect with cache_sensor_angles
3 participants