(self, xi, yi, method="linear", fill_value=None, period=None)
| 98 | """ |
| 99 | |
| 100 | def __init__(self, xi, yi, method="linear", fill_value=None, period=None): |
| 101 | if method != "linear": |
| 102 | raise ValueError("only method `linear` is valid for the NumpyInterpolator") |
| 103 | |
| 104 | self.method = method |
| 105 | self.f = np.interp |
| 106 | self.cons_kwargs = {} |
| 107 | self.call_kwargs = {"period": period} |
| 108 | |
| 109 | self._xi = xi |
| 110 | self._yi = yi |
| 111 | |
| 112 | nan = np.nan if yi.dtype.kind != "c" else np.nan + np.nan * 1j |
| 113 | |
| 114 | if fill_value is None: |
| 115 | self._left = nan |
| 116 | self._right = nan |
| 117 | elif isinstance(fill_value, Sequence) and len(fill_value) == 2: |
| 118 | self._left = fill_value[0] |
| 119 | self._right = fill_value[1] |
| 120 | elif is_scalar(fill_value): |
| 121 | self._left = fill_value |
| 122 | self._right = fill_value |
| 123 | else: |
| 124 | raise ValueError(f"{fill_value} is not a valid fill_value") |
| 125 | |
| 126 | def __call__(self, x): |
| 127 | return self.f( |
nothing calls this directly
no test coverage detected