Interpolations.jl icon indicating copy to clipboard operation
Interpolations.jl copied to clipboard

`to_indices` dispatch ambiguity

Open grahamas opened this issue 4 years ago • 1 comments

I'm posting here rather than AxisIndices because I checked src/Interpolations.jl:273 and found a comment stating that the offending method is at a "non-exported point in the dispatch hierarchy" in order "to avoid ambiguities with methods that specialize on the array type." The comment seems to be incorrect.

MethodError: to_indices(::AxisArray{Float64,1,Array{Float64,1},Tuple{Axis{Float64,Int64,StepMRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}},OneToMRange{Int64}}}}, ::Tuple{Int64}) is ambiguous. Candidates:
    to_indices(A::AbstractAxisArray{T,1,P,Tuple{Ax1}}, args::Tuple{Arg1}) where {T, P, Ax1, Arg1<:Integer} in AxisIndices.Arrays at /home/graham/.julia/packages/AxisIndices/FXEqg/src/Arrays/indexing.jl:19
    to_indices(A, I::Tuple{Vararg{Union{Int64, Interpolations.WeightedIndex},N} where N}) in Interpolations at /home/graham/.julia/packages/Interpolations/TBuvH/src/Interpolations.jl:273
    to_indices(A::AbstractAxisArray, I::Tuple{Integer}) in AxisIndices.Arrays at /home/graham/.julia/packages/AxisIndices/FXEqg/src/Arrays/indexing.jl:6
  Possible fix, define
    to_indices(::AbstractAxisArray{T,1,P,Tuple{Ax1}}, ::Tuple{Int64}) where {T, P, Ax1}

(Interpolations v0.12.10)

grahamas avatar Sep 28 '20 20:09 grahamas

Hi. Thank you for submitting an issue. Could you provide some example code or preferably a minimum working example that triggers this method error?

mkitti avatar Sep 30 '20 03:09 mkitti