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

Add 'reduce_data' keyword argument to disable cropping before resampling #582

Merged
merged 8 commits into from Jan 29, 2019

Conversation

pnuu
Copy link
Member

@pnuu pnuu commented Jan 22, 2019

This PR adds a way to disable data reduction before resampling. This is a work-around for #383 that might be useful even after fixing pyresample.

  • Tests added
  • Tests passed
  • Passes git diff origin/master -- "*py" | flake8 --diff
  • Fully documented

Usage when calling resampling:

lcl = glbl.resample(..., reduce_data=False)

The default is to apply data reduction.

Not sure where to document this, as resampling documentation is coming direct from resample.py docstrings, and this fix happens in scene.py. Suggestions?

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 77.437% when pulling 1fa2dcc on pnuu:feature-optional-datareduction into 8288d4b on pytroll:master.

@coveralls
Copy link

coveralls commented Jan 22, 2019

Coverage Status

Coverage increased (+0.1%) to 77.677% when pulling 3a32193 on pnuu:feature-optional-datareduction into 02d9e91 on pytroll:master.

@codecov
Copy link

codecov bot commented Jan 22, 2019

Codecov Report

Merging #582 into master will increase coverage by 0.1%.
The diff coverage is 68.18%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #582     +/-   ##
=========================================
+ Coverage   77.57%   77.67%   +0.1%     
=========================================
  Files         136      136             
  Lines       19194    19209     +15     
=========================================
+ Hits        14889    14921     +32     
+ Misses       4305     4288     -17
Impacted Files Coverage Δ
satpy/tests/test_scene.py 99.42% <100%> (+0.1%) ⬆️
satpy/scene.py 86.77% <41.66%> (+2.64%) ⬆️
satpy/readers/__init__.py 94.46% <0%> (+1.38%) ⬆️

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 02d9e91...3a32193. Read the comment docs.

@djhoese djhoese changed the title Make it possible to disable data reduction with a kwarg Add 'data_reduce' keyword argument to disable resample cropping Jan 22, 2019
satpy/scene.py Outdated Show resolved Hide resolved
@pnuu pnuu changed the title Add 'data_reduce' keyword argument to disable resample cropping Add 'reduce_data' keyword argument to disable cropping before resampling Jan 22, 2019
satpy/scene.py Outdated Show resolved Hide resolved
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.

Could you explicitly add the keyword argument to the resample method and document it in the docstring. Otherwise this looks good to me.

@pnuu
Copy link
Member Author

pnuu commented Jan 26, 2019

The test failures in generic_image reader seem to be related to version changes of either gdal, pyproj or rasterio. Locally the tests passed with gdal=2.3.2, pyproj=1.9.5.1 and rasterio=1.0.9 and fail after upgrading to latest packages.

@djhoese
Copy link
Member

djhoese commented Jan 27, 2019

I merged #595 which should fix the errors you were receiving for now. I restarted the tests and hopefully it picks up on the changes in master. Otherwise I'll merge master in to your branch for this.

@djhoese djhoese self-assigned this Jan 27, 2019
@djhoese djhoese added enhancement code enhancements, features, improvements component:resampling labels Jan 27, 2019
@djhoese djhoese added this to the v0.12 milestone Jan 27, 2019
@djhoese djhoese merged commit b354fed into pytroll:master Jan 29, 2019
djhoese added a commit to djhoese/satpy that referenced this pull request Jan 30, 2019
djhoese added a commit that referenced this pull request Jan 31, 2019
Fix resample reduce_data bug introduced in #582
@pnuu pnuu deleted the feature-optional-datareduction branch April 23, 2019 07:57
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

3 participants