You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Change default boundary value to "none" for dask map_overlap #8391
I'd like to propose changing the default value of the boundary keyword argument in map_overlap. The current default is "reflect", and I'd like it to be boundary="none" instead.
Reasons why this would be useful:
It's much faster. It roughly halves the number of tasks, and the difference in compute time is significant
There's less of a difference between results from a numpy array, vs the same data in a dask array (numpy doesn't do extra padding around the edges by default, so when we do this with dask, it's not equivalent anymore)
Users rely on default values to choose something sensible, and I think fast performance should be weighted more highly as a sensible priority.
Many inner functions already handle edges themselves (eg: scipy.ndimage.gaussian_filter, among many others), in which case it is redundant to handle the edges twice.
dask-image already uses boundary="none" wherever possible. We also see users concerned about performance end up doing a bit of experimentation and ending up here too.
This seems sane to me. I'm wondering who else is likely to be heavily using map_overlap since we should probably let them know that we intend to flip the switch. I can't think of an easy way to deprecate this slowly so I think it'll just be a matter of noting the change (and when it occurred) in the documentation.
At least xarray's code I didn't see much use of map_overlap. Maybe it is only used on fallback paths, but they seem to do the same thing here and here. Though I may be missing things (particularly from that broader ecosystem)
Have long wanted to deprecate this functionality in map_overlap and move workflows to something more NumPy-like for solving this problem (when it is needed, which arguably is rare) by using pad ( #3641 )
I'm not sure I can give much Xarray perspective (not my area of specialization). @dcherian would probably be better on this.
However, we are using this feature quite heavily in xgcm/xgcm#380, which @TomNicholas is spearheading. In that PR, we actually explicitly specify boundary="none", so as long as that keeps working, 👌 .
Ok so it doesn't sound like this will cause issues. So maybe we should go ahead.
Just to make sure we haven't missed anyone, would suggest a deprecation cycle. So first we warn if boundary is not specified and let users know the behavior will change (this will become "none" in some future release). Then in that future release (whatever version we picked), we make the change.
Reacted by James Bourbeau, Genevieve Buckley, Julia Signell and Juan Nunez-Iglesias
Update, we said we'd make the change in version 2022.03.0
So in late February, we need to make a second PR, changing the default value of the boundary kwarg to "none" (that's not the python None, but a string with the word "none"). If you see the first PR linked above, there's a comment telling you which function & line the change needs to be made on.
Reacted by Juan Nunez-Iglesias, Julia Signell and jakirkham
Activity
jsignell commentedon Nov 17, 2021
This seems sane to me. I'm wondering who else is likely to be heavily using
map_overlapsince we should probably let them know that we intend to flip the switch. I can't think of an easy way to deprecate this slowly so I think it'll just be a matter of noting the change (and when it occurred) in the documentation.jakirkham commentedon Nov 17, 2021
At least xarray's code I didn't see much use of
map_overlap. Maybe it is only used on fallback paths, but they seem to do the same thing here and here. Though I may be missing things (particularly from that broader ecosystem)cc @rabernat (for an xarray perspective)
jakirkham commentedon Nov 17, 2021
Personally agree that this makes sense
Have long wanted to deprecate this functionality in
map_overlapand move workflows to something more NumPy-like for solving this problem (when it is needed, which arguably is rare) by usingpad( #3641 )rabernat commentedon Nov 17, 2021
I'm not sure I can give much Xarray perspective (not my area of specialization). @dcherian would probably be better on this.
However, we are using this feature quite heavily in xgcm/xgcm#380, which @TomNicholas is spearheading. In that PR, we actually explicitly specify
boundary="none", so as long as that keeps working, 👌 .dcherian commentedon Nov 17, 2021
👍 Xarray doesn't really use
map_overlapmuch. I bet xgcm usesmap_overlapthe most in the xarray ecosystem.jakirkham commentedon Nov 17, 2021
Ok so it doesn't sound like this will cause issues. So maybe we should go ahead.
Just to make sure we haven't missed anyone, would suggest a deprecation cycle. So first we warn if
boundaryis not specified and let users know the behavior will change (this will become"none"in some future release). Then in that future release (whatever version we picked), we make the change.Deprecation warning for default value of boundary kwarg in map_overlap (
GenevieveBuckley commentedon Dec 5, 2021
Update, we said we'd make the change in version
2022.03.0So in late February, we need to make a second PR, changing the default value of the
boundarykwarg to"none"(that's not the pythonNone, but a string with the word"none"). If you see the first PR linked above, there's a comment telling you which function & line the change needs to be made on.Finish making ``map_overlap`` default boundary ``kwarg`` ``'none'`` (#…
scharlottej13 commentedon Mar 1, 2022
@jsignell are we good to close this issue since #8743 has been merged?
jakirkham commentedon Mar 1, 2022
I think so. @GenevieveBuckley is this good to close from your perspective? 🙂
jsignell commentedon Mar 1, 2022
Yeah I think this is good to close! @GenevieveBuckley please correct me if you disagree.