# Struggling to update deprecated Interpolations function

**URL:** <https://discourse.julialang.org/t/struggling-to-update-deprecated-interpolations-function/87431>\
**Category:** General Usage\
**Tags:** question\
**Created:** [September 18, 2022, 11:20am UTC](https://discourse.julialang.org/t/struggling-to-update-deprecated-interpolations-function/87431 "2022-09-18T11:20:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adamhsparks](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adamhsparks/32/23643_2.png) [@adamhsparks](https://discourse.julialang.org/u/adamhsparks)\
**Post date:** [September 18, 2022, 11:20am UTC](https://discourse.julialang.org/t/struggling-to-update-deprecated-interpolations-function/87431/1 "2022-09-18T11:20:50Z")

</div>

I have a small function in my package that interpolates values and I’ve noted that the function I’d been using, `LinearInterpolation(Node, Node, extrapolation_bc=0)`, has been deprecated.

I’m struggling to understand what the proper structure looks like to use the current functionality in Interpolations.

My nodes are both `Vector{Float64}` types, which,

```julia
Interpolations.linear_interpolation(Rc[:, 1], Rc[:, 2], extrapolation_bc=0)

```

does not accept.

For reference, here’s the current version that I’d written that works in the whole of the functionality. [Epicrop.jl/Epicrop.jl at 7724ba1e6bb099099c139d8236348286d47e7b89 · adamhsparks/Epicrop.jl · GitHub](https://github.com/adamhsparks/Epicrop.jl/blob/7724ba1e6bb099099c139d8236348286d47e7b89/src/Epicrop.jl#L268) It’s a very simple way of determining a value between days that is completely linear.

Sorry if I’m unclear, but I’m still mainly learning Julia as a researcher who programs (in R) and am trying to understand what’s going on here.

---

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [September 18, 2022, 11:40am UTC](https://discourse.julialang.org/t/struggling-to-update-deprecated-interpolations-function/87431/2 "2022-09-18T11:40:40Z")

</div>

I think you might need something like this:

```julia
julia> interp = linear_interpolation([.3,.5,.6], [.4,.7,.9]; extrapolation_bc=Line())
3-element extrapolate(interpolate((::Vector{Float64},), ::Vector{Float64}, Gridded(Linear())), Line()) with element type Float64:
 0.4
 0.7
 0.9

julia> interp(.4)
0.55

```

From what I can tell, `extrapolation_bc` determines how to extrapolate values outside the range of the input values. Setting `extrapolation_bc = 0` is not valid.

---

<div class="post-metadata">

**Author:** ![adamhsparks](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adamhsparks/32/23643_2.png) [@adamhsparks](https://discourse.julialang.org/u/adamhsparks)\
**Post date:** [September 20, 2022, 10:40am UTC](https://discourse.julialang.org/t/struggling-to-update-deprecated-interpolations-function/87431/3 "2022-09-20T10:40:17Z")

</div>

Thank you. Yes, indeed this was what I needed.

I had another bug that was throwing me off of this solution when I first investigated it.
