Fix #50. This actually takes the slightly more radical approach of avoiding nesting whenever possible from the constructor.
Other than the more efficient storage, there is a small difference in behavior in that now lag(v, 1) (if v is a ShiftedArray) respects the default value of v. So for instance
julia> using ShiftedArrays
julia> v = ShiftedVector(rand(3), 1, default = NaN)
3-element ShiftedVector{Float64, Float64, Vector{Float64}}:
NaN
0.41510884185926944
0.3917724425282777
julia> lag(v, 1)
3-element ShiftedVector{Float64, Float64, Vector{Float64}}:
NaN
NaN
0.41510884185926944
which IMO is more reasonable than returning something with values [missing, NaN, 0.41510884185926944], but I think deserves some discussion.
TODO:
[x] Document the above change in behavior (if we decide to go for it).
Fix #50. This actually takes the slightly more radical approach of avoiding nesting whenever possible from the constructor.
Other than the more efficient storage, there is a small difference in behavior in that now
lag(v, 1)
(ifv
is aShiftedArray
) respects the default value ofv
. So for instancewhich IMO is more reasonable than returning something with values
[missing, NaN, 0.41510884185926944]
, but I think deserves some discussion.TODO: