diff --git a/REQUIRE b/REQUIRE index 91a313b1..994bef36 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,8 +1,6 @@ -julia 0.6 +julia 0.7 -ShowItLikeYouBuildIt WoodburyMatrices 0.1.5 Ratios AxisAlgorithms 0.3.0 OffsetArrays -Compat 0.59 diff --git a/src/Interpolations.jl b/src/Interpolations.jl index 5cb222bf..04c7b08e 100644 --- a/src/Interpolations.jl +++ b/src/Interpolations.jl @@ -1,5 +1,3 @@ -VERSION < v"0.7.0-beta2.199" && __precompile__() - module Interpolations export @@ -8,12 +6,6 @@ export extrapolate, scale, - gradient!, - gradient1, - hessian!, - hessian, - hessian1, - AbstractInterpolation, AbstractExtrapolation, @@ -37,21 +29,12 @@ export # extrapolation/extrapolation.jl # scaling/scaling.jl -using Compat -using Compat.LinearAlgebra, Compat.SparseArrays +using LinearAlgebra, SparseArrays using WoodburyMatrices, Ratios, AxisAlgorithms, OffsetArrays -import Base: convert, size, getindex, promote_rule, +import Base: convert, size, axes, getindex, promote_rule, ndims, eltype, checkbounds -@static if VERSION < v"0.7.0-DEV.3449" - import Base: gradient -else - import LinearAlgebra: gradient -end - -import Compat: axes - abstract type Flag end abstract type InterpolationType <: Flag end struct NoInterp <: InterpolationType end diff --git a/src/b-splines/prefiltering.jl b/src/b-splines/prefiltering.jl index b485f496..1dc58419 100644 --- a/src/b-splines/prefiltering.jl +++ b/src/b-splines/prefiltering.jl @@ -20,12 +20,7 @@ end padded_similar(::Type{TC}, inds::Tuple{Vararg{Base.OneTo{Int}}}) where TC = Array{TC}(undef, length.(inds)) padded_similar(::Type{TC}, inds) where TC = OffsetArray{TC}(undef, inds) -# despite Compat, julia doesn't support 0.6 copy! with CartesianIndices argument -@static if isdefined(Base, :CartesianIndices) - ct!(coefs, indscp, A, indsA) = copyto!(coefs, CartesianIndices(indscp), A, CartesianIndices(indsA)) -else - ct!(coefs, indscp, A, indsA) = copyto!(coefs, CartesianRange(indscp), A, CartesianRange(indsA)) -end +ct!(coefs, indscp, A, indsA) = copyto!(coefs, CartesianIndices(indscp), A, CartesianIndices(indsA)) copy_with_padding(A, ::Type{IT}) where {IT} = copy_with_padding(eltype(A), A, IT) function copy_with_padding(::Type{TC}, A, ::Type{IT}) where {TC,IT<:DimSpec{InterpolationType}} diff --git a/test/b-splines/constant.jl b/test/b-splines/constant.jl index 6daecbb9..4a673a75 100644 --- a/test/b-splines/constant.jl +++ b/test/b-splines/constant.jl @@ -1,7 +1,7 @@ module ConstantTests using Interpolations -using Compat.Test +using Test # Instantiation N1 = 10 diff --git a/test/b-splines/cubic.jl b/test/b-splines/cubic.jl index e2f2b086..436417b6 100644 --- a/test/b-splines/cubic.jl +++ b/test/b-splines/cubic.jl @@ -1,6 +1,6 @@ module CubicTests -using Compat.Test +using Test using Interpolations for (constructor, copier) in ((interpolate, identity), (interpolate!, copy)) @@ -55,8 +55,7 @@ end module CubicGradientTests -using Interpolations, Compat.Test, Compat.LinearAlgebra -using Compat: range +using Interpolations, Test, LinearAlgebra ix = 1:15 f(x) = cos((x-1)*2pi/(length(ix)-1)) @@ -71,16 +70,16 @@ for (constructor, copier) in ((interpolate, identity), (interpolate!, copy)) itp = constructor(copier(A), BSpline(Cubic(BC())), GT()) # test that inner region is close to data for x in range(ix[5], stop=ix[end-4], length=100) - @test ≈(g(x),(gradient(itp,x))[1],atol=cbrt(cbrt(eps(g(x))))) + @test ≈(g(x),(Interpolations.gradient(itp,x))[1],atol=cbrt(cbrt(eps(g(x))))) end end end itp_flat_g = interpolate(A, BSpline(Cubic(Flat())), OnGrid()) -@test ≈((gradient(itp_flat_g,1))[1],0,atol=eps()) -@test ≈((gradient(itp_flat_g,ix[end]))[1],0,atol=eps()) +@test ≈((Interpolations.gradient(itp_flat_g,1))[1],0,atol=eps()) +@test ≈((Interpolations.gradient(itp_flat_g,ix[end]))[1],0,atol=eps()) itp_flat_c = interpolate(A, BSpline(Cubic(Flat())), OnCell()) -@test ≈((gradient(itp_flat_c,0.5))[1],0,atol=eps()) -@test ≈((gradient(itp_flat_c,ix[end] + 0.5))[1],0,atol=eps()) +@test ≈((Interpolations.gradient(itp_flat_c,0.5))[1],0,atol=eps()) +@test ≈((Interpolations.gradient(itp_flat_c,ix[end] + 0.5))[1],0,atol=eps()) end diff --git a/test/b-splines/function-call-syntax.jl b/test/b-splines/function-call-syntax.jl index 5f553b7f..153d9b18 100644 --- a/test/b-splines/function-call-syntax.jl +++ b/test/b-splines/function-call-syntax.jl @@ -1,7 +1,6 @@ module ExtrapFunctionCallSyntax -using Compat.Test, Interpolations, DualNumbers -using Compat: range +using Test, Interpolations, DualNumbers # Test if b-spline interpolation by function syntax yields identical results f(x) = sin((x-3)*2pi/9 - 1) diff --git a/test/b-splines/linear.jl b/test/b-splines/linear.jl index f1e1b5ec..e0d32838 100644 --- a/test/b-splines/linear.jl +++ b/test/b-splines/linear.jl @@ -1,7 +1,7 @@ module LinearTests using Interpolations -using Compat.Test +using Test xmax = 10 g1(x) = sin((x-3)*2pi/(xmax-1)-1) diff --git a/test/b-splines/mixed.jl b/test/b-splines/mixed.jl index 2e9a3325..cfd312f9 100644 --- a/test/b-splines/mixed.jl +++ b/test/b-splines/mixed.jl @@ -1,6 +1,6 @@ module MixedTests -using Interpolations, Compat, Compat.Test, Compat.SharedArrays, Compat.Random +using Interpolations, Test, SharedArrays, Random N = 10 diff --git a/test/b-splines/multivalued.jl b/test/b-splines/multivalued.jl index 55400472..04bdac5b 100644 --- a/test/b-splines/multivalued.jl +++ b/test/b-splines/multivalued.jl @@ -3,7 +3,6 @@ module NonNumeric # Test interpolation with a multi-valued type using Interpolations -using Compat import Base: +, -, *, / diff --git a/test/b-splines/non1.jl b/test/b-splines/non1.jl index 410bc6c9..901a77ed 100644 --- a/test/b-splines/non1.jl +++ b/test/b-splines/non1.jl @@ -1,7 +1,6 @@ module Non1Tests -using Interpolations, OffsetArrays, AxisAlgorithms, Compat.Test -using Compat: axes +using Interpolations, OffsetArrays, AxisAlgorithms, Test # At present, for a particular type of non-1 array you need to specialize this function function AxisAlgorithms.A_ldiv_B_md!(dest::OffsetArray, F, src::OffsetArray, dim::Integer, b::AbstractVector) diff --git a/test/b-splines/quadratic.jl b/test/b-splines/quadratic.jl index 70214bf3..15954181 100644 --- a/test/b-splines/quadratic.jl +++ b/test/b-splines/quadratic.jl @@ -1,6 +1,6 @@ module QuadraticTests -using Interpolations, Compat.Test +using Interpolations, Test for (constructor, copier) in ((interpolate, x->x), (interpolate!, copy)) f(x) = sin((x-3)*2pi/9 - 1) diff --git a/test/convenience-constructors.jl b/test/convenience-constructors.jl index b7774c60..84fc850d 100644 --- a/test/convenience-constructors.jl +++ b/test/convenience-constructors.jl @@ -1,7 +1,7 @@ module ConvenienceConstructorTests using Interpolations -using Compat.Test +using Test using Base.Cartesian # unit test setup diff --git a/test/extrapolation/function-call-syntax.jl b/test/extrapolation/function-call-syntax.jl index 58810c39..9e3257f6 100644 --- a/test/extrapolation/function-call-syntax.jl +++ b/test/extrapolation/function-call-syntax.jl @@ -1,6 +1,6 @@ module ExtrapFunctionCallSyntax -using Compat.Test, Interpolations, DualNumbers +using Test, Interpolations, DualNumbers # Test if extrapolation by function syntax yields identical results f(x) = sin((x-3)*2pi/9 - 1) diff --git a/test/extrapolation/non1.jl b/test/extrapolation/non1.jl index 79fe7968..7d86d294 100644 --- a/test/extrapolation/non1.jl +++ b/test/extrapolation/non1.jl @@ -1,6 +1,6 @@ module ExtrapNon1 -using Compat.Test, Interpolations, OffsetArrays +using Test, Interpolations, OffsetArrays f(x) = sin((x-3)*2pi/9 - 1) xinds = -3:6 diff --git a/test/extrapolation/runtests.jl b/test/extrapolation/runtests.jl index 6526bf0d..eee37ba1 100644 --- a/test/extrapolation/runtests.jl +++ b/test/extrapolation/runtests.jl @@ -1,8 +1,8 @@ module ExtrapTests -using Compat.Test, DualNumbers +using DualNumbers using Interpolations - +using Test f(x) = sin((x-3)*2pi/9 - 1) xmax = 10 diff --git a/test/extrapolation/type-stability.jl b/test/extrapolation/type-stability.jl index 3345dd99..5ae7e8ee 100644 --- a/test/extrapolation/type-stability.jl +++ b/test/extrapolation/type-stability.jl @@ -1,6 +1,6 @@ module ExtrapTypeStability -using Compat.Test, Interpolations, DualNumbers +using Test, Interpolations, DualNumbers # Test type-stability of 1-dimensional extrapolation f(x) = sin((x-3)*2pi/9 - 1) diff --git a/test/gradient.jl b/test/gradient.jl index a22d2b8c..219144e8 100644 --- a/test/gradient.jl +++ b/test/gradient.jl @@ -1,6 +1,6 @@ module GradientTests -using Compat, Compat.Test, Interpolations, DualNumbers, Compat.LinearAlgebra +using Test, Interpolations, DualNumbers, LinearAlgebra nx = 10 f1(x) = sin((x-3)*2pi/(nx-1) - 1) @@ -13,8 +13,8 @@ itp1 = interpolate(Float64[f1(x) for x in 1:nx-1], g = Array{Float64}(undef, 1) for x in 1:nx - @test gradient(itp1, x)[1] == 0 - @test gradient!(g, itp1, x)[1] == 0 + @test Interpolations.gradient(itp1, x)[1] == 0 + @test Interpolations.gradient!(g, itp1, x)[1] == 0 @test g[1] == 0 end @@ -25,14 +25,14 @@ itp2 = interpolate((1:nx-1,), Float64[f1(x) for x in 1:nx-1], Gridded(Linear())) for itp in (itp1, itp2) for x in 2.5:nx-1.5 - @test ≈(g1(x),(gradient(itp,x))[1],atol=abs(0.1 * g1(x))) - @test ≈(g1(x),(gradient!(g,itp,x))[1],atol=abs(0.1 * g1(x))) + @test ≈(g1(x),(Interpolations.gradient(itp,x))[1],atol=abs(0.1 * g1(x))) + @test ≈(g1(x),(Interpolations.gradient!(g,itp,x))[1],atol=abs(0.1 * g1(x))) @test ≈(g1(x),g[1],atol=abs(0.1 * g1(x))) end for i = 1:10 x = rand()*(nx-2)+1.5 - gtmp = gradient(itp, x)[1] + gtmp = Interpolations.gradient(itp, x)[1] xd = dual(x, 1) @test epsilon(itp[xd]) ≈ gtmp end @@ -44,8 +44,8 @@ itp_grid = interpolate(knots, Float64[f1(x) for x in knots[1]], Gridded(Linear())) for x in 1.5:0.5:nx-1.5 - @test ≈(g1(x),(gradient(itp_grid,x))[1],atol=abs(0.5 * g1(x))) - @test ≈(g1(x),(gradient!(g,itp_grid,x))[1],atol=abs(0.5 * g1(x))) + @test ≈(g1(x),(Interpolations.gradient(itp_grid,x))[1],atol=abs(0.5 * g1(x))) + @test ≈(g1(x),(Interpolations.gradient!(g,itp_grid,x))[1],atol=abs(0.5 * g1(x))) @test ≈(g1(x),g[1],atol=abs(0.5 * g1(x))) end @@ -53,14 +53,14 @@ end itp1 = interpolate(Float64[f1(x) for x in 1:nx-1], BSpline(Quadratic(Periodic())), OnCell()) for x in 2:nx-1 - @test ≈(g1(x),(gradient(itp1,x))[1],atol=abs(0.05 * g1(x))) - @test ≈(g1(x),(gradient!(g,itp1,x))[1],atol=abs(0.05 * g1(x))) + @test ≈(g1(x),(Interpolations.gradient(itp1,x))[1],atol=abs(0.05 * g1(x))) + @test ≈(g1(x),(Interpolations.gradient!(g,itp1,x))[1],atol=abs(0.05 * g1(x))) @test ≈(g1(x),g[1],atol=abs(0.1 * g1(x))) end for i = 1:10 x = rand()*(nx-2)+1.5 - gtmp = gradient(itp1, x)[1] + gtmp = Interpolations.gradient(itp1, x)[1] xd = dual(x, 1) @test epsilon(itp1[xd]) ≈ gtmp end @@ -79,7 +79,7 @@ y = qfunc(xg) iq = interpolate(y, BSpline(Quadratic(Free())), OnCell()) x = 1.8 @test iq[x] ≈ qfunc(x) -@test (gradient(iq,x))[1] ≈ dqfunc(x) +@test (Interpolations.gradient(iq,x))[1] ≈ dqfunc(x) # 2d (biquadratic) p = [(x-1.75)^2 for x = 1:7] @@ -87,14 +87,14 @@ A = p*p' iq = interpolate(A, BSpline(Quadratic(Free())), OnCell()) @test iq[4,4] ≈ (4 - 1.75) ^ 4 @test iq[4,3] ≈ (4 - 1.75) ^ 2 * (3 - 1.75) ^ 2 -g = gradient(iq, 4, 3) +g = Interpolations.gradient(iq, 4, 3) @test g[1] ≈ 2 * (4 - 1.75) * (3 - 1.75) ^ 2 @test g[2] ≈ 2 * (4 - 1.75) ^ 2 * (3 - 1.75) iq = interpolate!(copy(A), BSpline(Quadratic(InPlace())), OnCell()) @test iq[4,4] ≈ (4 - 1.75) ^ 4 @test iq[4,3] ≈ (4 - 1.75) ^ 2 * (3 - 1.75) ^ 2 -g = gradient(iq, 4, 3) +g = Interpolations.gradient(iq, 4, 3) @test ≈(g[1],2 * (4 - 1.75) * (3 - 1.75) ^ 2,atol=0.03) @test ≈(g[2],2 * (4 - 1.75) ^ 2 * (3 - 1.75),atol=0.2) @@ -102,7 +102,7 @@ g = gradient(iq, 4, 3) iq = interpolate!(copy(A), BSpline(Quadratic(InPlaceQ())), OnCell()) @test iq[4,4] ≈ (4 - 1.75) ^ 4 @test iq[4,3] ≈ (4 - 1.75) ^ 2 * (3 - 1.75) ^ 2 -g = gradient(iq, 4, 3) +g = Interpolations.gradient(iq, 4, 3) @test g[1] ≈ 2 * (4 - 1.75) * (3 - 1.75) ^ 2 @test g[2] ≈ 2 * (4 - 1.75) ^ 2 * (3 - 1.75) @@ -119,19 +119,19 @@ for BC in (Flat,Line,Free,Periodic,Reflect,Natural), GT in (OnGrid, OnCell) y = rand()*(nx-2)+1.5 xd = dual(x, 1) yd = dual(y, 1) - gtmp = gradient(itp_a, x, y) + gtmp = Interpolations.gradient(itp_a, x, y) @test length(gtmp) == 2 @test epsilon(itp_a[xd,y]) ≈ gtmp[1] @test epsilon(itp_a[x,yd]) ≈ gtmp[2] - gtmp = gradient(itp_b, x, y) + gtmp = Interpolations.gradient(itp_b, x, y) @test length(gtmp) == 2 @test epsilon(itp_b[xd,y]) ≈ gtmp[1] @test epsilon(itp_b[x,yd]) ≈ gtmp[2] ix, iy = round(Int, x), round(Int, y) - gtmp = gradient(itp_c, ix, y) + gtmp = Interpolations.gradient(itp_c, ix, y) @test length(gtmp) == 1 @test epsilon(itp_c[ix,yd]) ≈ gtmp[1] - gtmp = gradient(itp_d, x, iy) + gtmp = Interpolations.gradient(itp_d, x, iy) @test length(gtmp) == 1 @test epsilon(itp_d[xd,iy]) ≈ gtmp[1] end diff --git a/test/grid.jl b/test/grid.jl index 22af0969..5160efce 100644 --- a/test/grid.jl +++ b/test/grid.jl @@ -1,6 +1,6 @@ module GridTests -using Interpolations, Compat.Test +using Interpolations, Test # On-grid values A = randn(4,10) diff --git a/test/gridded/function-call-syntax.jl b/test/gridded/function-call-syntax.jl index 5cb36b1f..4d62b394 100644 --- a/test/gridded/function-call-syntax.jl +++ b/test/gridded/function-call-syntax.jl @@ -1,7 +1,6 @@ module GriddedFunctionCallSyntax -using Interpolations, Compat.Test -using Compat: range +using Interpolations, Test for D in (Constant, Linear), G in (OnCell, OnGrid) ## 1D diff --git a/test/gridded/gridded.jl b/test/gridded/gridded.jl index 8d1d4c05..0a6826a2 100644 --- a/test/gridded/gridded.jl +++ b/test/gridded/gridded.jl @@ -1,7 +1,6 @@ module LinearTests -using Interpolations, Compat.Test -using Compat: range +using Interpolations, Test for D in (Constant, Linear), G in (OnCell, OnGrid) ## 1D diff --git a/test/gridded/mixed.jl b/test/gridded/mixed.jl index c24047c0..4556c710 100644 --- a/test/gridded/mixed.jl +++ b/test/gridded/mixed.jl @@ -1,7 +1,6 @@ module MixedTests -using Interpolations, Compat.Test -using Compat: range +using Interpolations, Test A = rand(6,5) knots = (collect(range(1, stop=size(A,1), length=size(A,1))),collect(range(1, stop=size(A,2), length=size(A,2)))) diff --git a/test/io.jl b/test/io.jl index 66fba08b..cbd3f6b7 100644 --- a/test/io.jl +++ b/test/io.jl @@ -1,7 +1,7 @@ module IOTests -using Compat.Test using Interpolations +using Test SPACE = " " diff --git a/test/issues/runtests.jl b/test/issues/runtests.jl index 7d7857fa..db21f9d1 100644 --- a/test/issues/runtests.jl +++ b/test/issues/runtests.jl @@ -1,6 +1,6 @@ module Issue34 -using Interpolations, Compat.Test +using Interpolations, Test A = rand(1:20, 100, 100) diff --git a/test/linear.jl b/test/linear.jl index 1ea64310..859e888b 100644 --- a/test/linear.jl +++ b/test/linear.jl @@ -1,6 +1,6 @@ module Linear1DTests println("Testing Linear interpolation in 1D...") -using Interpolations, Compat.Test +using Interpolations, Test f(x) = sin((x-3)*2pi/9 - 1) xmax = 10 diff --git a/test/nointerp.jl b/test/nointerp.jl index 6b9985bf..e6e02476 100644 --- a/test/nointerp.jl +++ b/test/nointerp.jl @@ -1,6 +1,6 @@ module NoInterpTests println("Testing NoInterp...") -using Interpolations, Compat.Test +using Interpolations, Test a = reshape(1:12, 3, 4) ai = interpolate(a, NoInterp(), OnGrid()) diff --git a/test/on-grid.jl b/test/on-grid.jl index 1195d672..e8ea07db 100644 --- a/test/on-grid.jl +++ b/test/on-grid.jl @@ -1,6 +1,6 @@ module OnGridTests -using Interpolations, Compat.Test +using Interpolations, Test nx, ny, nz = 10, 8, 9 xg, yg, zg = 1:nx, 1:ny, 1:nz diff --git a/test/readme-examples.jl b/test/readme-examples.jl index 4ff6fe69..74a41156 100644 --- a/test/readme-examples.jl +++ b/test/readme-examples.jl @@ -1,6 +1,6 @@ module ReadmeExampleTests # verify examples from README.md run -using Interpolations, Compat.Test +using Interpolations, Test ## Bsplines a = randn(5) diff --git a/test/runtests.jl b/test/runtests.jl index 9c747f6b..c9c1798a 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,6 +1,5 @@ module RunTests -using Compat.Test using Interpolations diff --git a/test/scaling/dimspecs.jl b/test/scaling/dimspecs.jl index 2e8ab9b6..54808572 100644 --- a/test/scaling/dimspecs.jl +++ b/test/scaling/dimspecs.jl @@ -1,6 +1,6 @@ module ScalingDimspecTests -using Interpolations, DualNumbers, Compat.Test, Compat.LinearAlgebra +using Interpolations, DualNumbers, Test, LinearAlgebra xs = -pi:(2pi/10):pi-2pi/10 ys = -2:.1:2 @@ -12,7 +12,7 @@ sitp = scale(itp, xs, ys) for (ix,x) in enumerate(xs), (iy,y) in enumerate(ys) @test ≈(sitp[x,y],f(x,y),atol=sqrt(eps(1.0))) - g = gradient(sitp, x, y) + g = Interpolations.gradient(sitp, x, y) fx = epsilon(sitp[dual(x,1), dual(y,0)]) fy = epsilon(sitp[dual(x,0), dual(y,1)]) diff --git a/test/scaling/function-call-syntax.jl b/test/scaling/function-call-syntax.jl index c533c41f..dae55f0e 100644 --- a/test/scaling/function-call-syntax.jl +++ b/test/scaling/function-call-syntax.jl @@ -1,7 +1,6 @@ module ScalingFunctionCallTests -using Interpolations, Compat, Compat.Test -using Compat: range +using Interpolations, Test # Model linear interpolation of y = -3 + .5x by interpolating y=x # and then scaling to the new x range diff --git a/test/scaling/nointerp.jl b/test/scaling/nointerp.jl index db3e2cef..6d0c2091 100644 --- a/test/scaling/nointerp.jl +++ b/test/scaling/nointerp.jl @@ -1,7 +1,6 @@ module ScalingNoInterpTests -using Interpolations, Compat.Test, Compat.LinearAlgebra, Compat.Random -using Compat: range +using Interpolations, Test, LinearAlgebra, Random xs = -pi:2pi/10:pi f1(x) = sin(x) @@ -20,7 +19,7 @@ for (ix,x0) in enumerate(xs[1:end-1]), y0 in ys @test ≈(sitp[x,y],f(x,y),atol=0.05) end -@test length(gradient(sitp, pi/3, 2)) == 1 +@test length(Interpolations.gradient(sitp, pi/3, 2)) == 1 # check for case where initial/middle indices are NoInterp but later ones are <:BSpline isdefined(Random, :seed!) ? Random.seed!(1234) : srand(1234) # `srand` was renamed to `seed!` @@ -34,6 +33,6 @@ itpb = interpolate(zb, (NoInterp(), BSpline(Linear())), OnGrid()) rng = range(1.0, stop=19.0, length=10) sitpa = scale(itpa, rng, 1:10) sitpb = scale(itpb, 1:10, rng) -@test gradient(sitpa, 3.0, 3) == gradient(sitpb, 3, 3.0) +@test Interpolations.gradient(sitpa, 3.0, 3) == Interpolations.gradient(sitpb, 3, 3.0) end diff --git a/test/scaling/scaling.jl b/test/scaling/scaling.jl index ed4488fc..1f1dc44c 100644 --- a/test/scaling/scaling.jl +++ b/test/scaling/scaling.jl @@ -1,7 +1,7 @@ module ScalingTests -using Interpolations, Compat -using Compat.Test, Compat.LinearAlgebra +using Interpolations +using Test, LinearAlgebra # Model linear interpolation of y = -3 + .5x by interpolating y=x # and then scaling to the new x range @@ -39,7 +39,7 @@ itp = interpolate(ys, BSpline(Linear()), OnGrid()) sitp = @inferred scale(itp, xs) for x in -pi:.1:pi - g = @inferred(gradient(sitp, x))[1] + g = @inferred(Interpolations.gradient(sitp, x))[1] @test ≈(cos(x),g,atol=0.05) end diff --git a/test/scaling/withextrap.jl b/test/scaling/withextrap.jl index 86a78ec6..f0df91fa 100644 --- a/test/scaling/withextrap.jl +++ b/test/scaling/withextrap.jl @@ -1,7 +1,6 @@ module ScalingWithExtrapTests -using Interpolations, Compat.Test -using Compat: range +using Interpolations, Test xs = range(-5, stop=5, length=10) ys = map(sin, xs) diff --git a/test/type-instantiation.jl b/test/type-instantiation.jl index 5343c8d7..2c7cae55 100644 --- a/test/type-instantiation.jl +++ b/test/type-instantiation.jl @@ -1,6 +1,6 @@ module TypeInstantiationTests -using Interpolations, Compat.Test +using Interpolations, Test # NO DIMSPECS # tests that we forward types correctly to the instance constructors diff --git a/test/typing.jl b/test/typing.jl index 31dcba5e..39c5343b 100644 --- a/test/typing.jl +++ b/test/typing.jl @@ -1,6 +1,6 @@ module TypingTests -using Interpolations, Compat.Test, Compat.LinearAlgebra +using Interpolations, Test, LinearAlgebra nx = 10 f(x) = convert(Float32, x^3/(nx-1)) @@ -22,10 +22,10 @@ end @test typeof(itp[3.5f0]) == Float32 for x in 3.1:.2:4.3 - @test ≈([g(x)], gradient(itp,x),atol=abs(0.1 * g(x))) + @test ≈([g(x)], Interpolations.gradient(itp,x),atol=abs(0.1 * g(x))) end -@test typeof(gradient(itp, 3.5f0)[1]) == Float32 +@test typeof(Interpolations.gradient(itp, 3.5f0)[1]) == Float32 # Rational element types R = Rational{Int}[x^2//10 for x in 1:10]