Add keepdims
options to reader classes to avoid squeezing singleton dims
#521
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Slices like
slice(n, n+1)
currently get squeezed out of theRasterReader
andRasterStackReader
classes.TBD: if we should make the defaultkeepdims=True
, or make the default the same as current behavior withkeepdims=False
.I have made the default
keepdims=True
, since, in dolphin, we are really using these dataset readers in the context of block-based processing. There are more headaches involved with a dimension accidentally dropping out than having an extra singleton dimension. Since we're adding this as an init option, there's still the ability to squeeze out dimensions if desired for other purposes.