JeffreySarnoff / RollingFunctions.jl

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

Problem with padding ? #45

Open berjine opened 1 year ago

berjine commented 1 year ago

Hi, I noticed that padding doesn't seem to work, either with the example given on the main page (as seen below) or with the test functions

julia> data = collect(1.0f0:5.0f0); print(data); windowsize = 3;
Float32[1.0, 2.0, 3.0, 4.0, 5.0]

julia> 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}} got unsupported keyword argument "padding"
   @ RollingFunctions C:\Users\aubert.AD-IFSTTAR\.julia\packages\RollingFunctions\SJK7X\src\roll\rollstats.jl:14
  rollmean(::V, ::Int64, ::StatsBase.AbstractWeights) where {T, V<:AbstractVector{T}} got unsupported keyword argument "padding"
   @ RollingFunctions C:\Users\aubert.AD-IFSTTAR\.julia\packages\RollingFunctions\SJK7X\src\roll\rollstats.jl:18
  rollmean(::V, ::Int64, ::AbstractVector{S}) where {T, V<:AbstractVector{T}, S} got unsupported keyword argument "padding"
   @ RollingFunctions C:\Users\aubert.AD-IFSTTAR\.julia\packages\RollingFunctions\SJK7X\src\roll\rollstats.jl:16
  ...

Stacktrace:
 [1] top-level scope
   @ REPL[9]:1

(@v1.9) pkg> status
Status `C:\Users\aubert.AD-IFSTTAR\.julia\environments\v1.9\Project.toml`
  [b0e4dd01] RollingFunctions v0.7.0

julia> versioninfo()
Julia Version 1.9.0
Commit 8e63055292 (2023-05-07 11:25 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, tigerlake)
  Threads: 1 on 8 virtual cores
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. https://github.com/JeffreySarnoff/RollingFunctions.jl/tree/v1