-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix inference regression on 1.7 #471
Conversation
Update Interpolations.jl
Codecov Report
@@ Coverage Diff @@
## master #471 +/- ##
==========================================
+ Coverage 76.42% 85.41% +8.98%
==========================================
Files 26 26
Lines 1421 1741 +320
==========================================
+ Hits 1086 1487 +401
+ Misses 335 254 -81
Continue to review full report at Codecov.
|
Also tracking JuliaLang/julia#43368 |
This PR should be enough as a temporary fix. julia> itp = CubicSplineInterpolation((1:100,1:100),randn(100,100));
julia> Interpolations.count_interp_dims(typeof(itp))
ERROR: MethodError: no method matching count_interp_dims(::Type{BSpline{Cubic{Line{OnGrid}}}})
Closest candidates are:
count_interp_dims(::Type{IT}, ::Any) where IT<:Interpolations.InterpolationType at C:\Users\MYJ\.julia\packages\Interpolations\3gTQB\src\Interpolations.jl:164 count_interp_dims(::Type{IT}, ::Any) where {N, IT<:Tuple{Vararg{Interpolations.InterpolationType, N}}} at C:\Users\MYJ\.julia\packages\Interpolations\3gTQB\src\Interpolations.jl:165
count_interp_dims(::Type{BSI}, ::Any) where BSI<:Interpolations.BSplineInterpolation at C:\Users\MYJ\.julia\packages\Interpolations\3gTQB\src\b-splines\b-splines.jl:157
...
Stacktrace:
[1] count_interp_dims(#unused#::Type{BSpline{Cubic{Line{OnGrid}}}}, n::Int64)
@ Interpolations C:\Users\MYJ\.julia\packages\Interpolations\3gTQB\src\Interpolations.jl:164
[2] count_interp_dims(#unused#::Type{Interpolations.Extrapolation{Float64, 2, ScaledInterpolation{Float64, 2, Interpolations.BSplineInterpolation{Float64, 2, OffsetArrays.OffsetMatrix{Float64, Matrix{Float64}}, BSpline{Cubic{Line{OnGrid}}}, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}}, BSpline{Cubic{Line{OnGrid}}}, Tuple{UnitRange{Int64}, UnitRange{Int64}}}, BSpline{Cubic{Line{OnGrid}}}, Throw{Nothing}}})
@ Interpolations C:\Users\MYJ\.julia\packages\Interpolations\3gTQB\src\Interpolations.jl:163
[3] top-level scope
@ REPL[21]:1 |
Can you write a test for the one line you added? |
test added |
Merging |
Since
AbstractInterpolation
<:AbstractArray
, there's no need to definendims
andeltype
ourself.gridtype
is broken, (and unused), so I remove it.itptype
is modified to avoid the recursive call ofsupertype
.