@@ -47,6 +47,19 @@ YLEN = convert(Integer, floor((YMAX - YMIN)/ΔY) + 1)
4747 @test interp (XMIN + ΔX / 2 ) ≈ f (XMIN + ΔX / 2 ) atol= .1
4848 @test_throws BoundsError interp (XMIN - ΔX / 2 )
4949 @test_throws BoundsError interp (XMAX + ΔX / 2 )
50+
51+ # Check deprecated usage
52+ interp = ConstantInterpolation (xs, A; extrapolation_bc = Throw ()) # using convenience constructor
53+ interp_full = extrapolate (scale (interpolate (A, BSpline (Constant ())), xs), Throw ()) # using full constructor
54+
55+ @test typeof (interp) == typeof (interp_full)
56+ @test interp (XMIN) ≈ f (XMIN)
57+ @test interp (XMAX) ≈ f (XMAX)
58+ @test interp (XMIN + ΔX) ≈ f (XMIN + ΔX)
59+ @test interp (XMAX - ΔX) ≈ f (XMAX - ΔX)
60+ @test interp (XMIN + ΔX / 2 ) ≈ f (XMIN + ΔX / 2 ) atol= .1
61+ @test_throws BoundsError interp (XMIN - ΔX / 2 )
62+ @test_throws BoundsError interp (XMAX + ΔX / 2 )
5063 end
5164
5265 @testset " 1d-regular-grids-cubic" begin
@@ -64,6 +77,19 @@ YLEN = convert(Integer, floor((YMAX - YMIN)/ΔY) + 1)
6477 @test interp (XMIN + ΔX / 2 ) ≈ f (XMIN + ΔX / 2 ) atol= .1
6578 @test_throws BoundsError interp (XMIN - ΔX / 2 )
6679 @test_throws BoundsError interp (XMAX + ΔX / 2 )
80+
81+ # Check deprecated usage
82+ interp = CubicSplineInterpolation (xs, A; extrapolation_bc = Throw ())
83+ interp_full = extrapolate (scale (interpolate (A, BSpline (Cubic (Line (OnGrid ())))), xs), Throw ())
84+
85+ @test typeof (interp) == typeof (interp_full)
86+ @test interp (XMIN) ≈ f (XMIN)
87+ @test interp (XMAX) ≈ f (XMAX)
88+ @test interp (XMIN + ΔX) ≈ f (XMIN + ΔX)
89+ @test interp (XMAX - ΔX) ≈ f (XMAX - ΔX)
90+ @test interp (XMIN + ΔX / 2 ) ≈ f (XMIN + ΔX / 2 ) atol= .1
91+ @test_throws BoundsError interp (XMIN - ΔX / 2 )
92+ @test_throws BoundsError interp (XMAX + ΔX / 2 )
6793 end
6894
6995 @testset " 1d-irregular-grids" begin
@@ -117,6 +143,14 @@ YLEN = convert(Integer, floor((YMAX - YMIN)/ΔY) + 1)
117143 @test typeof (extrap) == typeof (extrap_full)
118144 @test extrap (x_lower) ≈ A[1 ] - ΔA_l
119145 @test extrap (x_higher) ≈ A[end ] + ΔA_h
146+
147+ # Check deprecated usage
148+ extrap = LinearInterpolation (xs, A, extrapolation_bc = Line ())
149+ extrap_full = extrapolate (scale (interpolate (A, BSpline (Linear ())), xs), Line ())
150+
151+ @test typeof (extrap) == typeof (extrap_full)
152+ @test extrap (x_lower) ≈ A[1 ] - ΔA_l
153+ @test extrap (x_higher) ≈ A[end ] + ΔA_h
120154 end
121155end
122156
262296 @test typeof (extrap) == typeof (extrap_full)
263297 @test extrap (x_lower, y_lower) ≈ A[1 , 1 ] - ΔA_l
264298 @test extrap (x_higher, y_higher) ≈ A[end , end ] + ΔA_h
299+
300+ # Check deprecated usage
301+ extrap = LinearInterpolation ((xs, ys), A, extrapolation_bc = (Line (), Flat ()))
302+ extrap_full = extrapolate (scale (interpolate (A, BSpline (Linear ())), xs, ys), (Line (), Flat ()))
303+
304+ @test typeof (extrap) == typeof (extrap_full)
305+ @test extrap (x_lower, y_lower) ≈ A[1 , 1 ] - ΔA_l
306+ @test extrap (x_higher, y_higher) ≈ A[end , end ] + ΔA_h
265307 end
266308
267309 @testset " issue #230" begin # at least, I think this is what issue #230 is really about
0 commit comments