Skip to content

Commit 521f8ec

Browse files
committed
💥 interpolate: consistent RBFInterpolator generic type parameter ordering
1 parent 12e1b1b commit 521f8ec

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

‎scipy-stubs/interpolate/_rbfinterp.pyi

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ _Kernel: TypeAlias = Literal[
1717
"gaussian",
1818
] # fmt: skip
1919

20+
_Inexact64T_co = TypeVar("_Inexact64T_co", bound=np.float64 | np.complex128, default=np.float64, covariant=True)
2021
_ShapeT_co = TypeVar("_ShapeT_co", bound=onp.AtLeast0D, default=onp.AtLeast0D[Any], covariant=True)
21-
_SCT_co = TypeVar("_SCT_co", bound=np.float64 | np.complex128, default=np.float64, covariant=True)
2222

2323
###
2424

25-
class RBFInterpolator(Generic[_ShapeT_co, _SCT_co]):
25+
class RBFInterpolator(Generic[_Inexact64T_co, _ShapeT_co]):
2626
y: onp.Array2D[np.float64]
2727
d: onp.Array[_ShapeT_co, np.float64]
2828
d_shape: _ShapeT_co
@@ -35,7 +35,7 @@ class RBFInterpolator(Generic[_ShapeT_co, _SCT_co]):
3535

3636
@overload
3737
def __init__(
38-
self: RBFInterpolator[tuple[int], np.float64],
38+
self: RBFInterpolator[np.float64, tuple[int]],
3939
/,
4040
y: onp.ToFloat2D,
4141
d: onp.ToFloatStrict1D,
@@ -47,7 +47,7 @@ class RBFInterpolator(Generic[_ShapeT_co, _SCT_co]):
4747
) -> None: ...
4848
@overload
4949
def __init__(
50-
self: RBFInterpolator[tuple[int], np.complex128],
50+
self: RBFInterpolator[np.complex128, tuple[int]],
5151
/,
5252
y: onp.ToFloat2D,
5353
d: onp.ToJustComplexStrict1D,
@@ -59,7 +59,7 @@ class RBFInterpolator(Generic[_ShapeT_co, _SCT_co]):
5959
) -> None: ...
6060
@overload
6161
def __init__(
62-
self: RBFInterpolator[tuple[int], Any],
62+
self: RBFInterpolator[Any, tuple[int]],
6363
/,
6464
y: onp.ToFloat2D,
6565
d: onp.ToComplexStrict1D,
@@ -71,7 +71,7 @@ class RBFInterpolator(Generic[_ShapeT_co, _SCT_co]):
7171
) -> None: ...
7272
@overload
7373
def __init__(
74-
self: RBFInterpolator[tuple[int, int], np.float64],
74+
self: RBFInterpolator[np.float64, tuple[int, int]],
7575
/,
7676
y: onp.ToFloat2D,
7777
d: onp.ToFloatStrict2D,
@@ -83,7 +83,7 @@ class RBFInterpolator(Generic[_ShapeT_co, _SCT_co]):
8383
) -> None: ...
8484
@overload
8585
def __init__(
86-
self: RBFInterpolator[tuple[int, int], np.complex128],
86+
self: RBFInterpolator[np.complex128, tuple[int, int]],
8787
/,
8888
y: onp.ToFloat2D,
8989
d: onp.ToJustComplexStrict2D,
@@ -95,7 +95,7 @@ class RBFInterpolator(Generic[_ShapeT_co, _SCT_co]):
9595
) -> None: ...
9696
@overload
9797
def __init__(
98-
self: RBFInterpolator[tuple[int, int], Any],
98+
self: RBFInterpolator[Any, tuple[int, int]],
9999
/,
100100
y: onp.ToFloat2D,
101101
d: onp.ToComplexStrict2D,
@@ -107,7 +107,7 @@ class RBFInterpolator(Generic[_ShapeT_co, _SCT_co]):
107107
) -> None: ...
108108
@overload
109109
def __init__(
110-
self: RBFInterpolator[tuple[int, int, int], np.float64],
110+
self: RBFInterpolator[np.float64, tuple[int, int, int]],
111111
/,
112112
y: onp.ToFloat2D,
113113
d: onp.ToFloatStrict3D,
@@ -119,7 +119,7 @@ class RBFInterpolator(Generic[_ShapeT_co, _SCT_co]):
119119
) -> None: ...
120120
@overload
121121
def __init__(
122-
self: RBFInterpolator[tuple[int, int, int], np.complex128],
122+
self: RBFInterpolator[np.complex128, tuple[int, int, int]],
123123
/,
124124
y: onp.ToFloat2D,
125125
d: onp.ToJustComplexStrict3D,
@@ -131,7 +131,7 @@ class RBFInterpolator(Generic[_ShapeT_co, _SCT_co]):
131131
) -> None: ...
132132
@overload
133133
def __init__(
134-
self: RBFInterpolator[tuple[int, int, int], Any],
134+
self: RBFInterpolator[Any, tuple[int, int, int]],
135135
/,
136136
y: onp.ToFloat2D,
137137
d: onp.ToComplexStrict3D,
@@ -143,7 +143,7 @@ class RBFInterpolator(Generic[_ShapeT_co, _SCT_co]):
143143
) -> None: ...
144144
@overload
145145
def __init__(
146-
self: RBFInterpolator[onp.AtLeast1D, np.float64],
146+
self: RBFInterpolator[np.float64],
147147
/,
148148
y: onp.ToFloat2D,
149149
d: onp.ToFloatND,
@@ -155,7 +155,7 @@ class RBFInterpolator(Generic[_ShapeT_co, _SCT_co]):
155155
) -> None: ...
156156
@overload
157157
def __init__(
158-
self: RBFInterpolator[onp.AtLeast1D, np.complex128],
158+
self: RBFInterpolator[np.complex128],
159159
/,
160160
y: onp.ToFloat2D,
161161
d: onp.ToJustComplexND,
@@ -167,7 +167,7 @@ class RBFInterpolator(Generic[_ShapeT_co, _SCT_co]):
167167
) -> None: ...
168168
@overload
169169
def __init__(
170-
self: RBFInterpolator[onp.AtLeast1D, Any],
170+
self: RBFInterpolator[Any],
171171
/,
172172
y: onp.ToFloat2D,
173173
d: onp.ToComplexND,
@@ -179,4 +179,4 @@ class RBFInterpolator(Generic[_ShapeT_co, _SCT_co]):
179179
) -> None: ...
180180

181181
# TODO(jorenham): Return `onp.Array[tuple[int, Unpack[_ShapeT_co]], _SCT_co]` once mypy supports it (if ever)
182-
def __call__(self, /, x: onp.ToFloat2D) -> onp.ArrayND[_SCT_co]: ...
182+
def __call__(self, /, x: onp.ToFloat2D) -> onp.ArrayND[_Inexact64T_co]: ...

0 commit comments

Comments
 (0)