Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/deprecations.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Removed with 0.16, indexing via non-integers
getindex(itp::AbstractInterpolation{T,N}, i::Vararg{Number,N}) where {T,N} =
error("Indexing an AbstractInterpolation by non-integers is no longer supported in Interpolations.jl since v0.16. Use the function calling interface instead: `itp(i...)`.")
getindex(itp::AbstractInterpolation{T,N}, i::Vararg{ExpandedIndexTypes,N}) where {T,N} =
error("Indexing an AbstractInterpolation by non-integers is no longer supported in Interpolations.jl since v0.16. Use the function calling interface instead: `itp(i...)`.")

for T in (:Throw, :Flat, :Line, :Free, :Periodic, :Reflect, :InPlace, :InPlaceQ)
@eval begin
Expand Down
6 changes: 6 additions & 0 deletions test/issues/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,10 @@ using Interpolations, Test, ForwardDiff
t = -3.0:0.01:3.0
@test itp_cdf.(t) isa Vector{Float64}
end
@testset "issue 630" begin
itp = interpolate(ones(100,100), BSpline(Linear()));
# Indexing by non-integers should not result in a StackOverflow due to `Base.to_index(::AbstractInterpolation, x::Number) = x`
@test_throws "Indexing an AbstractInterpolation by non-integers is no longer supported" itp[2.2, 33.3]
@test_throws "Indexing an AbstractInterpolation by non-integers is no longer supported" itp[2.2, 2.0:5.0]
end
end
Loading