🌐 AI搜索 & 代理 主页
Skip to content

Commit a8d7d13

Browse files
jorenhamcharris
authored andcommitted
TYP: Add missing rtol kwarg to linalg.pinv (#29845)
Apparently it was added in 2.0.0, but was missing from the stubs.
1 parent d9f83ec commit a8d7d13

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

numpy/linalg/_linalg.pyi

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ from numpy import (
2828
)
2929
from numpy._core.fromnumeric import matrix_transpose
3030
from numpy._core.numeric import tensordot
31+
from numpy._globals import _NoValueType
3132
from numpy._typing import (
3233
ArrayLike,
3334
DTypeLike,
@@ -308,20 +309,26 @@ def matrix_rank(
308309
@overload
309310
def pinv(
310311
a: _ArrayLikeInt_co,
311-
rcond: _ArrayLikeFloat_co = ...,
312-
hermitian: bool = ...,
312+
rcond: _ArrayLikeFloat_co | None = None,
313+
hermitian: bool = False,
314+
*,
315+
rtol: _ArrayLikeFloat_co | _NoValueType = ...,
313316
) -> NDArray[float64]: ...
314317
@overload
315318
def pinv(
316319
a: _ArrayLikeFloat_co,
317-
rcond: _ArrayLikeFloat_co = ...,
318-
hermitian: bool = ...,
320+
rcond: _ArrayLikeFloat_co | None = None,
321+
hermitian: bool = False,
322+
*,
323+
rtol: _ArrayLikeFloat_co | _NoValueType = ...,
319324
) -> NDArray[floating]: ...
320325
@overload
321326
def pinv(
322327
a: _ArrayLikeComplex_co,
323-
rcond: _ArrayLikeFloat_co = ...,
324-
hermitian: bool = ...,
328+
rcond: _ArrayLikeFloat_co | None = None,
329+
hermitian: bool = False,
330+
*,
331+
rtol: _ArrayLikeFloat_co | _NoValueType = ...,
325332
) -> NDArray[complexfloating]: ...
326333

327334
# TODO: Returns a 2-tuple of scalars for 2D arrays and

0 commit comments

Comments
 (0)