This PR changes the default during reduce operations to keep_attrs=True. In particular, this means that spatial attributes (i.e. ‘spec’, ‘crs’, ‘transform’, ‘resolution’) are retained. In general, their omitting is not critical, as they can be reconstructed using the .rio methods. However, in cases where the arrays contain a spatial dimension with only one pixel width, it is essential to retain the spatial attributes since the spatial information cannot be reconstructed afterwards (-> see here).
Note that with the basic retention of the attributes, the spatial attributes are also retained for reduce-over-space operations. In my view, however, this is uncritical or even beneficial, as it retains an indication of the original spatial reference frame.
Type of change
Select one or more relevant options:
[x] Bug fix (change which fixes a bug reported in a specific issue)
[ ] New feature (change which adds a feature requested in a specific issue)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] Documentation update (improved documentation for existing functionality in the package)
[ ] Repository update (change related to non-package files or structures in the GitHub repository)
Description
This PR changes the default during reduce operations to
keep_attrs=True
. In particular, this means that spatial attributes (i.e. ‘spec’, ‘crs’, ‘transform’, ‘resolution’) are retained. In general, their omitting is not critical, as they can be reconstructed using the .rio methods. However, in cases where the arrays contain a spatial dimension with only one pixel width, it is essential to retain the spatial attributes since the spatial information cannot be reconstructed afterwards (-> see here).Note that with the basic retention of the attributes, the spatial attributes are also retained for reduce-over-space operations. In my view, however, this is uncritical or even beneficial, as it retains an indication of the original spatial reference frame.
Type of change
Select one or more relevant options:
Checklist: