Core 1D array interpolation routine.
(
var: Variable,
x_: list[Variable],
new_x_: list[Variable],
func: Interpolator,
kwargs,
)
| 766 | |
| 767 | |
| 768 | def _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 | |
| 786 | def _interpnd( |