RollingFunctions.jl (first look at v1)

Early access to RollingFunctions.jl v1 is given as WindowedFunctions.jl.
This version does more, has padding, and provides tiling. (see the docs).

# add the package
using Pkg
github_url = "JeffreySarnoff/WindowedFunctions.jl"
Pkg.add(url = "https://github.com/" * github_url)

This version is radically redesigned. The new approach offers the most requested capabilities, provides much flexibility, and performs well. All of the widely used call signatures will remain supported for many months following the official release of v1, identified as deprecated calls with detailed information about the revision.

It would be a great help if some users of RollingFunctions would take this prerelease for a walk. Post issues, suggestions here.

11 Likes

Does the rolling only occur over one dimension or is multidimensional rolling supported?

Please give me a short example of how you want multidimensional rolling to work.

Given an N dimension array, I would want to run a function over N-dimensional subarrays created by taking an N-dimension sliding window over the space.

The sliding window would move over the space according to a Morton Z-order curve:

For example given a 4x4 matrix and a 3x3 window, I would want to iterate over the space as follows.

julia> A = reshape(1:16, 4, 4)
4×4 reshape(::UnitRange{Int64}, 4, 4) with eltype Int64:
 1  5   9  13
 2  6  10  14
 3  7  11  15
 4  8  12  16

julia> f = identity
identity (generic function with 1 method)

julia> f(@view(A[(1:3) .+ 0, (1:3) .+ 0]))
3×3 view(reshape(::UnitRange{Int64}, 4, 4), 1:3, 1:3) with eltype Int64:
 1  5   9
 2  6  10
 3  7  11

julia> f(@view(A[(1:3) .+ 1, (1:3) .+ 0]))
3×3 view(reshape(::UnitRange{Int64}, 4, 4), 2:4, 1:3) with eltype Int64:
 2  6  10
 3  7  11
 4  8  12

julia> f(@view(A[(1:3) .+ 0, (1:3) .+ 1]))
3×3 view(reshape(::UnitRange{Int64}, 4, 4), 1:3, 2:4) with eltype Int64:
 5   9  13
 6  10  14
 7  11  15

julia> f(@view(A[(1:3) .+ 1, (1:3) .+ 1]))
3×3 view(reshape(::UnitRange{Int64}, 4, 4), 2:4, 2:4) with eltype Int64:
 6  10  14
 7  11  15
 8  12  16

Here are some packages that partially address this.

Is the class of functions that would be appropriate to run over e.g. 3x3 subarrays or over 3x3x3 subarrays of a 4x4x4 data source some union of linear algebra (maximal eignenvalue) and basic agglomerative functions (min, sum, mean) or are there other function groups that may come into play?

If the output of the function were scalar, then a common application would some of the classic morphological image processing algorithms. For example,

https://homepages.inf.ed.ac.uk/rbf/HIPR2/hitmiss.htm

1 Like

perhaps … thank you for bringing this to my attention … worth considering

I would put the examples of each function on the function’s page rather than having a separate examples page.

Do you think it important to limit the length of any one doc page?
I do see how there needs to be an immediate connection …
so providing a direct and large link from each “approach page”
to the corresponding “using page” and vice-versa.

I would have 1-3 examples of a usage on the same page.

I had been keeping the inline docs roughly matching the website docs.
Letting inline doc entries scroll far away is somewhat annoying.
How would you feel about separating the examples from the concepts with the inline docs – or do you prefer they too go long and one scrolls back to read it?

I don’t mind a long page. I like for example Functions · DataFrames.jl

1 Like