-
Notifications
You must be signed in to change notification settings - Fork 43
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
improved RollingFunctions.jl integration #851
Comments
mmm... I thought this was covered by https://rafaqz.github.io/DimensionalData.jl/stable/groupby#binning and https://rafaqz.github.io/DimensionalData.jl/stable/groupby#Select-by-Dimension, maybe we could show it more, if indeed is the same. |
IIUC binning is not the same as applying a rolling function though, since bins are disjoint whereas the point of rolling functions is that there are sliding windows that overlap. |
well, for moving windows (xarray-like) we have this in yaxarrays, but is not documented yet. |
I was thinking we needed an extension, but actually Stencils.jl doesn't and still returns a DimArray; https://github.com/rafaqz/Stencils.jl/blob/main/test%2Farray.jl#L170-L172 So this is a RollingFunctions.jl problem. To fix it generically for all input array types, they probably need to use |
This is what Stencils does: https://github.com/rafaqz/Stencils.jl/blob/main/src%2Fmapstencil.jl#L28-L31 They can just copy that and the tests |
I looked into this, but the |
I ended up creating my own package in https://github.com/simeonschaub/RollingWindowArrays.jl for rolling window operations since I wasn't really satisfied with RollingFunctions.jl because its implementation is quite complex and hard to extend. I think this issue can probably be closed. |
RollingFunctions.jl already works with AbstractDimArrays, but unfortunately the dimension is lost in the process. Python's xarray has a method
rolling
which keeps the original dimensions of the array and even has a particularly usefulcenter
argument to specify that the labels should be set at the center of the window.It also supports a
dim
argument which RollingFunctions.jl doesn't have AFAIK, but I'm thinking that this might not be necessary and with #850, one could just useeachslice
for this.Would it be reasonable to add an extension here supporting such a use case?
The text was updated successfully, but these errors were encountered: