Skip to content

Commit 0eba466

Browse files
authored
Merge pull request #247 from numpy/matrixlib-matlib
🏷️ fix stubtest errors in `numpy.mat[rix]lib`
2 parents aeb23f6 + fd14efc commit 0eba466

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

.mypyignore-todo

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ numpy(\..+)?\.floating.as_integer_ratio
88
numpy(\..+)?\.complexfloating.__hash__
99
numpy(\..+)?\.complexfloating.__complex__
1010

11-
numpy(\.matrixlib(\.defmatrix)?|\.matlib)?\.matrix\.__new__
1211
numpy(\.lib\._polynomial_impl|\.matlib)?\.poly1d\.integ
1312

1413
numpy._globals._CopyMode.IF_NEEDED
@@ -78,16 +77,6 @@ numpy.ma.core.mask_rowcols
7877
numpy.ma.extras.MAxisConcatenator.concatenate
7978
numpy.ma.mrecords.fromtextfile
8079

81-
numpy.matlib.f2py
82-
numpy.matlib.typing
83-
numpy.matlib.cdouble
84-
numpy.matlib.hanning
85-
numpy.matlib.in1d
86-
numpy.matlib.split
87-
numpy.matlib.stack
88-
89-
numpy.matrixlib.defmatrix.mat
90-
9180
numpy.polynomial.Chebyshev.basis_name
9281
numpy.polynomial.Hermite.basis_name
9382
numpy.polynomial.HermiteE.basis_name

src/numpy-stubs/matlib.pyi

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ from numpy import ( # noqa: ICN003
9090
c_,
9191
can_cast,
9292
cbrt,
93+
cdouble,
9394
ceil,
9495
char,
9596
character,
@@ -161,6 +162,7 @@ from numpy import ( # noqa: ICN003
161162
expand_dims,
162163
expm1,
163164
extract,
165+
f2py,
164166
fabs,
165167
fft,
166168
fill_diagonal,
@@ -210,6 +212,7 @@ from numpy import ( # noqa: ICN003
210212
greater_equal,
211213
half,
212214
hamming,
215+
hanning,
213216
heaviside,
214217
histogram,
215218
histogram2d,
@@ -221,6 +224,7 @@ from numpy import ( # noqa: ICN003
221224
i0,
222225
iinfo,
223226
imag,
227+
in1d,
224228
index_exp,
225229
indices,
226230
inexact,
@@ -427,9 +431,11 @@ from numpy import ( # noqa: ICN003
427431
sort,
428432
sort_complex,
429433
spacing,
434+
split,
430435
sqrt,
431436
square,
432437
squeeze,
438+
stack,
433439
std,
434440
str_,
435441
strings,
@@ -461,6 +467,7 @@ from numpy import ( # noqa: ICN003
461467
trunc,
462468
typecodes,
463469
typename,
470+
typing, # noqa: ICN001
464471
ubyte,
465472
ufunc,
466473
uint,

src/numpy-stubs/matrixlib/defmatrix.pyi

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class matrix(np.ndarray[_ShapeT_co, _DTypeT_co]):
4848
__array_priority__: ClassVar[float] = 10.0 # pyright: ignore[reportIncompatibleMethodOverride]
4949

5050
#
51-
def __new__(cls, data: ArrayLike, dtype: DTypeLike | None = None, copy: bool = ...) -> Matrix: ...
51+
def __new__(subtype, data: ArrayLike, dtype: DTypeLike | None = None, copy: bool = ...) -> Matrix: ...
5252

5353
#
5454
@overload # type: ignore[override]
@@ -321,5 +321,3 @@ def asmatrix(data: ToBytes_nd, dtype: None = None) -> Matrix[np.bytes_]: ...
321321
def asmatrix(data: ToStr_nd, dtype: None = None) -> Matrix[np.str_]: ...
322322
@overload
323323
def asmatrix(data: ToGeneric_nd, dtype: DTypeLike | None) -> Matrix: ...
324-
325-
mat = asmatrix

0 commit comments

Comments
 (0)