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

Delete kdtree after saving cache #1227

Merged
merged 1 commit into from Jun 1, 2020

Conversation

pnuu
Copy link
Member

@pnuu pnuu commented Jun 1, 2020

This simple change (delete the kdtree after saving the cache) makes it possible to use dask.distributed with nearest resampling. The only requirement is that cache_dir needs to be used, so this will not be very useful for other than geostationary satellites.

  • Tests added
  • Tests passed
  • Passes flake8 satpy

@pnuu pnuu added enhancement code enhancements, features, improvements component:resampling labels Jun 1, 2020
@pnuu pnuu requested review from mraspaud and djhoese June 1, 2020 06:34
@pnuu pnuu self-assigned this Jun 1, 2020
@coveralls
Copy link

Coverage Status

Coverage increased (+0.001%) to 89.778% when pulling f2c4105 on pnuu:feature-cached-remove-kdtree into ab17a71 on pytroll:master.

@codecov
Copy link

codecov bot commented Jun 1, 2020

Codecov Report

Merging #1227 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1227   +/-   ##
=======================================
  Coverage   89.77%   89.77%           
=======================================
  Files         202      202           
  Lines       30031    30034    +3     
=======================================
+ Hits        26961    26964    +3     
  Misses       3070     3070           
Impacted Files Coverage Δ
satpy/resample.py 90.77% <100.00%> (+0.01%) ⬆️
satpy/tests/test_resample.py 98.84% <100.00%> (+<0.01%) ⬆️

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 ab17a71...f2c4105. Read the comment docs.

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

Copy link
Member

@djhoese djhoese left a comment

Choose a reason for hiding this comment

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

Awesome! Nice catch.

I'm looking at this code in pyresample and I'm a little confused why we set it to a instance attribute anyway. It gets used in the same function that it is created in. Oh maybe dask needs a reference to it to keep it in memory.

One quick question: doesn't this still require computing the indexes on a local threaded scheduler and then after things are cached we are allowed to go distributed? This means you'd have to switch schedulers between computations, doesn't it?

@pnuu
Copy link
Member Author

pnuu commented Jun 1, 2020

The computations appear to happen automatically in the local thread when saving the cache, so doesn't need manual adjustment for the scheduler. At least with the currend Dask version 😬

@mraspaud mraspaud merged commit 08e6353 into pytroll:master Jun 1, 2020
@pnuu pnuu deleted the feature-cached-remove-kdtree branch June 2, 2020 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:resampling enhancement code enhancements, features, improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants