MCPcopy
hub / github.com/pydata/xarray / _interp1d

Function _interp1d

xarray/core/missing.py:768–783  ·  view source on GitHub ↗

Core 1D array interpolation routine.

(
    var: Variable,
    x_: list[Variable],
    new_x_: list[Variable],
    func: Interpolator,
    kwargs,
)

Source from the content-addressed store, hash-verified

766
767
768def _interp1d(
769 var: Variable,
770 x_: list[Variable],
771 new_x_: list[Variable],
772 func: Interpolator,
773 kwargs,
774) -> np.ndarray:
775 """Core 1D array interpolation routine."""
776 # x, new_x are tuples of size 1.
777 x, new_x = x_[0], new_x_[0]
778 rslt = func(x.data, var, **kwargs)(ravel(new_x.data))
779 if new_x.ndim > 1:
780 return reshape(rslt.data, (var.shape[:-1] + new_x.shape))
781 if new_x.ndim == 0:
782 return rslt[..., -1]
783 return rslt
784
785
786def _interpnd(

Callers 1

_interpndFunction · 0.85

Calls 3

ravelFunction · 0.90
reshapeFunction · 0.90
funcFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…