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
get_data_window cleanup #2510
get_data_window cleanup #2510
Conversation
|
||
num_dims = len(arr.shape) | ||
if num_dims > 3: | ||
if not 0 < arr.ndim <=3 : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@groutr thanks! The only thing I request is that the new assertions added to tests be turned into new tests (using pytest.mark.parameterize or new functions, your choice).
@sgillies I should be able to get this done by this evening. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonderful @groutr !
* Cleaner get_data_window implementation. * Add tests. * Separate assertions into distinct tests.
Supersedes #2262. Updated PR for rasterio 1.3.0.
Cleans up the implementation of get_data_window and extends it to properly handle 1D arrays. The documentation implied that 1D arrays are supported, but constructing a full window assumed 2 dimensions.
Primary wins: