@@ -17,12 +17,12 @@ _Kernel: TypeAlias = Literal[
17
17
"gaussian" ,
18
18
] # fmt: skip
19
19
20
+ _Inexact64T_co = TypeVar ("_Inexact64T_co" , bound = np .float64 | np .complex128 , default = np .float64 , covariant = True )
20
21
_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 )
22
22
23
23
###
24
24
25
- class RBFInterpolator (Generic [_ShapeT_co , _SCT_co ]):
25
+ class RBFInterpolator (Generic [_Inexact64T_co , _ShapeT_co ]):
26
26
y : onp .Array2D [np .float64 ]
27
27
d : onp .Array [_ShapeT_co , np .float64 ]
28
28
d_shape : _ShapeT_co
@@ -35,7 +35,7 @@ class RBFInterpolator(Generic[_ShapeT_co, _SCT_co]):
35
35
36
36
@overload
37
37
def __init__ (
38
- self : RBFInterpolator [tuple [int ], np . float64 ],
38
+ self : RBFInterpolator [np . float64 , tuple [int ]],
39
39
/ ,
40
40
y : onp .ToFloat2D ,
41
41
d : onp .ToFloatStrict1D ,
@@ -47,7 +47,7 @@ class RBFInterpolator(Generic[_ShapeT_co, _SCT_co]):
47
47
) -> None : ...
48
48
@overload
49
49
def __init__ (
50
- self : RBFInterpolator [tuple [int ], np . complex128 ],
50
+ self : RBFInterpolator [np . complex128 , tuple [int ]],
51
51
/ ,
52
52
y : onp .ToFloat2D ,
53
53
d : onp .ToJustComplexStrict1D ,
@@ -59,7 +59,7 @@ class RBFInterpolator(Generic[_ShapeT_co, _SCT_co]):
59
59
) -> None : ...
60
60
@overload
61
61
def __init__ (
62
- self : RBFInterpolator [tuple [int ], Any ],
62
+ self : RBFInterpolator [Any , tuple [int ]],
63
63
/ ,
64
64
y : onp .ToFloat2D ,
65
65
d : onp .ToComplexStrict1D ,
@@ -71,7 +71,7 @@ class RBFInterpolator(Generic[_ShapeT_co, _SCT_co]):
71
71
) -> None : ...
72
72
@overload
73
73
def __init__ (
74
- self : RBFInterpolator [tuple [int , int ], np . float64 ],
74
+ self : RBFInterpolator [np . float64 , tuple [int , int ]],
75
75
/ ,
76
76
y : onp .ToFloat2D ,
77
77
d : onp .ToFloatStrict2D ,
@@ -83,7 +83,7 @@ class RBFInterpolator(Generic[_ShapeT_co, _SCT_co]):
83
83
) -> None : ...
84
84
@overload
85
85
def __init__ (
86
- self : RBFInterpolator [tuple [int , int ], np . complex128 ],
86
+ self : RBFInterpolator [np . complex128 , tuple [int , int ]],
87
87
/ ,
88
88
y : onp .ToFloat2D ,
89
89
d : onp .ToJustComplexStrict2D ,
@@ -95,7 +95,7 @@ class RBFInterpolator(Generic[_ShapeT_co, _SCT_co]):
95
95
) -> None : ...
96
96
@overload
97
97
def __init__ (
98
- self : RBFInterpolator [tuple [int , int ], Any ],
98
+ self : RBFInterpolator [Any , tuple [int , int ]],
99
99
/ ,
100
100
y : onp .ToFloat2D ,
101
101
d : onp .ToComplexStrict2D ,
@@ -107,7 +107,7 @@ class RBFInterpolator(Generic[_ShapeT_co, _SCT_co]):
107
107
) -> None : ...
108
108
@overload
109
109
def __init__ (
110
- self : RBFInterpolator [tuple [int , int , int ], np . float64 ],
110
+ self : RBFInterpolator [np . float64 , tuple [int , int , int ]],
111
111
/ ,
112
112
y : onp .ToFloat2D ,
113
113
d : onp .ToFloatStrict3D ,
@@ -119,7 +119,7 @@ class RBFInterpolator(Generic[_ShapeT_co, _SCT_co]):
119
119
) -> None : ...
120
120
@overload
121
121
def __init__ (
122
- self : RBFInterpolator [tuple [int , int , int ], np . complex128 ],
122
+ self : RBFInterpolator [np . complex128 , tuple [int , int , int ]],
123
123
/ ,
124
124
y : onp .ToFloat2D ,
125
125
d : onp .ToJustComplexStrict3D ,
@@ -131,7 +131,7 @@ class RBFInterpolator(Generic[_ShapeT_co, _SCT_co]):
131
131
) -> None : ...
132
132
@overload
133
133
def __init__ (
134
- self : RBFInterpolator [tuple [int , int , int ], Any ],
134
+ self : RBFInterpolator [Any , tuple [int , int , int ]],
135
135
/ ,
136
136
y : onp .ToFloat2D ,
137
137
d : onp .ToComplexStrict3D ,
@@ -143,7 +143,7 @@ class RBFInterpolator(Generic[_ShapeT_co, _SCT_co]):
143
143
) -> None : ...
144
144
@overload
145
145
def __init__ (
146
- self : RBFInterpolator [onp . AtLeast1D , np .float64 ],
146
+ self : RBFInterpolator [np .float64 ],
147
147
/ ,
148
148
y : onp .ToFloat2D ,
149
149
d : onp .ToFloatND ,
@@ -155,7 +155,7 @@ class RBFInterpolator(Generic[_ShapeT_co, _SCT_co]):
155
155
) -> None : ...
156
156
@overload
157
157
def __init__ (
158
- self : RBFInterpolator [onp . AtLeast1D , np .complex128 ],
158
+ self : RBFInterpolator [np .complex128 ],
159
159
/ ,
160
160
y : onp .ToFloat2D ,
161
161
d : onp .ToJustComplexND ,
@@ -167,7 +167,7 @@ class RBFInterpolator(Generic[_ShapeT_co, _SCT_co]):
167
167
) -> None : ...
168
168
@overload
169
169
def __init__ (
170
- self : RBFInterpolator [onp . AtLeast1D , Any ],
170
+ self : RBFInterpolator [Any ],
171
171
/ ,
172
172
y : onp .ToFloat2D ,
173
173
d : onp .ToComplexND ,
@@ -179,4 +179,4 @@ class RBFInterpolator(Generic[_ShapeT_co, _SCT_co]):
179
179
) -> None : ...
180
180
181
181
# 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