# \[ANN\] DataInterpolationsND.jl

**URL:** <https://discourse.julialang.org/t/ann-datainterpolationsnd-jl/130883>\
**Category:** Package Announcements\
**Tags:** interpolations\
**Created:** [July 20, 2025, 6:05pm UTC](https://discourse.julialang.org/t/ann-datainterpolationsnd-jl/130883 "2025-07-20T18:05:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![BdeKoning](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bdekoning/32/214557_2.png) [@BdeKoning](https://discourse.julialang.org/u/BdeKoning)\
**Post date:** [July 20, 2025, 6:05pm UTC](https://discourse.julialang.org/t/ann-datainterpolationsnd-jl/130883/1 "2025-07-20T18:05:27Z")

</div>

I’m happy to announce that DataInterpolationsND.jl has been registered. DataInterpolationsND.jl is a new interpolation package falling under the SciML umbrella. As the name suggests, this package aims to provide similar functionality to DataInterpolations.jl but in an arbitrary number of dimensions.

Given an N dimensional array, this array can be interpolated by choosing n input dimensions which leaves N -n output dimensions (where n = N means scalar output). For some history on the package see [Interpolation of 2d data · Issue #402 · SciML/DataInterpolations.jl](https://github.com/SciML/DataInterpolations.jl/issues/402).

DataInterpolationsND.jl supports efficient, non-allocating multi-point evaluation, either in a Cartesian grid or unstructured set of points, built on top of KernelAbstractions.jl for efficient parallel computing and by caching indices and basis function values where applicable.

Current available interpolation types are:

- Constant
- Linear
- BSpline
- NURBS

As this is a new package, feel free to leave feedback on how this package could be made more useful for your use case.

---

<div class="post-metadata">

**Author:** ![Vitor\_Patricio\_Canta](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vitor_patricio_canta/32/50861_2.png) [@Vitor\_Patricio\_Canta](https://discourse.julialang.org/u/Vitor_Patricio_Canta)\
**Post date:** [July 20, 2025, 9:24pm UTC](https://discourse.julialang.org/t/ann-datainterpolationsnd-jl/130883/2 "2025-07-20T21:24:50Z")

</div>

Thank you very much! I guess I will be using this package. I am curious to know if there is any relationship with the other sciml package Surrogates.jl, which has methods that may also be regarded as interpolation

---

<div class="post-metadata">

**Author:** ![BdeKoning](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bdekoning/32/214557_2.png) [@BdeKoning](https://discourse.julialang.org/u/BdeKoning)\
**Post date:** [July 21, 2025, 5:42am UTC](https://discourse.julialang.org/t/ann-datainterpolationsnd-jl/130883/3 "2025-07-21T05:42:49Z")

</div>

@Vitor_Patricio_Canta thanks for your message! I wasn’t familiar with Surrogates.jl but it looks like a very interesting package. Can you elaborate on the use case you envision?

Currently there’s no relationship between the packages. If I understand correctly, to combine the packages we would have to write methods to fit interpolations to data and efficiently update that fit when new data comes in. And possibly also add methods for analytical optimization using the simple polynomial nature of the interpolations. @ChrisRackauckas thoughts?

---

<div class="post-metadata">

**Author:** ![Vitor\_Patricio\_Canta](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vitor_patricio_canta/32/50861_2.png) [@Vitor\_Patricio\_Canta](https://discourse.julialang.org/u/Vitor_Patricio_Canta)\
**Post date:** [July 21, 2025, 7:53am UTC](https://discourse.julialang.org/t/ann-datainterpolationsnd-jl/130883/4 "2025-07-21T07:53:44Z")

</div>

I would say something like:

`interp = NDInterpolation(u, Surrogates.RadialBasis)`

so that we could use the methods in Surrogates.jl with the same interface.

I will have to read through what you are doing inside NDInterpolation. But look at this excerpt of the documentation in Surrogates:

"

# [Surrogate](https://docs.sciml.ai/Surrogates/stable/surrogate/#Surrogate)

Every surrogate has a different definition depending on the parameters needed. It uses the interface defined in [SurrogatesBase.jl](https://github.com/SciML/SurrogatesBase.jl). In a nutshell, they use:

1. `update!(::AbstractDeterministicSurrogate, x_new, y_new)`
2. `AbstractDeterministicSurrogate(value)`

The first function adds a sample point to the surrogate, thus changing the internal coefficients. The second one calculates the approximation at value.  
"  
I guess it sorts of satifies your requirements, right? 🙂

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [August 9, 2025, 8:26pm UTC](https://discourse.julialang.org/t/ann-datainterpolationsnd-jl/130883/5 "2025-08-09T20:26:42Z")

</div>

NDInterpolations are classical basis interpolations vs Surrogate methods which are more universal operator approaches. NDInterpolations will generally do better for lower dimensional N, like 3, and probably up to like 6? Surrogates’ type of methods are for higher dimensional spaces like N\>10 (though there are some lower dimensional techniques in there). They have very different performance characteristics, but yes in some sense they are related methods.

---

<div class="post-metadata">

**Author:** ![mark.garnett](https://avatars.discourse-cdn.com/v4/letter/m/b9bd4f/32.png) [@mark.garnett](https://discourse.julialang.org/u/mark.garnett)\
**Post date:** [July 10, 2026, 4:20pm UTC](https://discourse.julialang.org/t/ann-datainterpolationsnd-jl/130883/6 "2026-07-10T16:20:04Z")

</div>

What would I need to do in order to add a new interpolation type to DataInterpolationND? I’d like to add pchip interpolation.

Would it be sufficient to just add an `_interpolate!` method here?

> <https://github.com/SciML/DataInterpolationsND.jl/blob/main/src/interpolation_methods.jl>

Is there more too it, especially if I want the partial derivatives to work as well?
