|
2 | 2 | from difflib import get_close_matches |
3 | 3 | from typing import Literal, get_args |
4 | 4 |
|
5 | | -from pytensor.tensor import TensorLike |
| 5 | +from pytensor import Variable |
6 | 6 | from pytensor.tensor.basic import as_tensor_variable, switch |
7 | 7 | from pytensor.tensor.extra_ops import searchsorted |
8 | 8 | from pytensor.tensor.functional import vectorize |
@@ -64,13 +64,13 @@ def _stepwise_mean_interp1d(x, y, x_hat, idx, left_pad, right_pad, extrapolate=T |
64 | 64 |
|
65 | 65 |
|
66 | 66 | def interpolate1d( |
67 | | - x: TensorLike, |
68 | | - y: TensorLike, |
| 67 | + x: Variable, |
| 68 | + y: Variable, |
69 | 69 | method: InterpolationMethod = "linear", |
70 | | - left_pad: TensorLike | None = None, |
71 | | - right_pad: TensorLike | None = None, |
| 70 | + left_pad: Variable | None = None, |
| 71 | + right_pad: Variable | None = None, |
72 | 72 | extrapolate: bool = True, |
73 | | -) -> Callable[[TensorLike], TensorLike]: |
| 73 | +) -> Callable[[Variable], Variable]: |
74 | 74 | """ |
75 | 75 | Create a function to interpolate one-dimensional data. |
76 | 76 |
|
@@ -112,11 +112,11 @@ def interpolate1d( |
112 | 112 | y = y[sort_idx] |
113 | 113 |
|
114 | 114 | if left_pad is None: |
115 | | - left_pad = y[0] |
| 115 | + left_pad = y[0] # type: ignore |
116 | 116 | else: |
117 | 117 | left_pad = as_tensor_variable(left_pad) |
118 | 118 | if right_pad is None: |
119 | | - right_pad = y[-1] |
| 119 | + right_pad = y[-1] # type: ignore |
120 | 120 | else: |
121 | 121 | right_pad = as_tensor_variable(right_pad) |
122 | 122 |
|
|
0 commit comments