From 2fe7a0d8be198dd63017eedf4f492b22184eef6e Mon Sep 17 00:00:00 2001 From: juvdnbro Date: Fri, 4 Jul 2025 16:33:02 +0200 Subject: [PATCH 1/6] Improved init stubs of sparse arrays with shape as positional argument. --- scipy-stubs/sparse/_bsr.pyi | 47 ++++++++++++- scipy-stubs/sparse/_coo.pyi | 136 +++++++++++++++++++++++++++++++++++- scipy-stubs/sparse/_csc.pyi | 44 ++++++++++++ scipy-stubs/sparse/_csr.pyi | 90 +++++++++++++++++++++++- scipy-stubs/sparse/_dia.pyi | 46 +++++++++++- scipy-stubs/sparse/_lil.pyi | 46 +++++++++++- tests/sparse/test_csr.pyi | 8 +++ 7 files changed, 410 insertions(+), 7 deletions(-) diff --git a/scipy-stubs/sparse/_bsr.pyi b/scipy-stubs/sparse/_bsr.pyi index f285707c..e57b5dbd 100644 --- a/scipy-stubs/sparse/_bsr.pyi +++ b/scipy-stubs/sparse/_bsr.pyi @@ -103,10 +103,53 @@ class bsr_array(_bsr_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G self: bsr_array[np.float64], /, arg1: ToShape2D, - shape: None = None, + shape: ToShape2D | None = None, dtype: None = None, copy: bool = False, - blocksize: tuple[int, int] | None = None, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[bool] + def __init__( + self: bsr_array[np.bool_], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, + dtype: onp.AnyBoolDType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[int] + def __init__( + self: bsr_array[np.int64], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, + dtype: onp.AnyIntDType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[float] + def __init__( + self: bsr_array[np.float64], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, + dtype: onp.AnyFloat64DType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[complex] + def __init__( + self: bsr_array[np.complex128], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, + dtype: onp.AnyComplex128DType | None = None, + copy: bool = False, *, maxprint: int | None = None, ) -> None: ... diff --git a/scipy-stubs/sparse/_coo.pyi b/scipy-stubs/sparse/_coo.pyi index 83db8a44..9270fba1 100644 --- a/scipy-stubs/sparse/_coo.pyi +++ b/scipy-stubs/sparse/_coo.pyi @@ -155,7 +155,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT /, arg1: ToShape1D, shape: ToShape1D | None = None, - dtype: onp.AnyFloat64DType | None = None, + dtype: None = None, copy: bool = False, *, maxprint: int | None = None, @@ -166,12 +166,111 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT /, arg1: ToShape2D, shape: ToShape2D | None = None, - dtype: onp.AnyFloat64DType | None = None, + dtype: None = None, copy: bool = False, *, maxprint: int | None = None, ) -> None: ... @overload # >2-d shape-like, dtype: None + def __init__( + self: coo_array[np.float64, onp.AtLeast3D], + /, + arg1: ToShapeMin3D, + shape: ToShapeMin3D | None = None, + dtype: None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 1-d shape-like, dtype: type[bool] + def __init__( + self: coo_array[np.bool_, tuple[int]], + /, + arg1: ToShape1D, + shape: ToShape1D | None = None, + dtype: onp.AnyBoolDType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[bool] + def __init__( + self: coo_array[np.bool_, tuple[int, int]], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, + dtype: onp.AnyBoolDType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # >2-d shape-like, dtype: type[bool] + def __init__( + self: coo_array[np.bool_, onp.AtLeast3D], + /, + arg1: ToShapeMin3D, + shape: ToShapeMin3D | None = None, + dtype: onp.AnyBoolDType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 1-d shape-like, dtype: type[int] + def __init__( + self: coo_array[np.int64, tuple[int]], + /, + arg1: ToShape1D, + shape: ToShape1D | None = None, + dtype: onp.AnyIntDType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[int] + def __init__( + self: coo_array[np.int64, tuple[int, int]], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, + dtype: onp.AnyIntDType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # >2-d shape-like, dtype: type[int] + def __init__( + self: coo_array[np.int64, onp.AtLeast3D], + /, + arg1: ToShapeMin3D, + shape: ToShapeMin3D | None = None, + dtype: onp.AnyIntDType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 1-d shape-like, dtype: type[float] + def __init__( + self: coo_array[np.float64, tuple[int]], + /, + arg1: ToShape1D, + shape: ToShape1D | None = None, + dtype: onp.AnyFloat64DType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[float] + def __init__( + self: coo_array[np.float64, tuple[int, int]], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, + dtype: onp.AnyFloat64DType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # >2-d shape-like, dtype: type[float] def __init__( self: coo_array[np.float64, onp.AtLeast3D], /, @@ -182,6 +281,39 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... + @overload # 1-d shape-like, dtype: type[complex] + def __init__( + self: coo_array[np.complex128, tuple[int]], + /, + arg1: ToShape1D, + shape: ToShape1D | None = None, + dtype: onp.AnyComplex128DType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[complex] + def __init__( + self: coo_array[np.complex128, tuple[int, int]], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, + dtype: onp.AnyComplex128DType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # >2-d shape-like, dtype: type[complex] + def __init__( + self: coo_array[np.complex128, onp.AtLeast3D], + /, + arg1: ToShapeMin3D, + shape: ToShapeMin3D | None = None, + dtype: onp.AnyComplex64DType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... @overload # vector-like builtins.bool, dtype: type[bool] | None def __init__( self: coo_array[np.bool_, tuple[int]], diff --git a/scipy-stubs/sparse/_csc.pyi b/scipy-stubs/sparse/_csc.pyi index 9b3122ff..58f6c8ae 100644 --- a/scipy-stubs/sparse/_csc.pyi +++ b/scipy-stubs/sparse/_csc.pyi @@ -78,6 +78,39 @@ class csc_array(_csc_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G maxprint: int | None = None, ) -> None: ... @overload # 2-d shape-like, dtype: None + def __init__( + self: csc_array[np.float64], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, + dtype: None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[bool] + def __init__( + self: csc_array[np.bool_], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, + dtype: onp.AnyBoolDType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[int] + def __init__( + self: csc_array[np.int64], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, + dtype: onp.AnyIntDType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[float] def __init__( self: csc_array[np.float64], /, @@ -88,6 +121,17 @@ class csc_array(_csc_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... + @overload # 2-d shape-like, dtype: type[complex] + def __init__( + self: csc_array[np.complex128], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, + dtype: onp.AnyComplex128DType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... @overload # 2-d array-like bool, dtype: type[bool] | None def __init__( self: csc_array[np.bool_], diff --git a/scipy-stubs/sparse/_csr.pyi b/scipy-stubs/sparse/_csr.pyi index 0a24dd0c..c1ada46c 100644 --- a/scipy-stubs/sparse/_csr.pyi +++ b/scipy-stubs/sparse/_csr.pyi @@ -126,12 +126,78 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT /, arg1: ToShape1D, shape: ToShape1D | None = None, - dtype: onp.AnyFloat64DType | None = None, + dtype: None = None, copy: bool = False, *, maxprint: int | None = None, ) -> None: ... @overload # 2-d shape-like, dtype: None + def __init__( + self: csr_array[np.float64, tuple[int, int]], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, + dtype: None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 1-d shape-like, dtype: type[bool] + def __init__( + self: csr_array[np.bool_, tuple[int]], + /, + arg1: ToShape1D, + shape: ToShape1D | None = None, + dtype: onp.AnyBoolDType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[bool] + def __init__( + self: csr_array[np.bool_, tuple[int, int]], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, + dtype: onp.AnyBoolDType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 1-d shape-like, dtype: type[int] + def __init__( + self: csr_array[np.int64, tuple[int]], + /, + arg1: ToShape1D, + shape: ToShape1D | None = None, + dtype: onp.AnyIntDType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[int] + def __init__( + self: csr_array[np.int64, tuple[int, int]], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, + dtype: onp.AnyIntDType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 1-d shape-like, dtype: type[float] + def __init__( + self: csr_array[np.float64, tuple[int]], + /, + arg1: ToShape1D, + shape: ToShape1D | None = None, + dtype: onp.AnyFloat64DType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[float] def __init__( self: csr_array[np.float64, tuple[int, int]], /, @@ -142,6 +208,28 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... + @overload # 1-d shape-like, dtype: type[complex] + def __init__( + self: csr_array[np.complex128, tuple[int]], + /, + arg1: ToShape1D, + shape: ToShape1D | None = None, + dtype: onp.AnyComplex128DType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[complex] + def __init__( + self: csr_array[np.complex128, tuple[int, int]], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, + dtype: onp.AnyComplex128DType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... @overload # 1-d array-like bool, dtype: type[bool] | None def __init__( self: csr_array[np.bool_, tuple[int]], diff --git a/scipy-stubs/sparse/_dia.pyi b/scipy-stubs/sparse/_dia.pyi index 6bc45968..2d411ede 100644 --- a/scipy-stubs/sparse/_dia.pyi +++ b/scipy-stubs/sparse/_dia.pyi @@ -87,12 +87,56 @@ class dia_array(_dia_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G self: dia_array[np.float64], /, arg1: ToShape2D, - shape: None = None, + shape: ToShape2D | None = None, dtype: None = None, copy: bool = False, *, maxprint: int | None = None, ) -> None: ... + @overload # 2-d shape-like, dtype: type[bool] + def __init__( + self: dia_array[np.bool_], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, + dtype: onp.AnyBoolDType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[int] + def __init__( + self: dia_array[np.int64], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, + dtype: onp.AnyIntDType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[float] + def __init__( + self: dia_array[np.float64], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, + dtype: onp.AnyFloat64DType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[complex] + def __init__( + self: dia_array[np.complex128], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, + dtype: onp.AnyComplex128DType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... @overload # matrix-like builtins.bool, dtype: type[bool] | None def __init__( self: dia_array[np.bool_], diff --git a/scipy-stubs/sparse/_lil.pyi b/scipy-stubs/sparse/_lil.pyi index 671f79df..1a8e6923 100644 --- a/scipy-stubs/sparse/_lil.pyi +++ b/scipy-stubs/sparse/_lil.pyi @@ -108,12 +108,56 @@ class lil_array(_lil_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G self: lil_array[np.float64], /, arg1: ToShape2D, - shape: None = None, + shape: ToShape2D | None = None, + dtype: None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[bool] + def __init__( + self: lil_array[np.bool_], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, + dtype: onp.AnyBoolDType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[int] + def __init__( + self: lil_array[np.int64], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, + dtype: onp.AnyIntDType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[float] + def __init__( + self: lil_array[np.float64], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, dtype: onp.AnyFloat64DType | None = None, copy: bool = False, *, maxprint: int | None = None, ) -> None: ... + @overload # 2-d shape-like, dtype: type[complex] + def __init__( + self: lil_array[np.complex128], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, + dtype: onp.AnyComplex128DType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... @overload # matrix-like builtins.bool, dtype: type[bool] | None def __init__( self: lil_array[np.bool_], diff --git a/tests/sparse/test_csr.pyi b/tests/sparse/test_csr.pyi index 9e38a930..aae2ccd6 100644 --- a/tests/sparse/test_csr.pyi +++ b/tests/sparse/test_csr.pyi @@ -25,6 +25,14 @@ csr_matrix(1) # type: ignore[call-overload] # pyright: ignore[reportArgumentTy assert_type(csr_array((2,)), csr_array[np.float64, tuple[int]]) assert_type(csr_array((2, 3)), csr_array[np.float64, tuple[int, int]]) +assert_type(csr_array((2,), dtype=np.bool_), csr_array[np.bool_, tuple[int]]) +assert_type(csr_array((2, 3), dtype=np.bool_), csr_array[np.bool_, tuple[int, int]]) +assert_type(csr_array((2,), dtype=np.int64), csr_array[np.int64, tuple[int]]) +assert_type(csr_array((2, 3), dtype=np.int64), csr_array[np.int64, tuple[int, int]]) +assert_type(csr_array((2,), dtype=np.float64), csr_array[np.float64, tuple[int]]) +assert_type(csr_array((2, 3), dtype=np.float64), csr_array[np.float64, tuple[int, int]]) +assert_type(csr_array((2,), dtype=np.complex128), csr_array[np.complex128, tuple[int]]) +assert_type(csr_array((2, 3), dtype=np.complex128), csr_array[np.complex128, tuple[int, int]]) assert_type(csr_matrix((2, 3)), csr_matrix[np.float64]) assert_type(csr_array(seq_bool), csr_array[np.bool_, tuple[int]]) From 0ec144283422596e1f3f9e4b1f5900f6d27757b6 Mon Sep 17 00:00:00 2001 From: juvdnbro Date: Sat, 5 Jul 2025 09:59:18 +0200 Subject: [PATCH 2/6] Added DOK stubs + merged dtype=None and dtype=np.float64 cases --- scipy-stubs/sparse/_bsr.pyi | 17 ++------- scipy-stubs/sparse/_coo.pyi | 45 ++++-------------------- scipy-stubs/sparse/_csc.pyi | 15 ++------ scipy-stubs/sparse/_csr.pyi | 30 +++------------- scipy-stubs/sparse/_dia.pyi | 15 ++------ scipy-stubs/sparse/_dok.pyi | 70 +++++++++++++++++++++++++++++++++++-- scipy-stubs/sparse/_lil.pyi | 15 ++------ 7 files changed, 87 insertions(+), 120 deletions(-) diff --git a/scipy-stubs/sparse/_bsr.pyi b/scipy-stubs/sparse/_bsr.pyi index e57b5dbd..e65f1f54 100644 --- a/scipy-stubs/sparse/_bsr.pyi +++ b/scipy-stubs/sparse/_bsr.pyi @@ -98,18 +98,18 @@ class bsr_array(_bsr_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: None + @overload # 2-d shape-like, dtype: type[float] | None def __init__( self: bsr_array[np.float64], /, arg1: ToShape2D, shape: ToShape2D | None = None, - dtype: None = None, + dtype: onp.AnyFloat64DType | None = None, copy: bool = False, *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[bool] + @overload # 2-d shape-like, dtype: type[bool] | None def __init__( self: bsr_array[np.bool_], /, @@ -131,17 +131,6 @@ class bsr_array(_bsr_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[float] - def __init__( - self: bsr_array[np.float64], - /, - arg1: ToShape2D, - shape: ToShape2D | None = None, - dtype: onp.AnyFloat64DType | None = None, - copy: bool = False, - *, - maxprint: int | None = None, - ) -> None: ... @overload # 2-d shape-like, dtype: type[complex] def __init__( self: bsr_array[np.complex128], diff --git a/scipy-stubs/sparse/_coo.pyi b/scipy-stubs/sparse/_coo.pyi index 9270fba1..81e53421 100644 --- a/scipy-stubs/sparse/_coo.pyi +++ b/scipy-stubs/sparse/_coo.pyi @@ -149,35 +149,35 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: None + @overload # 1-d shape-like, dtype: type[float] | None def __init__( self: coo_array[np.float64, tuple[int]], /, arg1: ToShape1D, shape: ToShape1D | None = None, - dtype: None = None, + dtype: onp.AnyFloat64DType | None = None, copy: bool = False, *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: None + @overload # 2-d shape-like, dtype: type[float] | None def __init__( self: coo_array[np.float64, tuple[int, int]], /, arg1: ToShape2D, shape: ToShape2D | None = None, - dtype: None = None, + dtype: onp.AnyFloat64DType | None = None, copy: bool = False, *, maxprint: int | None = None, ) -> None: ... - @overload # >2-d shape-like, dtype: None + @overload # >2-d shape-like, dtype: type[float] def __init__( self: coo_array[np.float64, onp.AtLeast3D], /, arg1: ToShapeMin3D, shape: ToShapeMin3D | None = None, - dtype: None = None, + dtype: onp.AnyFloat64DType | None = None, copy: bool = False, *, maxprint: int | None = None, @@ -248,39 +248,6 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[float] - def __init__( - self: coo_array[np.float64, tuple[int]], - /, - arg1: ToShape1D, - shape: ToShape1D | None = None, - dtype: onp.AnyFloat64DType | None = None, - copy: bool = False, - *, - maxprint: int | None = None, - ) -> None: ... - @overload # 2-d shape-like, dtype: type[float] - def __init__( - self: coo_array[np.float64, tuple[int, int]], - /, - arg1: ToShape2D, - shape: ToShape2D | None = None, - dtype: onp.AnyFloat64DType | None = None, - copy: bool = False, - *, - maxprint: int | None = None, - ) -> None: ... - @overload # >2-d shape-like, dtype: type[float] - def __init__( - self: coo_array[np.float64, onp.AtLeast3D], - /, - arg1: ToShapeMin3D, - shape: ToShapeMin3D | None = None, - dtype: onp.AnyFloat64DType | None = None, - copy: bool = False, - *, - maxprint: int | None = None, - ) -> None: ... @overload # 1-d shape-like, dtype: type[complex] def __init__( self: coo_array[np.complex128, tuple[int]], diff --git a/scipy-stubs/sparse/_csc.pyi b/scipy-stubs/sparse/_csc.pyi index 58f6c8ae..46e3b8fa 100644 --- a/scipy-stubs/sparse/_csc.pyi +++ b/scipy-stubs/sparse/_csc.pyi @@ -77,13 +77,13 @@ class csc_array(_csc_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: None + @overload # 2-d shape-like, dtype: type[float] | None def __init__( self: csc_array[np.float64], /, arg1: ToShape2D, shape: ToShape2D | None = None, - dtype: None = None, + dtype: onp.AnyFloat64DType | None = None, copy: bool = False, *, maxprint: int | None = None, @@ -110,17 +110,6 @@ class csc_array(_csc_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[float] - def __init__( - self: csc_array[np.float64], - /, - arg1: ToShape2D, - shape: ToShape2D | None = None, - dtype: onp.AnyFloat64DType | None = None, - copy: bool = False, - *, - maxprint: int | None = None, - ) -> None: ... @overload # 2-d shape-like, dtype: type[complex] def __init__( self: csc_array[np.complex128], diff --git a/scipy-stubs/sparse/_csr.pyi b/scipy-stubs/sparse/_csr.pyi index c1ada46c..bd8a93f3 100644 --- a/scipy-stubs/sparse/_csr.pyi +++ b/scipy-stubs/sparse/_csr.pyi @@ -120,24 +120,24 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: None + @overload # 1-d shape-like, dtype: type[float] | None def __init__( self: csr_array[np.float64, tuple[int]], /, arg1: ToShape1D, shape: ToShape1D | None = None, - dtype: None = None, + dtype: onp.AnyFloat64DType | None = None, copy: bool = False, *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: None + @overload # 2-d shape-like, dtype: type[float] | None def __init__( self: csr_array[np.float64, tuple[int, int]], /, arg1: ToShape2D, shape: ToShape2D | None = None, - dtype: None = None, + dtype: onp.AnyFloat64DType | None = None, copy: bool = False, *, maxprint: int | None = None, @@ -186,28 +186,6 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[float] - def __init__( - self: csr_array[np.float64, tuple[int]], - /, - arg1: ToShape1D, - shape: ToShape1D | None = None, - dtype: onp.AnyFloat64DType | None = None, - copy: bool = False, - *, - maxprint: int | None = None, - ) -> None: ... - @overload # 2-d shape-like, dtype: type[float] - def __init__( - self: csr_array[np.float64, tuple[int, int]], - /, - arg1: ToShape2D, - shape: ToShape2D | None = None, - dtype: onp.AnyFloat64DType | None = None, - copy: bool = False, - *, - maxprint: int | None = None, - ) -> None: ... @overload # 1-d shape-like, dtype: type[complex] def __init__( self: csr_array[np.complex128, tuple[int]], diff --git a/scipy-stubs/sparse/_dia.pyi b/scipy-stubs/sparse/_dia.pyi index 2d411ede..35b9ffd9 100644 --- a/scipy-stubs/sparse/_dia.pyi +++ b/scipy-stubs/sparse/_dia.pyi @@ -82,13 +82,13 @@ class dia_array(_dia_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: None + @overload # 2-d shape-like, dtype: type[float] | None def __init__( self: dia_array[np.float64], /, arg1: ToShape2D, shape: ToShape2D | None = None, - dtype: None = None, + dtype: onp.AnyFloat64DType | None = None, copy: bool = False, *, maxprint: int | None = None, @@ -115,17 +115,6 @@ class dia_array(_dia_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[float] - def __init__( - self: dia_array[np.float64], - /, - arg1: ToShape2D, - shape: ToShape2D | None = None, - dtype: onp.AnyFloat64DType | None = None, - copy: bool = False, - *, - maxprint: int | None = None, - ) -> None: ... @overload # 2-d shape-like, dtype: type[complex] def __init__( self: dia_array[np.complex128], diff --git a/scipy-stubs/sparse/_dok.pyi b/scipy-stubs/sparse/_dok.pyi index 1a703c7b..b924b409 100644 --- a/scipy-stubs/sparse/_dok.pyi +++ b/scipy-stubs/sparse/_dok.pyi @@ -212,7 +212,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: None + @overload # 1-d shape-like, dtype: type[float] | None def __init__( self: dok_array[np.float64, _1D], /, @@ -223,7 +223,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: None + @overload # 2-d shape-like, dtype: type[float] | None def __init__( self: dok_array[np.float64, _2D], /, @@ -234,6 +234,72 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... + @overload # 1-d shape-like, dtype: type[bool] + def __init__( + self: dok_array[np.bool_, _1D], + /, + arg1: ToShape1D, + shape: ToShape1D | None = None, + dtype: onp.AnyBoolDType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[bool] + def __init__( + self: dok_array[np.bool_, _2D], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, + dtype: onp.AnyBoolDType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 1-d shape-like, dtype: type[int] + def __init__( + self: dok_array[np.int64, _1D], + /, + arg1: ToShape1D, + shape: ToShape1D | None = None, + dtype: onp.AnyIntDType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[int] + def __init__( + self: dok_array[np.int64, _2D], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, + dtype: onp.AnyIntDType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 1-d shape-like, dtype: type[complex] + def __init__( + self: dok_array[np.complex128, _1D], + /, + arg1: ToShape1D, + shape: ToShape1D | None = None, + dtype: onp.AnyComplex128DType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[complex] + def __init__( + self: dok_array[np.complex128, _2D], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, + dtype: onp.AnyComplex128DType | None = None, + copy: bool = False, + *, + maxprint: int | None = None, + ) -> None: ... @overload # 1-d array-like bool, dtype: type[bool] | None def __init__( self: dok_array[np.bool_, _1D], diff --git a/scipy-stubs/sparse/_lil.pyi b/scipy-stubs/sparse/_lil.pyi index 1a8e6923..d62f5e98 100644 --- a/scipy-stubs/sparse/_lil.pyi +++ b/scipy-stubs/sparse/_lil.pyi @@ -103,13 +103,13 @@ class lil_array(_lil_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: None + @overload # 2-d shape-like, dtype: type[float] | None def __init__( self: lil_array[np.float64], /, arg1: ToShape2D, shape: ToShape2D | None = None, - dtype: None = None, + dtype: onp.AnyFloat64DType | None = None, copy: bool = False, *, maxprint: int | None = None, @@ -136,17 +136,6 @@ class lil_array(_lil_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[float] - def __init__( - self: lil_array[np.float64], - /, - arg1: ToShape2D, - shape: ToShape2D | None = None, - dtype: onp.AnyFloat64DType | None = None, - copy: bool = False, - *, - maxprint: int | None = None, - ) -> None: ... @overload # 2-d shape-like, dtype: type[complex] def __init__( self: lil_array[np.complex128], From b3d1ee071265199f9a78bb770c355756f0560806 Mon Sep 17 00:00:00 2001 From: juvdnbro Date: Sat, 5 Jul 2025 10:21:30 +0200 Subject: [PATCH 3/6] Added more test cases for CSR --- tests/sparse/test_csr.pyi | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/sparse/test_csr.pyi b/tests/sparse/test_csr.pyi index aae2ccd6..6e6f8130 100644 --- a/tests/sparse/test_csr.pyi +++ b/tests/sparse/test_csr.pyi @@ -27,12 +27,38 @@ assert_type(csr_array((2,)), csr_array[np.float64, tuple[int]]) assert_type(csr_array((2, 3)), csr_array[np.float64, tuple[int, int]]) assert_type(csr_array((2,), dtype=np.bool_), csr_array[np.bool_, tuple[int]]) assert_type(csr_array((2, 3), dtype=np.bool_), csr_array[np.bool_, tuple[int, int]]) +assert_type(csr_array((2,), dtype=bool), csr_array[np.bool_, tuple[int]]) +assert_type(csr_array((2, 3), dtype=bool), csr_array[np.bool_, tuple[int, int]]) +assert_type(csr_array((2,), dtype="bool"), csr_array[np.bool_, tuple[int]]) +assert_type(csr_array((2, 3), dtype="bool"), csr_array[np.bool_, tuple[int, int]]) assert_type(csr_array((2,), dtype=np.int64), csr_array[np.int64, tuple[int]]) assert_type(csr_array((2, 3), dtype=np.int64), csr_array[np.int64, tuple[int, int]]) +assert_type(csr_array((2,), dtype=int), csr_array[np.int64, tuple[int]]) +assert_type(csr_array((2, 3), dtype=int), csr_array[np.int64, tuple[int, int]]) +assert_type(csr_array((2,), dtype="int"), csr_array[np.int64, tuple[int]]) +assert_type(csr_array((2, 3), dtype="int"), csr_array[np.int64, tuple[int, int]]) assert_type(csr_array((2,), dtype=np.float64), csr_array[np.float64, tuple[int]]) assert_type(csr_array((2, 3), dtype=np.float64), csr_array[np.float64, tuple[int, int]]) +assert_type(csr_array((2,), dtype=float), csr_array[np.float64, tuple[int]]) +assert_type(csr_array((2, 3), dtype=float), csr_array[np.float64, tuple[int, int]]) +assert_type(csr_array((2,), dtype="float"), csr_array[np.float64, tuple[int]]) +assert_type(csr_array((2, 3), dtype="float"), csr_array[np.float64, tuple[int, int]]) assert_type(csr_array((2,), dtype=np.complex128), csr_array[np.complex128, tuple[int]]) assert_type(csr_array((2, 3), dtype=np.complex128), csr_array[np.complex128, tuple[int, int]]) +assert_type(csr_array((2,), dtype=complex), csr_array[np.complex128, tuple[int]]) +assert_type(csr_array((2, 3), dtype=complex), csr_array[np.complex128, tuple[int, int]]) +assert_type(csr_array((2,), dtype="complex"), csr_array[np.complex128, tuple[int]]) +assert_type(csr_array((2, 3), dtype="complex"), csr_array[np.complex128, tuple[int, int]]) +assert_type(csr_array((2,), None, None), csr_array[np.float64, tuple[int]]) +assert_type(csr_array((2, 3), None, None), csr_array[np.float64, tuple[int, int]]) +assert_type(csr_array((2,), None, np.bool_), csr_array[np.bool_, tuple[int]]) +assert_type(csr_array((2, 3), None, np.bool_), csr_array[np.bool_, tuple[int, int]]) +assert_type(csr_array((2,), None, np.int64), csr_array[np.int64, tuple[int]]) +assert_type(csr_array((2, 3), None, np.int64), csr_array[np.int64, tuple[int, int]]) +assert_type(csr_array((2,), None, np.float64), csr_array[np.float64, tuple[int]]) +assert_type(csr_array((2, 3), None, np.float64), csr_array[np.float64, tuple[int, int]]) +assert_type(csr_array((2,), None, np.complex128), csr_array[np.complex128, tuple[int]]) +assert_type(csr_array((2, 3), None, np.complex128), csr_array[np.complex128, tuple[int, int]]) assert_type(csr_matrix((2, 3)), csr_matrix[np.float64]) assert_type(csr_array(seq_bool), csr_array[np.bool_, tuple[int]]) From f2d57e8635f6816549f10025c157cc8e02d8171c Mon Sep 17 00:00:00 2001 From: juvdnbro Date: Sun, 6 Jul 2025 15:16:00 +0200 Subject: [PATCH 4/6] Fixed constructor stubs for positional and keyword dtypes (other than np.float64) --- scipy-stubs/sparse/_bsr.pyi | 48 +++++++++--- scipy-stubs/sparse/_coo.pyi | 146 +++++++++++++++++++++++++++++------- scipy-stubs/sparse/_csc.pyi | 48 +++++++++--- scipy-stubs/sparse/_csr.pyi | 96 +++++++++++++++++++----- scipy-stubs/sparse/_dia.pyi | 48 +++++++++--- scipy-stubs/sparse/_dok.pyi | 96 +++++++++++++++++++----- scipy-stubs/sparse/_lil.pyi | 48 +++++++++--- 7 files changed, 430 insertions(+), 100 deletions(-) diff --git a/scipy-stubs/sparse/_bsr.pyi b/scipy-stubs/sparse/_bsr.pyi index e65f1f54..491176cb 100644 --- a/scipy-stubs/sparse/_bsr.pyi +++ b/scipy-stubs/sparse/_bsr.pyi @@ -109,37 +109,67 @@ class bsr_array(_bsr_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[bool] | None + @overload # 2-d shape-like, dtype: type[bool] (positional) def __init__( self: bsr_array[np.bool_], /, arg1: ToShape2D, - shape: ToShape2D | None = None, - dtype: onp.AnyBoolDType | None = None, + shape: ToShape2D | None, + dtype: onp.AnyBoolDType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[bool] (keyword) + def __init__( + self: bsr_array[np.bool_], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, *, + dtype: onp.AnyBoolDType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[int] + @overload # 2-d shape-like, dtype: type[int] (positional) def __init__( self: bsr_array[np.int64], /, arg1: ToShape2D, - shape: ToShape2D | None = None, - dtype: onp.AnyIntDType | None = None, + shape: ToShape2D | None, + dtype: onp.AnyIntDType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[int] (keyword) + def __init__( + self: bsr_array[np.int64], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, *, + dtype: onp.AnyIntDType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[complex] + @overload # 2-d shape-like, dtype: type[complex] (positional) def __init__( self: bsr_array[np.complex128], /, arg1: ToShape2D, - shape: ToShape2D | None = None, - dtype: onp.AnyComplex128DType | None = None, + shape: ToShape2D | None, + dtype: onp.AnyComplex128DType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[complex] (keyword) + def __init__( + self: bsr_array[np.complex128], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, *, + dtype: onp.AnyComplex128DType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... @overload # matrix-like builtins.bool, dtype: type[bool] | None diff --git a/scipy-stubs/sparse/_coo.pyi b/scipy-stubs/sparse/_coo.pyi index 81e53421..2c9628ed 100644 --- a/scipy-stubs/sparse/_coo.pyi +++ b/scipy-stubs/sparse/_coo.pyi @@ -171,7 +171,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # >2-d shape-like, dtype: type[float] + @overload # >2-d shape-like, dtype: type[float] | None def __init__( self: coo_array[np.float64, onp.AtLeast3D], /, @@ -182,103 +182,193 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[bool] + @overload # 1-d shape-like, dtype: type[bool] (positional) def __init__( self: coo_array[np.bool_, tuple[int]], /, arg1: ToShape1D, - shape: ToShape1D | None = None, - dtype: onp.AnyBoolDType | None = None, + shape: ToShape1D | None, + dtype: onp.AnyBoolDType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 1-d shape-like, dtype: type[bool] (keyword) + def __init__( + self: coo_array[np.bool_, tuple[int]], + /, + arg1: ToShape1D, + shape: ToShape1D | None = None, *, + dtype: onp.AnyBoolDType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[bool] + @overload # 2-d shape-like, dtype: type[bool] (positional) def __init__( self: coo_array[np.bool_, tuple[int, int]], /, arg1: ToShape2D, - shape: ToShape2D | None = None, - dtype: onp.AnyBoolDType | None = None, + shape: ToShape2D | None, + dtype: onp.AnyBoolDType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[bool] (keyword) + def __init__( + self: coo_array[np.bool_, tuple[int, int]], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, *, + dtype: onp.AnyBoolDType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # >2-d shape-like, dtype: type[bool] + @overload # >2-d shape-like, dtype: type[bool] (positional) def __init__( self: coo_array[np.bool_, onp.AtLeast3D], /, arg1: ToShapeMin3D, - shape: ToShapeMin3D | None = None, - dtype: onp.AnyBoolDType | None = None, + shape: ToShapeMin3D | None, + dtype: onp.AnyBoolDType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # >2-d shape-like, dtype: type[bool] (keyword) + def __init__( + self: coo_array[np.bool_, onp.AtLeast3D], + /, + arg1: ToShapeMin3D, + shape: ToShapeMin3D | None = None, *, + dtype: onp.AnyBoolDType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[int] + @overload # 1-d shape-like, dtype: type[int] (positional) def __init__( self: coo_array[np.int64, tuple[int]], /, arg1: ToShape1D, - shape: ToShape1D | None = None, - dtype: onp.AnyIntDType | None = None, + shape: ToShape1D | None, + dtype: onp.AnyIntDType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 1-d shape-like, dtype: type[int] (keyword) + def __init__( + self: coo_array[np.int64, tuple[int]], + /, + arg1: ToShape1D, + shape: ToShape1D | None = None, *, + dtype: onp.AnyIntDType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[int] + @overload # 2-d shape-like, dtype: type[int] (positional) def __init__( self: coo_array[np.int64, tuple[int, int]], /, arg1: ToShape2D, - shape: ToShape2D | None = None, - dtype: onp.AnyIntDType | None = None, + shape: ToShape2D | None, + dtype: onp.AnyIntDType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[int] (keyword) + def __init__( + self: coo_array[np.int64, tuple[int, int]], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, *, + dtype: onp.AnyIntDType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # >2-d shape-like, dtype: type[int] + @overload # >2-d shape-like, dtype: type[int] (positional) def __init__( self: coo_array[np.int64, onp.AtLeast3D], /, arg1: ToShapeMin3D, - shape: ToShapeMin3D | None = None, - dtype: onp.AnyIntDType | None = None, + shape: ToShapeMin3D | None, + dtype: onp.AnyIntDType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # >2-d shape-like, dtype: type[int] (keyword) + def __init__( + self: coo_array[np.int64, onp.AtLeast3D], + /, + arg1: ToShapeMin3D, + shape: ToShapeMin3D | None = None, *, + dtype: onp.AnyIntDType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[complex] + @overload # 1-d shape-like, dtype: type[complex] (positional) def __init__( self: coo_array[np.complex128, tuple[int]], /, arg1: ToShape1D, - shape: ToShape1D | None = None, - dtype: onp.AnyComplex128DType | None = None, + shape: ToShape1D | None, + dtype: onp.AnyComplex128DType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 1-d shape-like, dtype: type[complex] (keyword) + def __init__( + self: coo_array[np.complex128, tuple[int]], + /, + arg1: ToShape1D, + shape: ToShape1D | None = None, *, + dtype: onp.AnyComplex128DType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[complex] + @overload # 2-d shape-like, dtype: type[complex] (positional) def __init__( self: coo_array[np.complex128, tuple[int, int]], /, arg1: ToShape2D, - shape: ToShape2D | None = None, - dtype: onp.AnyComplex128DType | None = None, + shape: ToShape2D | None, + dtype: onp.AnyComplex128DType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[complex] (keyword) + def __init__( + self: coo_array[np.complex128, tuple[int, int]], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, *, + dtype: onp.AnyComplex128DType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # >2-d shape-like, dtype: type[complex] + @overload # >2-d shape-like, dtype: type[complex] (positional) def __init__( self: coo_array[np.complex128, onp.AtLeast3D], /, arg1: ToShapeMin3D, - shape: ToShapeMin3D | None = None, - dtype: onp.AnyComplex64DType | None = None, + shape: ToShapeMin3D | None, + dtype: onp.AnyComplex64DType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # >2-d shape-like, dtype: type[complex] (keyword) + def __init__( + self: coo_array[np.complex128, onp.AtLeast3D], + /, + arg1: ToShapeMin3D, + shape: ToShapeMin3D | None = None, *, + dtype: onp.AnyComplex64DType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... @overload # vector-like builtins.bool, dtype: type[bool] | None diff --git a/scipy-stubs/sparse/_csc.pyi b/scipy-stubs/sparse/_csc.pyi index 46e3b8fa..1a411af4 100644 --- a/scipy-stubs/sparse/_csc.pyi +++ b/scipy-stubs/sparse/_csc.pyi @@ -88,37 +88,67 @@ class csc_array(_csc_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[bool] + @overload # 2-d shape-like, dtype: type[bool] (positional) def __init__( self: csc_array[np.bool_], /, arg1: ToShape2D, - shape: ToShape2D | None = None, - dtype: onp.AnyBoolDType | None = None, + shape: ToShape2D | None, + dtype: onp.AnyBoolDType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[bool] (keyword) + def __init__( + self: csc_array[np.bool_], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, *, + dtype: onp.AnyBoolDType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[int] + @overload # 2-d shape-like, dtype: type[int] (positional) def __init__( self: csc_array[np.int64], /, arg1: ToShape2D, - shape: ToShape2D | None = None, - dtype: onp.AnyIntDType | None = None, + shape: ToShape2D | None, + dtype: onp.AnyIntDType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[int] (keyword) + def __init__( + self: csc_array[np.int64], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, *, + dtype: onp.AnyIntDType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[complex] + @overload # 2-d shape-like, dtype: type[complex] (positional) def __init__( self: csc_array[np.complex128], /, arg1: ToShape2D, - shape: ToShape2D | None = None, - dtype: onp.AnyComplex128DType | None = None, + shape: ToShape2D | None, + dtype: onp.AnyComplex128DType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[complex] (keyword) + def __init__( + self: csc_array[np.complex128], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, *, + dtype: onp.AnyComplex128DType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... @overload # 2-d array-like bool, dtype: type[bool] | None diff --git a/scipy-stubs/sparse/_csr.pyi b/scipy-stubs/sparse/_csr.pyi index bd8a93f3..f4c06e69 100644 --- a/scipy-stubs/sparse/_csr.pyi +++ b/scipy-stubs/sparse/_csr.pyi @@ -142,70 +142,130 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[bool] + @overload # 1-d shape-like, dtype: type[bool] (positional) def __init__( self: csr_array[np.bool_, tuple[int]], /, arg1: ToShape1D, - shape: ToShape1D | None = None, - dtype: onp.AnyBoolDType | None = None, + shape: ToShape1D | None, + dtype: onp.AnyBoolDType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 1-d shape-like, dtype: type[bool] (keyword) + def __init__( + self: csr_array[np.bool_, tuple[int]], + /, + arg1: ToShape1D, + shape: ToShape1D | None = None, *, + dtype: onp.AnyBoolDType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[bool] + @overload # 2-d shape-like, dtype: type[bool] (positional) def __init__( self: csr_array[np.bool_, tuple[int, int]], /, arg1: ToShape2D, - shape: ToShape2D | None = None, - dtype: onp.AnyBoolDType | None = None, + shape: ToShape2D | None, + dtype: onp.AnyBoolDType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[bool] (keyword) + def __init__( + self: csr_array[np.bool_, tuple[int, int]], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, *, + dtype: onp.AnyBoolDType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[int] + @overload # 1-d shape-like, dtype: type[int] (positional) def __init__( self: csr_array[np.int64, tuple[int]], /, arg1: ToShape1D, - shape: ToShape1D | None = None, - dtype: onp.AnyIntDType | None = None, + shape: ToShape1D | None, + dtype: onp.AnyIntDType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 1-d shape-like, dtype: type[int] (keyword) + def __init__( + self: csr_array[np.int64, tuple[int]], + /, + arg1: ToShape1D, + shape: ToShape1D | None = None, *, + dtype: onp.AnyIntDType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[int] + @overload # 2-d shape-like, dtype: type[int] (positional) def __init__( self: csr_array[np.int64, tuple[int, int]], /, arg1: ToShape2D, - shape: ToShape2D | None = None, - dtype: onp.AnyIntDType | None = None, + shape: ToShape2D | None, + dtype: onp.AnyIntDType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[int] (keyword) + def __init__( + self: csr_array[np.int64, tuple[int, int]], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, *, + dtype: onp.AnyIntDType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[complex] + @overload # 1-d shape-like, dtype: type[complex] (positional) def __init__( self: csr_array[np.complex128, tuple[int]], /, arg1: ToShape1D, - shape: ToShape1D | None = None, - dtype: onp.AnyComplex128DType | None = None, + shape: ToShape1D | None, + dtype: onp.AnyComplex128DType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 1-d shape-like, dtype: type[complex] (keyword) + def __init__( + self: csr_array[np.complex128, tuple[int]], + /, + arg1: ToShape1D, + shape: ToShape1D | None = None, *, + dtype: onp.AnyComplex128DType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[complex] + @overload # 2-d shape-like, dtype: type[complex] (positional) def __init__( self: csr_array[np.complex128, tuple[int, int]], /, arg1: ToShape2D, - shape: ToShape2D | None = None, - dtype: onp.AnyComplex128DType | None = None, + shape: ToShape2D | None, + dtype: onp.AnyComplex128DType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[complex] (keyword) + def __init__( + self: csr_array[np.complex128, tuple[int, int]], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, *, + dtype: onp.AnyComplex128DType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... @overload # 1-d array-like bool, dtype: type[bool] | None diff --git a/scipy-stubs/sparse/_dia.pyi b/scipy-stubs/sparse/_dia.pyi index 35b9ffd9..b3fdd636 100644 --- a/scipy-stubs/sparse/_dia.pyi +++ b/scipy-stubs/sparse/_dia.pyi @@ -93,37 +93,67 @@ class dia_array(_dia_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[bool] + @overload # 2-d shape-like, dtype: type[bool] (positional) def __init__( self: dia_array[np.bool_], /, arg1: ToShape2D, - shape: ToShape2D | None = None, - dtype: onp.AnyBoolDType | None = None, + shape: ToShape2D | None, + dtype: onp.AnyBoolDType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[bool] (keyword) + def __init__( + self: dia_array[np.bool_], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, *, + dtype: onp.AnyBoolDType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[int] + @overload # 2-d shape-like, dtype: type[int] (positional) def __init__( self: dia_array[np.int64], /, arg1: ToShape2D, - shape: ToShape2D | None = None, - dtype: onp.AnyIntDType | None = None, + shape: ToShape2D | None, + dtype: onp.AnyIntDType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[int] (keyword) + def __init__( + self: dia_array[np.int64], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, *, + dtype: onp.AnyIntDType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[complex] + @overload # 2-d shape-like, dtype: type[complex] (positional) def __init__( self: dia_array[np.complex128], /, arg1: ToShape2D, - shape: ToShape2D | None = None, - dtype: onp.AnyComplex128DType | None = None, + shape: ToShape2D | None, + dtype: onp.AnyComplex128DType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[complex] (keyword) + def __init__( + self: dia_array[np.complex128], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, *, + dtype: onp.AnyComplex128DType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... @overload # matrix-like builtins.bool, dtype: type[bool] | None diff --git a/scipy-stubs/sparse/_dok.pyi b/scipy-stubs/sparse/_dok.pyi index b924b409..651bdda8 100644 --- a/scipy-stubs/sparse/_dok.pyi +++ b/scipy-stubs/sparse/_dok.pyi @@ -234,70 +234,130 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[bool] + @overload # 1-d shape-like, dtype: type[bool] (positional) def __init__( self: dok_array[np.bool_, _1D], /, arg1: ToShape1D, - shape: ToShape1D | None = None, - dtype: onp.AnyBoolDType | None = None, + shape: ToShape1D | None, + dtype: onp.AnyBoolDType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 1-d shape-like, dtype: type[bool] (keyword) + def __init__( + self: dok_array[np.bool_, _1D], + /, + arg1: ToShape1D, + shape: ToShape1D | None = None, *, + dtype: onp.AnyBoolDType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[bool] + @overload # 2-d shape-like, dtype: type[bool] (positional) def __init__( self: dok_array[np.bool_, _2D], /, arg1: ToShape2D, - shape: ToShape2D | None = None, - dtype: onp.AnyBoolDType | None = None, + shape: ToShape2D | None, + dtype: onp.AnyBoolDType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[bool] (keyword) + def __init__( + self: dok_array[np.bool_, _2D], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, *, + dtype: onp.AnyBoolDType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[int] + @overload # 1-d shape-like, dtype: type[int] (positional) def __init__( self: dok_array[np.int64, _1D], /, arg1: ToShape1D, - shape: ToShape1D | None = None, - dtype: onp.AnyIntDType | None = None, + shape: ToShape1D | None, + dtype: onp.AnyIntDType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 1-d shape-like, dtype: type[int] (keyword) + def __init__( + self: dok_array[np.int64, _1D], + /, + arg1: ToShape1D, + shape: ToShape1D | None = None, *, + dtype: onp.AnyIntDType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[int] + @overload # 2-d shape-like, dtype: type[int] (positional) def __init__( self: dok_array[np.int64, _2D], /, arg1: ToShape2D, - shape: ToShape2D | None = None, - dtype: onp.AnyIntDType | None = None, + shape: ToShape2D | None, + dtype: onp.AnyIntDType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[int] (keyword) + def __init__( + self: dok_array[np.int64, _2D], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, *, + dtype: onp.AnyIntDType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[complex] + @overload # 1-d shape-like, dtype: type[complex] (positional) def __init__( self: dok_array[np.complex128, _1D], /, arg1: ToShape1D, - shape: ToShape1D | None = None, - dtype: onp.AnyComplex128DType | None = None, + shape: ToShape1D | None, + dtype: onp.AnyComplex128DType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 1-d shape-like, dtype: type[complex] (keyword) + def __init__( + self: dok_array[np.complex128, _1D], + /, + arg1: ToShape1D, + shape: ToShape1D | None = None, *, + dtype: onp.AnyComplex128DType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[complex] + @overload # 2-d shape-like, dtype: type[complex] (positional) def __init__( self: dok_array[np.complex128, _2D], /, arg1: ToShape2D, - shape: ToShape2D | None = None, - dtype: onp.AnyComplex128DType | None = None, + shape: ToShape2D | None, + dtype: onp.AnyComplex128DType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[complex] (keyword) + def __init__( + self: dok_array[np.complex128, _2D], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, *, + dtype: onp.AnyComplex128DType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... @overload # 1-d array-like bool, dtype: type[bool] | None diff --git a/scipy-stubs/sparse/_lil.pyi b/scipy-stubs/sparse/_lil.pyi index d62f5e98..1045ea73 100644 --- a/scipy-stubs/sparse/_lil.pyi +++ b/scipy-stubs/sparse/_lil.pyi @@ -114,37 +114,67 @@ class lil_array(_lil_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[bool] + @overload # 2-d shape-like, dtype: type[bool] (positional) def __init__( self: lil_array[np.bool_], /, arg1: ToShape2D, - shape: ToShape2D | None = None, - dtype: onp.AnyBoolDType | None = None, + shape: ToShape2D | None, + dtype: onp.AnyBoolDType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[bool] (keyword) + def __init__( + self: lil_array[np.bool_], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, *, + dtype: onp.AnyBoolDType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[int] + @overload # 2-d shape-like, dtype: type[int] (positional) def __init__( self: lil_array[np.int64], /, arg1: ToShape2D, - shape: ToShape2D | None = None, - dtype: onp.AnyIntDType | None = None, + shape: ToShape2D | None, + dtype: onp.AnyIntDType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[int] (keyword) + def __init__( + self: lil_array[np.int64], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, *, + dtype: onp.AnyIntDType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[complex] + @overload # 2-d shape-like, dtype: type[complex] (positional) def __init__( self: lil_array[np.complex128], /, arg1: ToShape2D, - shape: ToShape2D | None = None, - dtype: onp.AnyComplex128DType | None = None, + shape: ToShape2D | None, + dtype: onp.AnyComplex128DType, copy: bool = False, + maxprint: int | None = None, + ) -> None: ... + @overload # 2-d shape-like, dtype: type[complex] (keyword) + def __init__( + self: lil_array[np.complex128], + /, + arg1: ToShape2D, + shape: ToShape2D | None = None, *, + dtype: onp.AnyComplex128DType, + copy: bool = False, maxprint: int | None = None, ) -> None: ... @overload # matrix-like builtins.bool, dtype: type[bool] | None From c34349ad074e8c8b7044630546f8f9287c386de3 Mon Sep 17 00:00:00 2001 From: juvdnbro Date: Sun, 6 Jul 2025 15:26:09 +0200 Subject: [PATCH 5/6] Added missing keyword separators --- scipy-stubs/sparse/_bsr.pyi | 3 +++ scipy-stubs/sparse/_coo.pyi | 9 +++++++++ scipy-stubs/sparse/_csc.pyi | 3 +++ scipy-stubs/sparse/_csr.pyi | 6 ++++++ scipy-stubs/sparse/_dia.pyi | 3 +++ scipy-stubs/sparse/_dok.pyi | 6 ++++++ scipy-stubs/sparse/_lil.pyi | 3 +++ 7 files changed, 33 insertions(+) diff --git a/scipy-stubs/sparse/_bsr.pyi b/scipy-stubs/sparse/_bsr.pyi index 491176cb..c8c57af1 100644 --- a/scipy-stubs/sparse/_bsr.pyi +++ b/scipy-stubs/sparse/_bsr.pyi @@ -117,6 +117,7 @@ class bsr_array(_bsr_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G shape: ToShape2D | None, dtype: onp.AnyBoolDType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 2-d shape-like, dtype: type[bool] (keyword) @@ -138,6 +139,7 @@ class bsr_array(_bsr_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G shape: ToShape2D | None, dtype: onp.AnyIntDType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 2-d shape-like, dtype: type[int] (keyword) @@ -159,6 +161,7 @@ class bsr_array(_bsr_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G shape: ToShape2D | None, dtype: onp.AnyComplex128DType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 2-d shape-like, dtype: type[complex] (keyword) diff --git a/scipy-stubs/sparse/_coo.pyi b/scipy-stubs/sparse/_coo.pyi index 2c9628ed..a1f20ef9 100644 --- a/scipy-stubs/sparse/_coo.pyi +++ b/scipy-stubs/sparse/_coo.pyi @@ -190,6 +190,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT shape: ToShape1D | None, dtype: onp.AnyBoolDType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 1-d shape-like, dtype: type[bool] (keyword) @@ -211,6 +212,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT shape: ToShape2D | None, dtype: onp.AnyBoolDType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 2-d shape-like, dtype: type[bool] (keyword) @@ -232,6 +234,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT shape: ToShapeMin3D | None, dtype: onp.AnyBoolDType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # >2-d shape-like, dtype: type[bool] (keyword) @@ -253,6 +256,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT shape: ToShape1D | None, dtype: onp.AnyIntDType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 1-d shape-like, dtype: type[int] (keyword) @@ -274,6 +278,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT shape: ToShape2D | None, dtype: onp.AnyIntDType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 2-d shape-like, dtype: type[int] (keyword) @@ -295,6 +300,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT shape: ToShapeMin3D | None, dtype: onp.AnyIntDType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # >2-d shape-like, dtype: type[int] (keyword) @@ -316,6 +322,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT shape: ToShape1D | None, dtype: onp.AnyComplex128DType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 1-d shape-like, dtype: type[complex] (keyword) @@ -337,6 +344,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT shape: ToShape2D | None, dtype: onp.AnyComplex128DType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 2-d shape-like, dtype: type[complex] (keyword) @@ -358,6 +366,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT shape: ToShapeMin3D | None, dtype: onp.AnyComplex64DType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # >2-d shape-like, dtype: type[complex] (keyword) diff --git a/scipy-stubs/sparse/_csc.pyi b/scipy-stubs/sparse/_csc.pyi index 1a411af4..3d7f329e 100644 --- a/scipy-stubs/sparse/_csc.pyi +++ b/scipy-stubs/sparse/_csc.pyi @@ -96,6 +96,7 @@ class csc_array(_csc_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G shape: ToShape2D | None, dtype: onp.AnyBoolDType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 2-d shape-like, dtype: type[bool] (keyword) @@ -117,6 +118,7 @@ class csc_array(_csc_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G shape: ToShape2D | None, dtype: onp.AnyIntDType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 2-d shape-like, dtype: type[int] (keyword) @@ -138,6 +140,7 @@ class csc_array(_csc_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G shape: ToShape2D | None, dtype: onp.AnyComplex128DType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 2-d shape-like, dtype: type[complex] (keyword) diff --git a/scipy-stubs/sparse/_csr.pyi b/scipy-stubs/sparse/_csr.pyi index f4c06e69..a5a9435f 100644 --- a/scipy-stubs/sparse/_csr.pyi +++ b/scipy-stubs/sparse/_csr.pyi @@ -150,6 +150,7 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT shape: ToShape1D | None, dtype: onp.AnyBoolDType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 1-d shape-like, dtype: type[bool] (keyword) @@ -171,6 +172,7 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT shape: ToShape2D | None, dtype: onp.AnyBoolDType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 2-d shape-like, dtype: type[bool] (keyword) @@ -192,6 +194,7 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT shape: ToShape1D | None, dtype: onp.AnyIntDType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 1-d shape-like, dtype: type[int] (keyword) @@ -213,6 +216,7 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT shape: ToShape2D | None, dtype: onp.AnyIntDType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 2-d shape-like, dtype: type[int] (keyword) @@ -234,6 +238,7 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT shape: ToShape1D | None, dtype: onp.AnyComplex128DType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 1-d shape-like, dtype: type[complex] (keyword) @@ -255,6 +260,7 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT shape: ToShape2D | None, dtype: onp.AnyComplex128DType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 2-d shape-like, dtype: type[complex] (keyword) diff --git a/scipy-stubs/sparse/_dia.pyi b/scipy-stubs/sparse/_dia.pyi index b3fdd636..fdef369a 100644 --- a/scipy-stubs/sparse/_dia.pyi +++ b/scipy-stubs/sparse/_dia.pyi @@ -101,6 +101,7 @@ class dia_array(_dia_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G shape: ToShape2D | None, dtype: onp.AnyBoolDType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 2-d shape-like, dtype: type[bool] (keyword) @@ -122,6 +123,7 @@ class dia_array(_dia_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G shape: ToShape2D | None, dtype: onp.AnyIntDType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 2-d shape-like, dtype: type[int] (keyword) @@ -143,6 +145,7 @@ class dia_array(_dia_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G shape: ToShape2D | None, dtype: onp.AnyComplex128DType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 2-d shape-like, dtype: type[complex] (keyword) diff --git a/scipy-stubs/sparse/_dok.pyi b/scipy-stubs/sparse/_dok.pyi index 651bdda8..26020310 100644 --- a/scipy-stubs/sparse/_dok.pyi +++ b/scipy-stubs/sparse/_dok.pyi @@ -242,6 +242,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT shape: ToShape1D | None, dtype: onp.AnyBoolDType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 1-d shape-like, dtype: type[bool] (keyword) @@ -263,6 +264,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT shape: ToShape2D | None, dtype: onp.AnyBoolDType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 2-d shape-like, dtype: type[bool] (keyword) @@ -284,6 +286,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT shape: ToShape1D | None, dtype: onp.AnyIntDType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 1-d shape-like, dtype: type[int] (keyword) @@ -305,6 +308,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT shape: ToShape2D | None, dtype: onp.AnyIntDType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 2-d shape-like, dtype: type[int] (keyword) @@ -326,6 +330,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT shape: ToShape1D | None, dtype: onp.AnyComplex128DType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 1-d shape-like, dtype: type[complex] (keyword) @@ -347,6 +352,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT shape: ToShape2D | None, dtype: onp.AnyComplex128DType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 2-d shape-like, dtype: type[complex] (keyword) diff --git a/scipy-stubs/sparse/_lil.pyi b/scipy-stubs/sparse/_lil.pyi index 1045ea73..1b0cee37 100644 --- a/scipy-stubs/sparse/_lil.pyi +++ b/scipy-stubs/sparse/_lil.pyi @@ -122,6 +122,7 @@ class lil_array(_lil_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G shape: ToShape2D | None, dtype: onp.AnyBoolDType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 2-d shape-like, dtype: type[bool] (keyword) @@ -143,6 +144,7 @@ class lil_array(_lil_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G shape: ToShape2D | None, dtype: onp.AnyIntDType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 2-d shape-like, dtype: type[int] (keyword) @@ -164,6 +166,7 @@ class lil_array(_lil_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G shape: ToShape2D | None, dtype: onp.AnyComplex128DType, copy: bool = False, + *, maxprint: int | None = None, ) -> None: ... @overload # 2-d shape-like, dtype: type[complex] (keyword) From 7796dedcb0e687fb3df8dc0e9bb28133f957c2e4 Mon Sep 17 00:00:00 2001 From: juvdnbro Date: Mon, 7 Jul 2025 09:46:31 +0200 Subject: [PATCH 6/6] Cleaned up comments for overloads of sparse array constructors --- scipy-stubs/sparse/_bsr.pyi | 30 ++++++++--------- scipy-stubs/sparse/_coo.pyi | 66 ++++++++++++++++++------------------- scipy-stubs/sparse/_csc.pyi | 30 ++++++++--------- scipy-stubs/sparse/_csr.pyi | 52 ++++++++++++++--------------- scipy-stubs/sparse/_dia.pyi | 30 ++++++++--------- scipy-stubs/sparse/_dok.pyi | 52 ++++++++++++++--------------- scipy-stubs/sparse/_lil.pyi | 30 ++++++++--------- 7 files changed, 145 insertions(+), 145 deletions(-) diff --git a/scipy-stubs/sparse/_bsr.pyi b/scipy-stubs/sparse/_bsr.pyi index c8c57af1..0cd44502 100644 --- a/scipy-stubs/sparse/_bsr.pyi +++ b/scipy-stubs/sparse/_bsr.pyi @@ -98,7 +98,7 @@ class bsr_array(_bsr_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[float] | None + @overload # 2-d shape-like, dtype: float64-like | None def __init__( self: bsr_array[np.float64], /, @@ -109,7 +109,7 @@ class bsr_array(_bsr_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[bool] (positional) + @overload # 2-d shape-like, dtype: bool-like (positional) def __init__( self: bsr_array[np.bool_], /, @@ -120,7 +120,7 @@ class bsr_array(_bsr_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[bool] (keyword) + @overload # 2-d shape-like, dtype: bool-like (keyword) def __init__( self: bsr_array[np.bool_], /, @@ -131,7 +131,7 @@ class bsr_array(_bsr_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[int] (positional) + @overload # 2-d shape-like, dtype: int-like (positional) def __init__( self: bsr_array[np.int64], /, @@ -142,7 +142,7 @@ class bsr_array(_bsr_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[int] (keyword) + @overload # 2-d shape-like, dtype: int-like (keyword) def __init__( self: bsr_array[np.int64], /, @@ -153,7 +153,7 @@ class bsr_array(_bsr_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[complex] (positional) + @overload # 2-d shape-like, dtype: complex128-like (positional) def __init__( self: bsr_array[np.complex128], /, @@ -164,7 +164,7 @@ class bsr_array(_bsr_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[complex] (keyword) + @overload # 2-d shape-like, dtype: complex128-like (keyword) def __init__( self: bsr_array[np.complex128], /, @@ -175,7 +175,7 @@ class bsr_array(_bsr_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.bool, dtype: type[bool] | None + @overload # matrix-like builtins.bool, dtype: bool-like | None def __init__( self: bsr_array[np.bool_], /, @@ -187,7 +187,7 @@ class bsr_array(_bsr_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.int, dtype: type[int] | None + @overload # matrix-like builtins.int, dtype: int-like | None def __init__( self: bsr_array[np.int_], /, @@ -199,7 +199,7 @@ class bsr_array(_bsr_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.float, dtype: type[float] | None + @overload # matrix-like builtins.float, dtype: float64-like | None def __init__( self: bsr_array[np.float64], /, @@ -211,7 +211,7 @@ class bsr_array(_bsr_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.complex, dtype: type[complex] | None + @overload # matrix-like builtins.complex, dtype: complex128-like | None def __init__( self: bsr_array[np.complex128], /, @@ -301,7 +301,7 @@ class bsr_matrix(_bsr_base[_ScalarT_co], spmatrix[_ScalarT_co], Generic[_ScalarT *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.bool, dtype: type[bool] | None + @overload # matrix-like builtins.bool, dtype: bool-like | None def __init__( self: bsr_matrix[np.bool_], /, @@ -313,7 +313,7 @@ class bsr_matrix(_bsr_base[_ScalarT_co], spmatrix[_ScalarT_co], Generic[_ScalarT *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.int, dtype: type[int] | None + @overload # matrix-like builtins.int, dtype: int-like | None def __init__( self: bsr_matrix[np.int_], /, @@ -325,7 +325,7 @@ class bsr_matrix(_bsr_base[_ScalarT_co], spmatrix[_ScalarT_co], Generic[_ScalarT *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.float, dtype: type[float] | None + @overload # matrix-like builtins.float, dtype: float64-like | None def __init__( self: bsr_matrix[np.float64], /, @@ -337,7 +337,7 @@ class bsr_matrix(_bsr_base[_ScalarT_co], spmatrix[_ScalarT_co], Generic[_ScalarT *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.complex, dtype: type[complex] | None + @overload # matrix-like builtins.complex, dtype: complex128-like | None def __init__( self: bsr_matrix[np.complex128], /, diff --git a/scipy-stubs/sparse/_coo.pyi b/scipy-stubs/sparse/_coo.pyi index a1f20ef9..52ebe0d5 100644 --- a/scipy-stubs/sparse/_coo.pyi +++ b/scipy-stubs/sparse/_coo.pyi @@ -149,7 +149,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[float] | None + @overload # 1-d shape-like, dtype: float64-like | None def __init__( self: coo_array[np.float64, tuple[int]], /, @@ -160,7 +160,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[float] | None + @overload # 2-d shape-like, dtype: float64-like | None def __init__( self: coo_array[np.float64, tuple[int, int]], /, @@ -171,7 +171,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # >2-d shape-like, dtype: type[float] | None + @overload # >2-d shape-like, dtype: float64-like | None def __init__( self: coo_array[np.float64, onp.AtLeast3D], /, @@ -182,7 +182,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[bool] (positional) + @overload # 1-d shape-like, dtype: bool-like (positional) def __init__( self: coo_array[np.bool_, tuple[int]], /, @@ -193,7 +193,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[bool] (keyword) + @overload # 1-d shape-like, dtype: bool-like (keyword) def __init__( self: coo_array[np.bool_, tuple[int]], /, @@ -204,7 +204,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[bool] (positional) + @overload # 2-d shape-like, dtype: bool-like (positional) def __init__( self: coo_array[np.bool_, tuple[int, int]], /, @@ -215,7 +215,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[bool] (keyword) + @overload # 2-d shape-like, dtype: bool-like (keyword) def __init__( self: coo_array[np.bool_, tuple[int, int]], /, @@ -226,7 +226,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # >2-d shape-like, dtype: type[bool] (positional) + @overload # >2-d shape-like, dtype: bool-like (positional) def __init__( self: coo_array[np.bool_, onp.AtLeast3D], /, @@ -237,7 +237,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # >2-d shape-like, dtype: type[bool] (keyword) + @overload # >2-d shape-like, dtype: bool-like (keyword) def __init__( self: coo_array[np.bool_, onp.AtLeast3D], /, @@ -248,7 +248,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[int] (positional) + @overload # 1-d shape-like, dtype: int-like (positional) def __init__( self: coo_array[np.int64, tuple[int]], /, @@ -259,7 +259,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[int] (keyword) + @overload # 1-d shape-like, dtype: int-like (keyword) def __init__( self: coo_array[np.int64, tuple[int]], /, @@ -270,7 +270,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[int] (positional) + @overload # 2-d shape-like, dtype: int-like (positional) def __init__( self: coo_array[np.int64, tuple[int, int]], /, @@ -281,7 +281,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[int] (keyword) + @overload # 2-d shape-like, dtype: int-like (keyword) def __init__( self: coo_array[np.int64, tuple[int, int]], /, @@ -292,7 +292,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # >2-d shape-like, dtype: type[int] (positional) + @overload # >2-d shape-like, dtype: int-like (positional) def __init__( self: coo_array[np.int64, onp.AtLeast3D], /, @@ -303,7 +303,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # >2-d shape-like, dtype: type[int] (keyword) + @overload # >2-d shape-like, dtype: int-like (keyword) def __init__( self: coo_array[np.int64, onp.AtLeast3D], /, @@ -314,7 +314,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[complex] (positional) + @overload # 1-d shape-like, dtype: complex128-like (positional) def __init__( self: coo_array[np.complex128, tuple[int]], /, @@ -325,7 +325,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[complex] (keyword) + @overload # 1-d shape-like, dtype: complex128-like (keyword) def __init__( self: coo_array[np.complex128, tuple[int]], /, @@ -336,7 +336,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[complex] (positional) + @overload # 2-d shape-like, dtype: complex128-like (positional) def __init__( self: coo_array[np.complex128, tuple[int, int]], /, @@ -347,7 +347,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[complex] (keyword) + @overload # 2-d shape-like, dtype: complex128-like (keyword) def __init__( self: coo_array[np.complex128, tuple[int, int]], /, @@ -358,7 +358,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # >2-d shape-like, dtype: type[complex] (positional) + @overload # >2-d shape-like, dtype: complex128-like (positional) def __init__( self: coo_array[np.complex128, onp.AtLeast3D], /, @@ -369,7 +369,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # >2-d shape-like, dtype: type[complex] (keyword) + @overload # >2-d shape-like, dtype: complex128-like (keyword) def __init__( self: coo_array[np.complex128, onp.AtLeast3D], /, @@ -380,7 +380,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # vector-like builtins.bool, dtype: type[bool] | None + @overload # vector-like builtins.bool, dtype: bool-like | None def __init__( self: coo_array[np.bool_, tuple[int]], /, @@ -391,7 +391,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.bool, dtype: type[bool] | None + @overload # matrix-like builtins.bool, dtype: bool-like | None def __init__( self: coo_array[np.bool_, tuple[int, int]], /, @@ -402,7 +402,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # vector-like builtins.int, dtype: type[int] | None + @overload # vector-like builtins.int, dtype: int-like | None def __init__( self: coo_array[np.int_, tuple[int]], /, @@ -413,7 +413,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.int, dtype: type[int] | None + @overload # matrix-like builtins.int, dtype: int-like | None def __init__( self: coo_array[np.int_, tuple[int, int]], /, @@ -424,7 +424,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # vector-like builtins.float, dtype: type[float] | None + @overload # vector-like builtins.float, dtype: float64-like | None def __init__( self: coo_array[np.float64, tuple[int]], /, @@ -435,7 +435,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.float, dtype: type[float] | None + @overload # matrix-like builtins.float, dtype: float64-like | None def __init__( self: coo_array[np.float64, tuple[int, int]], /, @@ -446,7 +446,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.complex, dtype: type[complex] | None + @overload # matrix-like builtins.complex, dtype: complex128-like | None def __init__( self: coo_array[np.complex128, tuple[int]], /, @@ -457,7 +457,7 @@ class coo_array(_coo_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.complex, dtype: type[complex] | None + @overload # matrix-like builtins.complex, dtype: complex128-like | None def __init__( self: coo_array[np.complex128, tuple[int, int]], /, @@ -601,7 +601,7 @@ class coo_matrix(_coo_base[_ScalarT_co, tuple[int, int]], spmatrix[_ScalarT_co], *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.bool, dtype: type[bool] | None + @overload # matrix-like builtins.bool, dtype: bool-like | None def __init__( self: coo_matrix[np.bool_], /, @@ -612,7 +612,7 @@ class coo_matrix(_coo_base[_ScalarT_co, tuple[int, int]], spmatrix[_ScalarT_co], *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.int, dtype: type[int] | None + @overload # matrix-like builtins.int, dtype: int-like | None def __init__( self: coo_matrix[np.int_], /, @@ -623,7 +623,7 @@ class coo_matrix(_coo_base[_ScalarT_co, tuple[int, int]], spmatrix[_ScalarT_co], *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.float, dtype: type[float] | None + @overload # matrix-like builtins.float, dtype: float64-like | None def __init__( self: coo_matrix[np.float64], /, @@ -634,7 +634,7 @@ class coo_matrix(_coo_base[_ScalarT_co, tuple[int, int]], spmatrix[_ScalarT_co], *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.complex, dtype: type[complex] | None + @overload # matrix-like builtins.complex, dtype: complex128-like | None def __init__( self: coo_matrix[np.complex128], /, diff --git a/scipy-stubs/sparse/_csc.pyi b/scipy-stubs/sparse/_csc.pyi index 3d7f329e..9ec43565 100644 --- a/scipy-stubs/sparse/_csc.pyi +++ b/scipy-stubs/sparse/_csc.pyi @@ -77,7 +77,7 @@ class csc_array(_csc_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[float] | None + @overload # 2-d shape-like, dtype: float64-like | None def __init__( self: csc_array[np.float64], /, @@ -88,7 +88,7 @@ class csc_array(_csc_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[bool] (positional) + @overload # 2-d shape-like, dtype: bool-like (positional) def __init__( self: csc_array[np.bool_], /, @@ -99,7 +99,7 @@ class csc_array(_csc_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[bool] (keyword) + @overload # 2-d shape-like, dtype: bool-like (keyword) def __init__( self: csc_array[np.bool_], /, @@ -110,7 +110,7 @@ class csc_array(_csc_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[int] (positional) + @overload # 2-d shape-like, dtype: int-like (positional) def __init__( self: csc_array[np.int64], /, @@ -121,7 +121,7 @@ class csc_array(_csc_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[int] (keyword) + @overload # 2-d shape-like, dtype: int-like (keyword) def __init__( self: csc_array[np.int64], /, @@ -132,7 +132,7 @@ class csc_array(_csc_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[complex] (positional) + @overload # 2-d shape-like, dtype: complex128-like (positional) def __init__( self: csc_array[np.complex128], /, @@ -143,7 +143,7 @@ class csc_array(_csc_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[complex] (keyword) + @overload # 2-d shape-like, dtype: complex128-like (keyword) def __init__( self: csc_array[np.complex128], /, @@ -154,7 +154,7 @@ class csc_array(_csc_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d array-like bool, dtype: type[bool] | None + @overload # 2-d array-like bool, dtype: bool-like | None def __init__( self: csc_array[np.bool_], /, @@ -165,7 +165,7 @@ class csc_array(_csc_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d array-like ~int, dtype: type[int] | None + @overload # 2-d array-like ~int, dtype: int-like | None def __init__( self: csc_array[np.int_], /, @@ -176,7 +176,7 @@ class csc_array(_csc_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d array-like ~float, dtype: type[float] | None + @overload # 2-d array-like ~float, dtype: float64-like | None def __init__( self: csc_array[np.float64], /, @@ -187,7 +187,7 @@ class csc_array(_csc_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d array-like ~complex, dtype: type[complex] | None + @overload # 2-d array-like ~complex, dtype: complex128-like | None def __init__( self: csc_array[np.complex128], /, @@ -266,7 +266,7 @@ class csc_matrix(_csc_base[_ScalarT_co], spmatrix[_ScalarT_co], Generic[_ScalarT *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d array-like bool, dtype: type[bool] | None + @overload # 2-d array-like bool, dtype: bool-like | None def __init__( self: csc_matrix[np.bool_], /, @@ -277,7 +277,7 @@ class csc_matrix(_csc_base[_ScalarT_co], spmatrix[_ScalarT_co], Generic[_ScalarT *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d array-like ~int, dtype: type[int] | None + @overload # 2-d array-like ~int, dtype: int-like | None def __init__( self: csc_matrix[np.int_], /, @@ -288,7 +288,7 @@ class csc_matrix(_csc_base[_ScalarT_co], spmatrix[_ScalarT_co], Generic[_ScalarT *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d array-like ~float, dtype: type[float] | None + @overload # 2-d array-like ~float, dtype: float64-like | None def __init__( self: csc_matrix[np.float64], /, @@ -299,7 +299,7 @@ class csc_matrix(_csc_base[_ScalarT_co], spmatrix[_ScalarT_co], Generic[_ScalarT *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d array-like ~complex, dtype: type[complex] | None + @overload # 2-d array-like ~complex, dtype: complex128-like | None def __init__( self: csc_matrix[np.complex128], /, diff --git a/scipy-stubs/sparse/_csr.pyi b/scipy-stubs/sparse/_csr.pyi index a5a9435f..5444255d 100644 --- a/scipy-stubs/sparse/_csr.pyi +++ b/scipy-stubs/sparse/_csr.pyi @@ -120,7 +120,7 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[float] | None + @overload # 1-d shape-like, dtype: float64-like | None def __init__( self: csr_array[np.float64, tuple[int]], /, @@ -131,7 +131,7 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[float] | None + @overload # 2-d shape-like, dtype: float64-like | None def __init__( self: csr_array[np.float64, tuple[int, int]], /, @@ -142,7 +142,7 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[bool] (positional) + @overload # 1-d shape-like, dtype: bool-like (positional) def __init__( self: csr_array[np.bool_, tuple[int]], /, @@ -153,7 +153,7 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[bool] (keyword) + @overload # 1-d shape-like, dtype: bool-like (keyword) def __init__( self: csr_array[np.bool_, tuple[int]], /, @@ -164,7 +164,7 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[bool] (positional) + @overload # 2-d shape-like, dtype: bool-like (positional) def __init__( self: csr_array[np.bool_, tuple[int, int]], /, @@ -175,7 +175,7 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[bool] (keyword) + @overload # 2-d shape-like, dtype: bool-like (keyword) def __init__( self: csr_array[np.bool_, tuple[int, int]], /, @@ -186,7 +186,7 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[int] (positional) + @overload # 1-d shape-like, dtype: int-like (positional) def __init__( self: csr_array[np.int64, tuple[int]], /, @@ -197,7 +197,7 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[int] (keyword) + @overload # 1-d shape-like, dtype: int-like (keyword) def __init__( self: csr_array[np.int64, tuple[int]], /, @@ -208,7 +208,7 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[int] (positional) + @overload # 2-d shape-like, dtype: int-like (positional) def __init__( self: csr_array[np.int64, tuple[int, int]], /, @@ -219,7 +219,7 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[int] (keyword) + @overload # 2-d shape-like, dtype: int-like (keyword) def __init__( self: csr_array[np.int64, tuple[int, int]], /, @@ -230,7 +230,7 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[complex] (positional) + @overload # 1-d shape-like, dtype: complex128-like (positional) def __init__( self: csr_array[np.complex128, tuple[int]], /, @@ -241,7 +241,7 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[complex] (keyword) + @overload # 1-d shape-like, dtype: complex128-like (keyword) def __init__( self: csr_array[np.complex128, tuple[int]], /, @@ -252,7 +252,7 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[complex] (positional) + @overload # 2-d shape-like, dtype: complex128-like (positional) def __init__( self: csr_array[np.complex128, tuple[int, int]], /, @@ -263,7 +263,7 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[complex] (keyword) + @overload # 2-d shape-like, dtype: complex128-like (keyword) def __init__( self: csr_array[np.complex128, tuple[int, int]], /, @@ -274,7 +274,7 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 1-d array-like bool, dtype: type[bool] | None + @overload # 1-d array-like bool, dtype: bool-like | None def __init__( self: csr_array[np.bool_, tuple[int]], /, @@ -285,7 +285,7 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d array-like bool, dtype: type[bool] | None + @overload # 2-d array-like bool, dtype: bool-like | None def __init__( self: csr_array[np.bool_, tuple[int, int]], /, @@ -296,7 +296,7 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 1-d array-like ~int, dtype: type[int] | None + @overload # 1-d array-like ~int, dtype: int-like | None def __init__( self: csr_array[np.int64, tuple[int]], /, @@ -307,7 +307,7 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d array-like ~int, dtype: type[int] | None + @overload # 2-d array-like ~int, dtype: int-like | None def __init__( self: csr_array[np.int64, tuple[int, int]], /, @@ -318,7 +318,7 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 1-d array-like ~float, dtype: type[float] | None + @overload # 1-d array-like ~float, dtype: float64-like | None def __init__( self: csr_array[np.float64, tuple[int]], /, @@ -329,7 +329,7 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d array-like ~float, dtype: type[float] | None + @overload # 2-d array-like ~float, dtype: float64-like | None def __init__( self: csr_array[np.float64, tuple[int, int]], /, @@ -340,7 +340,7 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 1-d array-like ~complex, dtype: type[complex] | None + @overload # 1-d array-like ~complex, dtype: complex128-like | None def __init__( self: csr_array[np.complex128, tuple[int]], /, @@ -351,7 +351,7 @@ class csr_array(_csr_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d array-like ~complex, dtype: type[complex] | None + @overload # 2-d array-like ~complex, dtype: complex128-like | None def __init__( self: csr_array[np.complex128, tuple[int, int]], /, @@ -468,7 +468,7 @@ class csr_matrix(_csr_base[_ScalarT_co], spmatrix[_ScalarT_co], Generic[_ScalarT *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d array-like bool, dtype: type[bool] | None + @overload # 2-d array-like bool, dtype: bool-like | None def __init__( self: csr_matrix[np.bool_], /, @@ -479,7 +479,7 @@ class csr_matrix(_csr_base[_ScalarT_co], spmatrix[_ScalarT_co], Generic[_ScalarT *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d array-like ~int, dtype: type[int] | None + @overload # 2-d array-like ~int, dtype: int-like | None def __init__( self: csr_matrix[np.int64], /, @@ -490,7 +490,7 @@ class csr_matrix(_csr_base[_ScalarT_co], spmatrix[_ScalarT_co], Generic[_ScalarT *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d array-like ~float, dtype: type[float] | None + @overload # 2-d array-like ~float, dtype: float64-like | None def __init__( self: csr_matrix[np.float64], /, @@ -501,7 +501,7 @@ class csr_matrix(_csr_base[_ScalarT_co], spmatrix[_ScalarT_co], Generic[_ScalarT *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d array-like ~complex, dtype: type[complex] | None + @overload # 2-d array-like ~complex, dtype: complex128-like | None def __init__( self: csr_matrix[np.complex128], /, diff --git a/scipy-stubs/sparse/_dia.pyi b/scipy-stubs/sparse/_dia.pyi index fdef369a..1fbadd27 100644 --- a/scipy-stubs/sparse/_dia.pyi +++ b/scipy-stubs/sparse/_dia.pyi @@ -82,7 +82,7 @@ class dia_array(_dia_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[float] | None + @overload # 2-d shape-like, dtype: float64-like | None def __init__( self: dia_array[np.float64], /, @@ -93,7 +93,7 @@ class dia_array(_dia_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[bool] (positional) + @overload # 2-d shape-like, dtype: bool-like (positional) def __init__( self: dia_array[np.bool_], /, @@ -104,7 +104,7 @@ class dia_array(_dia_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[bool] (keyword) + @overload # 2-d shape-like, dtype: bool-like (keyword) def __init__( self: dia_array[np.bool_], /, @@ -115,7 +115,7 @@ class dia_array(_dia_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[int] (positional) + @overload # 2-d shape-like, dtype: int-like (positional) def __init__( self: dia_array[np.int64], /, @@ -126,7 +126,7 @@ class dia_array(_dia_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[int] (keyword) + @overload # 2-d shape-like, dtype: int-like (keyword) def __init__( self: dia_array[np.int64], /, @@ -137,7 +137,7 @@ class dia_array(_dia_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[complex] (positional) + @overload # 2-d shape-like, dtype: complex128-like (positional) def __init__( self: dia_array[np.complex128], /, @@ -148,7 +148,7 @@ class dia_array(_dia_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[complex] (keyword) + @overload # 2-d shape-like, dtype: complex128-like (keyword) def __init__( self: dia_array[np.complex128], /, @@ -159,7 +159,7 @@ class dia_array(_dia_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.bool, dtype: type[bool] | None + @overload # matrix-like builtins.bool, dtype: bool-like | None def __init__( self: dia_array[np.bool_], /, @@ -170,7 +170,7 @@ class dia_array(_dia_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.int, dtype: type[int] | None + @overload # matrix-like builtins.int, dtype: int-like | None def __init__( self: dia_array[np.int_], /, @@ -181,7 +181,7 @@ class dia_array(_dia_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.float, dtype: type[float] | None + @overload # matrix-like builtins.float, dtype: float64-like | None def __init__( self: dia_array[np.float64], /, @@ -192,7 +192,7 @@ class dia_array(_dia_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.complex, dtype: type[complex] | None + @overload # matrix-like builtins.complex, dtype: complex128-like | None def __init__( self: dia_array[np.complex128], /, @@ -265,7 +265,7 @@ class dia_matrix(_dia_base[_ScalarT_co], spmatrix[_ScalarT_co], Generic[_ScalarT *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.bool, dtype: type[bool] | None + @overload # matrix-like builtins.bool, dtype: bool-like | None def __init__( self: dia_matrix[np.bool_], /, @@ -276,7 +276,7 @@ class dia_matrix(_dia_base[_ScalarT_co], spmatrix[_ScalarT_co], Generic[_ScalarT *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.int, dtype: type[int] | None + @overload # matrix-like builtins.int, dtype: int-like | None def __init__( self: dia_matrix[np.int_], /, @@ -287,7 +287,7 @@ class dia_matrix(_dia_base[_ScalarT_co], spmatrix[_ScalarT_co], Generic[_ScalarT *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.float, dtype: type[float] | None + @overload # matrix-like builtins.float, dtype: float64-like | None def __init__( self: dia_matrix[np.float64], /, @@ -298,7 +298,7 @@ class dia_matrix(_dia_base[_ScalarT_co], spmatrix[_ScalarT_co], Generic[_ScalarT *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.complex, dtype: type[complex] | None + @overload # matrix-like builtins.complex, dtype: complex128-like | None def __init__( self: dia_matrix[np.complex128], /, diff --git a/scipy-stubs/sparse/_dok.pyi b/scipy-stubs/sparse/_dok.pyi index 26020310..cf2ebd89 100644 --- a/scipy-stubs/sparse/_dok.pyi +++ b/scipy-stubs/sparse/_dok.pyi @@ -212,7 +212,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[float] | None + @overload # 1-d shape-like, dtype: float64-like | None def __init__( self: dok_array[np.float64, _1D], /, @@ -223,7 +223,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[float] | None + @overload # 2-d shape-like, dtype: float64-like | None def __init__( self: dok_array[np.float64, _2D], /, @@ -234,7 +234,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[bool] (positional) + @overload # 1-d shape-like, dtype: bool-like (positional) def __init__( self: dok_array[np.bool_, _1D], /, @@ -245,7 +245,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[bool] (keyword) + @overload # 1-d shape-like, dtype: bool-like (keyword) def __init__( self: dok_array[np.bool_, _1D], /, @@ -256,7 +256,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[bool] (positional) + @overload # 2-d shape-like, dtype: bool-like (positional) def __init__( self: dok_array[np.bool_, _2D], /, @@ -267,7 +267,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[bool] (keyword) + @overload # 2-d shape-like, dtype: bool-like (keyword) def __init__( self: dok_array[np.bool_, _2D], /, @@ -278,7 +278,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[int] (positional) + @overload # 1-d shape-like, dtype: int-like (positional) def __init__( self: dok_array[np.int64, _1D], /, @@ -289,7 +289,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[int] (keyword) + @overload # 1-d shape-like, dtype: int-like (keyword) def __init__( self: dok_array[np.int64, _1D], /, @@ -300,7 +300,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[int] (positional) + @overload # 2-d shape-like, dtype: int-like (positional) def __init__( self: dok_array[np.int64, _2D], /, @@ -311,7 +311,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[int] (keyword) + @overload # 2-d shape-like, dtype: int-like (keyword) def __init__( self: dok_array[np.int64, _2D], /, @@ -322,7 +322,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[complex] (positional) + @overload # 1-d shape-like, dtype: complex128-like (positional) def __init__( self: dok_array[np.complex128, _1D], /, @@ -333,7 +333,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 1-d shape-like, dtype: type[complex] (keyword) + @overload # 1-d shape-like, dtype: complex128-like (keyword) def __init__( self: dok_array[np.complex128, _1D], /, @@ -344,7 +344,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[complex] (positional) + @overload # 2-d shape-like, dtype: complex128-like (positional) def __init__( self: dok_array[np.complex128, _2D], /, @@ -355,7 +355,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[complex] (keyword) + @overload # 2-d shape-like, dtype: complex128-like (keyword) def __init__( self: dok_array[np.complex128, _2D], /, @@ -366,7 +366,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 1-d array-like bool, dtype: type[bool] | None + @overload # 1-d array-like bool, dtype: bool-like | None def __init__( self: dok_array[np.bool_, _1D], /, @@ -377,7 +377,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d array-like bool, dtype: type[bool] | None + @overload # 2-d array-like bool, dtype: bool-like | None def __init__( self: dok_array[np.bool_, _2D], /, @@ -388,7 +388,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 1-d array-like ~int, dtype: type[int] | None + @overload # 1-d array-like ~int, dtype: int-like | None def __init__( self: dok_array[np.int64, _1D], /, @@ -399,7 +399,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d array-like ~int, dtype: type[int] | None + @overload # 2-d array-like ~int, dtype: int-like | None def __init__( self: dok_array[np.int64, _2D], /, @@ -410,7 +410,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 1-d array-like ~float, dtype: type[float] | None + @overload # 1-d array-like ~float, dtype: float64-like | None def __init__( self: dok_array[np.float64, _1D], /, @@ -421,7 +421,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d array-like ~float, dtype: type[float] | None + @overload # 2-d array-like ~float, dtype: float64-like | None def __init__( self: dok_array[np.float64, _2D], /, @@ -432,7 +432,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 1-d array-like ~complex, dtype: type[complex] | None + @overload # 1-d array-like ~complex, dtype: complex128-like | None def __init__( self: dok_array[np.complex128, _1D], /, @@ -443,7 +443,7 @@ class dok_array(_dok_base[_ScalarT_co, _ShapeT_co], sparray[_ScalarT_co, _ShapeT *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d array-like ~complex, dtype: type[complex] | None + @overload # 2-d array-like ~complex, dtype: complex128-like | None def __init__( self: dok_array[np.complex128, _2D], /, @@ -623,7 +623,7 @@ class dok_matrix(_dok_base[_ScalarT_co, _2D], spmatrix[_ScalarT_co], Generic[_Sc *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.bool, dtype: type[bool] | None + @overload # matrix-like builtins.bool, dtype: bool-like | None def __init__( self: dok_matrix[np.bool_], /, @@ -634,7 +634,7 @@ class dok_matrix(_dok_base[_ScalarT_co, _2D], spmatrix[_ScalarT_co], Generic[_Sc *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.int, dtype: type[int] | None + @overload # matrix-like builtins.int, dtype: int-like | None def __init__( self: dok_matrix[np.int64], /, @@ -645,7 +645,7 @@ class dok_matrix(_dok_base[_ScalarT_co, _2D], spmatrix[_ScalarT_co], Generic[_Sc *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.float, dtype: type[float] | None + @overload # matrix-like builtins.float, dtype: float64-like | None def __init__( self: dok_matrix[np.float64], /, @@ -656,7 +656,7 @@ class dok_matrix(_dok_base[_ScalarT_co, _2D], spmatrix[_ScalarT_co], Generic[_Sc *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.complex, dtype: type[complex] | None + @overload # matrix-like builtins.complex, dtype: complex128-like | None def __init__( self: dok_matrix[np.complex128], /, diff --git a/scipy-stubs/sparse/_lil.pyi b/scipy-stubs/sparse/_lil.pyi index 1b0cee37..c4344512 100644 --- a/scipy-stubs/sparse/_lil.pyi +++ b/scipy-stubs/sparse/_lil.pyi @@ -103,7 +103,7 @@ class lil_array(_lil_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[float] | None + @overload # 2-d shape-like, dtype: float64-like | None def __init__( self: lil_array[np.float64], /, @@ -114,7 +114,7 @@ class lil_array(_lil_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[bool] (positional) + @overload # 2-d shape-like, dtype: bool-like (positional) def __init__( self: lil_array[np.bool_], /, @@ -125,7 +125,7 @@ class lil_array(_lil_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[bool] (keyword) + @overload # 2-d shape-like, dtype: bool-like (keyword) def __init__( self: lil_array[np.bool_], /, @@ -136,7 +136,7 @@ class lil_array(_lil_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[int] (positional) + @overload # 2-d shape-like, dtype: int-like (positional) def __init__( self: lil_array[np.int64], /, @@ -147,7 +147,7 @@ class lil_array(_lil_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[int] (keyword) + @overload # 2-d shape-like, dtype: int-like (keyword) def __init__( self: lil_array[np.int64], /, @@ -158,7 +158,7 @@ class lil_array(_lil_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[complex] (positional) + @overload # 2-d shape-like, dtype: complex128-like (positional) def __init__( self: lil_array[np.complex128], /, @@ -169,7 +169,7 @@ class lil_array(_lil_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # 2-d shape-like, dtype: type[complex] (keyword) + @overload # 2-d shape-like, dtype: complex128-like (keyword) def __init__( self: lil_array[np.complex128], /, @@ -180,7 +180,7 @@ class lil_array(_lil_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G copy: bool = False, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.bool, dtype: type[bool] | None + @overload # matrix-like builtins.bool, dtype: bool-like | None def __init__( self: lil_array[np.bool_], /, @@ -191,7 +191,7 @@ class lil_array(_lil_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.int, dtype: type[int] | None + @overload # matrix-like builtins.int, dtype: int-like | None def __init__( self: lil_array[np.int_], /, @@ -202,7 +202,7 @@ class lil_array(_lil_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.float, dtype: type[float] | None + @overload # matrix-like builtins.float, dtype: float64-like | None def __init__( self: lil_array[np.float64], /, @@ -213,7 +213,7 @@ class lil_array(_lil_base[_ScalarT_co], sparray[_ScalarT_co, tuple[int, int]], G *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.complex, dtype: type[complex] | None + @overload # matrix-like builtins.complex, dtype: complex128-like | None def __init__( self: lil_array[np.complex128], /, @@ -295,7 +295,7 @@ class lil_matrix(_lil_base[_ScalarT_co], spmatrix[_ScalarT_co], Generic[_ScalarT *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.bool, dtype: type[bool] | None + @overload # matrix-like builtins.bool, dtype: bool-like | None def __init__( self: lil_matrix[np.bool_], /, @@ -306,7 +306,7 @@ class lil_matrix(_lil_base[_ScalarT_co], spmatrix[_ScalarT_co], Generic[_ScalarT *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.int, dtype: type[int] | None + @overload # matrix-like builtins.int, dtype: int-like | None def __init__( self: lil_matrix[np.int_], /, @@ -317,7 +317,7 @@ class lil_matrix(_lil_base[_ScalarT_co], spmatrix[_ScalarT_co], Generic[_ScalarT *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.float, dtype: type[float] | None + @overload # matrix-like builtins.float, dtype: float64-like | None def __init__( self: lil_matrix[np.float64], /, @@ -328,7 +328,7 @@ class lil_matrix(_lil_base[_ScalarT_co], spmatrix[_ScalarT_co], Generic[_ScalarT *, maxprint: int | None = None, ) -> None: ... - @overload # matrix-like builtins.complex, dtype: type[complex] | None + @overload # matrix-like builtins.complex, dtype: complex128-like | None def __init__( self: lil_matrix[np.complex128], /,