JuliaMath / JuliaMath/Interpolations.jl
Interpolation bug when calling without extrapolate
- Dominant language
- Julia
- Stars
- 575
- Forks
- 117
- PR merge metrics
- No merged PRs in 30d
Description
I am using Interpolations.jl v0.14.7 (because another low level package KernelDensity has not updated its compatibility).
```julia
julia> using Interpolations
julia> itp0 = interpolate([1, 2, 3, 4], BSpline(Linear()))
4-element interpolate(::Vector{Float64}, BSpline(Linear())) with element type Float64:
Error showing value of type Interpolations.BSplineInterpolation{Float64, 1, Vector{Float64}, BSpline{Linear{Throw{OnGrid}}}, Tuple{Base.OneTo{Int64}}}:
ERROR: BoundsError: attempt to access Tuple{} at index [1]
Stacktrace:
[1] getindex(t::Tuple, i::Int64)
@ Base .\tuple.jl:31
[2] _checklubounds(tf::Bool, ls::Tuple{}, us::Tuple{}, xs::Tuple{Int64})
@ Interpolations C:\Users\hyzho\.julia\packages\Interpolations\nDwIa\src\Interpolations.jl:420
```
However the following is fine:
```julia
etp = extrapolate(interpolate([1,2,3,4], BSpline(Linear())), Periodic())
```
I found this while reading the documentation on [periodic extrapolation](https://juliamath.github.io/Interpolations.jl/stable/extrapolation/#Periodic-extrapolation).
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.