Closed xgdgsc closed 5 years ago
I don' t know if we should add result=convert(Array{Union{Missing,Float64}}
to places like
https://github.com/JeffreySarnoff/RollingFunctions.jl/blob/master/src/rolling.jl#L50 . Didn' t find why it worked before. Now it shows error with arrays contain missing:
MethodError: Cannot `convert` an object of type Missing to an object of type Float64
Closest candidates are:
convert(::Type{T<:Number}, !Matched::T<:Number) where T<:Number at number.jl:6
convert(::Type{T<:Number}, !Matched::Number) where T<:Number at number.jl:7
convert(::Type{T<:Number}, !Matched::Base.TwicePrecision) where T<:Number at twiceprecision.jl:250
...
Stacktrace:
[1] setindex!(::Array{Float64,1}, ::Missing, ::Int64) at ./array.jl:769
[2] tapers(::typeof(sum), ::Array{Union{Missing, Float64},1}) at /home/dev/.julia/packages/RollingFunctions/DLRrJ/src/rolling.jl:52
[3] running(::Function, ::Array{Union{Missing, Float64},1}, ::Int64) at /home/dev/.julia/packages/RollingFunctions/DLRrJ/src/running.jl:10
[4] top-level scope at In[16]:1
I had a bunch of edits (not current master, an earlier one) that covered missings comprehensively and works with Julia v1.1-dev but does not precompile with Julia v1.0.3. Im considering waiting for v1.1 and using those. What do you think.
That' s fine for me. Currently using my local simple implementation.
actually -- it seems sorted out now. Please try current master and let me know if it works for you.
works
After upgrading to julia 1.0.3 from 1.0.2. I get error with code that used to work before:
Adding
RollingFunctions.float(::Type{Union{T,Missing}}) where {T} = Base.float(T)
from https://github.com/JuliaLang/julia/issues/29693 seems a partial workaround for me.