JeffreySarnoff / RollingFunctions.jl

Roll a window over data; apply a function over the window.
MIT License
114 stars 6 forks source link

Padding example from readme not working #40

Closed HenriDeh closed 1 year ago

HenriDeh commented 1 year ago

padding is not a valid keyword.

julia> data = collect(1.0f0:5.0f0)
5-element Vector{Float32}:
 1.0
 2.0
 3.0
 4.0
 5.0

julia> windowsize = 3
3

julia> result = rollmean(data, windowsize)
3-element Vector{Float32}:
 2.0
 3.0
 4.0

julia> result = rollmean(data, windowsize; padding=missing)
ERROR: MethodError: no method matching rollmean(::Vector{Float32}, ::Int64; padding=missing)
Closest candidates are:
  rollmean(::V, ::Int64) where {T, V<:AbstractVector{T}} at C:\Users\Henri\.julia\packages\RollingFunctions\SJK7X\src\roll\rollstats.jl:14 got unsupported keyword argument "padding"
  rollmean(::V, ::Int64, ::StatsBase.AbstractWeights) where {T, V<:AbstractVector{T}} at C:\Users\Henri\.julia\packages\RollingFunctions\SJK7X\src\roll\rollstats.jl:18 got unsupported keyword argument "padding"
  rollmean(::V, ::Int64, ::AbstractVector{S}) where {T, V<:AbstractVector{T}, S} at C:\Users\Henri\.julia\packages\RollingFunctions\SJK7X\src\roll\rollstats.jl:16 got unsupported keyword argument "padding"    
  ...
Stacktrace:
 [1] top-level scope
   @ REPL[12]:1

julia> result = rollmean(data, windowsize, rand(3); padding=missing)
ERROR: MethodError: no method matching rollmean(::Vector{Float32}, ::Int64, ::Vector{Float64}; padding=missing)
Closest candidates are:
  rollmean(::V, ::Int64, ::AbstractVector{S}) where {T, V<:AbstractVector{T}, S} at C:\Users\Henri\.julia\packages\RollingFunctions\SJK7X\src\roll\rollstats.jl:16 got unsupported keyword argument "padding"    
  rollmean(::V, ::Int64) where {T, V<:AbstractVector{T}} at C:\Users\Henri\.julia\packages\RollingFunctions\SJK7X\src\roll\rollstats.jl:14 got unsupported keyword argument "padding"
  rollmean(::V, ::Int64, ::StatsBase.AbstractWeights) where {T, V<:AbstractVector{T}} at C:\Users\Henri\.julia\packages\RollingFunctions\SJK7X\src\roll\rollstats.jl:18 got unsupported keyword argument "padding"
  ...
Stacktrace:
 [1] top-level scope
   @ REPL[13]:1
JeffreySarnoff commented 1 year ago

You saw the README for v1 (which has not been released).

While this kind of development often is done on a git branch there were some git related hiccups which were resolved by forcing some commits out of sequence.

I have added a link to the current release and its docs the the README top. This kind of development is done on a git branch and later merged, Or not.

there were git hiccups [that needed some git forcing].

HenriDeh commented 1 year ago

Thank you. I guess I can close this.