From 060db27201bbf2048e0c581c4a97ef13d8040dd6 Mon Sep 17 00:00:00 2001 From: Pavadol Yamsiri Date: Sat, 5 Oct 2024 19:22:51 +1000 Subject: [PATCH] `sparse`: Add re-exported functions to `__all__` for public private submodules --- scipy-stubs/sparse/base.pyi | 31 ++++++++++++++++-- scipy-stubs/sparse/bsr.pyi | 27 ++++++++++++++-- scipy-stubs/sparse/compressed.pyi | 36 +++++++++++++++++++-- scipy-stubs/sparse/construct.pyi | 42 +++++++++++++++++++++++-- scipy-stubs/sparse/coo.pyi | 28 +++++++++++++++-- scipy-stubs/sparse/csc.pyi | 9 ++++-- scipy-stubs/sparse/csr.pyi | 18 +++++++++-- scipy-stubs/sparse/data.pyi | 9 ++++-- scipy-stubs/sparse/dia.pyi | 25 +++++++++++++-- scipy-stubs/sparse/dok.pyi | 26 +++++++++++++-- scipy-stubs/sparse/extract.pyi | 8 +++-- scipy-stubs/sparse/lil.pyi | 8 +++-- scipy-stubs/sparse/linalg/dsolve.pyi | 8 +++-- scipy-stubs/sparse/linalg/eigen.pyi | 8 +++-- scipy-stubs/sparse/linalg/interface.pyi | 8 +++-- scipy-stubs/sparse/linalg/isolve.pyi | 8 +++-- scipy-stubs/sparse/linalg/matfuncs.pyi | 10 ++++-- scipy-stubs/sparse/sparsetools.pyi | 5 +-- scipy-stubs/sparse/spfuncs.pyi | 5 +-- scipy-stubs/sparse/sputils.pyi | 5 +-- 20 files changed, 261 insertions(+), 63 deletions(-) diff --git a/scipy-stubs/sparse/base.pyi b/scipy-stubs/sparse/base.pyi index bc0eb39c..6c137972 100644 --- a/scipy-stubs/sparse/base.pyi +++ b/scipy-stubs/sparse/base.pyi @@ -1,4 +1,29 @@ -from scipy._typing import Untyped +# This module is not meant for public use and will be removed in SciPy v2.0.0. +# This stub simply re-exports the imported functions. +from ._base import ( + MAXPRINT, + SparseEfficiencyWarning, + SparseFormatWarning, + SparseWarning, + issparse, + isspmatrix, + spmatrix, +) +from ._sputils import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [ + "MAXPRINT", + "SparseEfficiencyWarning", + "SparseFormatWarning", + "SparseWarning", + "asmatrix", + "check_reshape_kwargs", + "check_shape", + "get_sum_dtype", + "isdense", + "isscalarlike", + "issparse", + "isspmatrix", + "spmatrix", + "validateaxis", +] diff --git a/scipy-stubs/sparse/bsr.pyi b/scipy-stubs/sparse/bsr.pyi index bc0eb39c..eec888d2 100644 --- a/scipy-stubs/sparse/bsr.pyi +++ b/scipy-stubs/sparse/bsr.pyi @@ -1,4 +1,25 @@ -from scipy._typing import Untyped +# This module is not meant for public use and will be removed in SciPy v2.0.0. +# This stub simply re-exports the imported functions. +# TODO: Add type annotated dummy functions marked deprecated. +# TODO: The imports are actually from a generated file which doesn't currently have a stub. +from ._bsr import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [ + "bsr_matmat", + "bsr_matrix", + "bsr_matvec", + "bsr_matvecs", + "bsr_sort_indices", + "bsr_tocsr", + "bsr_transpose", + "check_shape", + "csr_matmat_maxnnz", + "getdata", + "getdtype", + "isshape", + "isspmatrix_bsr", + "spmatrix", + "to_native", + "upcast", + "warn", +] diff --git a/scipy-stubs/sparse/compressed.pyi b/scipy-stubs/sparse/compressed.pyi index bc0eb39c..d8528b07 100644 --- a/scipy-stubs/sparse/compressed.pyi +++ b/scipy-stubs/sparse/compressed.pyi @@ -1,4 +1,34 @@ -from scipy._typing import Untyped +# This module is not meant for public use and will be removed in SciPy v2.0.0. +# This stub simply re-exports the imported functions. +# TODO: Add type annotated dummy functions marked deprecated. +from ._base import * +from ._compressed import * +from ._index import * +from ._sputils import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [ + "IndexMixin", + "SparseEfficiencyWarning", + "check_shape", + "csr_column_index1", + "csr_column_index2", + "csr_row_index", + "csr_row_slice", + "csr_sample_offsets", + "csr_sample_values", + "csr_todense", + "downcast_intp_index", + "get_csr_submatrix", + "get_sum_dtype", + "getdtype", + "is_pydata_spmatrix", + "isdense", + "isintlike", + "isscalarlike", + "isshape", + "operator", + "to_native", + "upcast", + "upcast_char", + "warn", +] diff --git a/scipy-stubs/sparse/construct.pyi b/scipy-stubs/sparse/construct.pyi index bc0eb39c..eb3199e0 100644 --- a/scipy-stubs/sparse/construct.pyi +++ b/scipy-stubs/sparse/construct.pyi @@ -1,4 +1,40 @@ -from scipy._typing import Untyped +# This module is not meant for public use and will be removed in SciPy v2.0.0. +# This stub simply re-exports the imported functions. +# TODO: Add type annotated dummy functions marked deprecated. +# TODO: The imports are actually from a generated file which doesn't currently have a stub. +from scipy._lib._util import check_random_state, rng_integers +from ._base import * +from ._bsr import bsr_matrix +from ._construct import * +from ._coo import coo_matrix +from ._csc import csc_matrix +from ._csr import csr_matrix +from ._dia import dia_matrix +from ._sputils import get_index_dtype, isscalarlike, upcast -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [ + "block_diag", + "bmat", + "bsr_matrix", + "check_random_state", + "coo_matrix", + "csc_matrix", + "csr_hstack", + "csr_matrix", + "dia_matrix", + "diags", + "eye", + "get_index_dtype", + "hstack", + "identity", + "isscalarlike", + "issparse", + "kron", + "kronsum", + "rand", + "random", + "rng_integers", + "spdiags", + "upcast", + "vstack", +] diff --git a/scipy-stubs/sparse/coo.pyi b/scipy-stubs/sparse/coo.pyi index bc0eb39c..93fd8ff8 100644 --- a/scipy-stubs/sparse/coo.pyi +++ b/scipy-stubs/sparse/coo.pyi @@ -1,4 +1,26 @@ -from scipy._typing import Untyped +# This module is not meant for public use and will be removed in SciPy v2.0.0. +# This stub simply re-exports the imported functions. +# TODO: Add type annotated dummy functions marked deprecated. +# TODO: The imports are actually from a generated file which doesn't currently have a stub. +from ._coo import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [ + "SparseEfficiencyWarning", + "check_reshape_kwargs", + "check_shape", + "coo_matrix", + "coo_matvec", + "coo_tocsr", + "coo_todense", + "downcast_intp_index", + "getdata", + "getdtype", + "isshape", + "isspmatrix_coo", + "operator", + "spmatrix", + "to_native", + "upcast", + "upcast_char", + "warn", +] diff --git a/scipy-stubs/sparse/csc.pyi b/scipy-stubs/sparse/csc.pyi index bc0eb39c..c2d983c6 100644 --- a/scipy-stubs/sparse/csc.pyi +++ b/scipy-stubs/sparse/csc.pyi @@ -1,4 +1,7 @@ -from scipy._typing import Untyped +# This module is not meant for public use and will be removed in SciPy v2.0.0. +# This stub simply re-exports the imported functions. +# TODO: Add type annotated dummy functions marked deprecated. +# TODO: The imports are actually from a generated file which doesn't currently have a stub. +from ._csc import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["csc_matrix", "csc_tocsr", "expandptr", "isspmatrix_csc", "spmatrix", "upcast"] diff --git a/scipy-stubs/sparse/csr.pyi b/scipy-stubs/sparse/csr.pyi index bc0eb39c..e67beb46 100644 --- a/scipy-stubs/sparse/csr.pyi +++ b/scipy-stubs/sparse/csr.pyi @@ -1,4 +1,16 @@ -from scipy._typing import Untyped +# This module is not meant for public use and will be removed in SciPy v2.0.0. +# This stub simply re-exports the imported functions. +# TODO: Add type annotated dummy functions marked deprecated. +# TODO: The imports are actually from a generated file which doesn't currently have a stub. +from ._csr import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [ + "csr_count_blocks", + "csr_matrix", + "csr_tobsr", + "csr_tocsc", + "get_csr_submatrix", + "isspmatrix_csr", + "spmatrix", + "upcast", +] diff --git a/scipy-stubs/sparse/data.pyi b/scipy-stubs/sparse/data.pyi index bc0eb39c..a9dd621e 100644 --- a/scipy-stubs/sparse/data.pyi +++ b/scipy-stubs/sparse/data.pyi @@ -1,4 +1,7 @@ -from scipy._typing import Untyped +# This module is not meant for public use and will be removed in SciPy v2.0.0. +# This stub simply re-exports the imported functions. +# TODO: Add type annotated dummy functions marked deprecated. +# TODO: Exported functions are missing from private module +from ._data import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["isscalarlike", "name", "npfunc", "validateaxis"] diff --git a/scipy-stubs/sparse/dia.pyi b/scipy-stubs/sparse/dia.pyi index bc0eb39c..a429fe44 100644 --- a/scipy-stubs/sparse/dia.pyi +++ b/scipy-stubs/sparse/dia.pyi @@ -1,4 +1,23 @@ -from scipy._typing import Untyped +# This module is not meant for public use and will be removed in SciPy v2.0.0. +# This stub simply re-exports the imported functions. +# TODO: Add type annotated dummy functions marked deprecated. +# TODO: The imports are actually from a generated file which doesn't currently have a stub. +from ._base import * +from ._construct import * +from ._dia import * +from ._dia import dia_matrix +from ._matrix import spmatrix +from ._sputils import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [ + "check_shape", + "dia_matrix", + "dia_matvec", + "get_sum_dtype", + "getdtype", + "isshape", + "isspmatrix_dia", + "spmatrix", + "upcast_char", + "validateaxis", +] diff --git a/scipy-stubs/sparse/dok.pyi b/scipy-stubs/sparse/dok.pyi index bc0eb39c..318de431 100644 --- a/scipy-stubs/sparse/dok.pyi +++ b/scipy-stubs/sparse/dok.pyi @@ -1,4 +1,24 @@ -from scipy._typing import Untyped +# This module is not meant for public use and will be removed in SciPy v2.0.0. +# This stub simply re-exports the imported functions. +# TODO: Add type annotated dummy functions marked deprecated. +# TODO: The imports are actually from a generated file which doesn't currently have a stub. -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +from ._dok import * +from ._index import IndexMixin +from ._matrix import spmatrix +from ._sputils import check_shape, getdtype, isdense, isintlike, isscalarlike, isshape, upcast, upcast_scalar + +__all__ = [ + "IndexMixin", + "check_shape", + "dok_matrix", + "getdtype", + "isdense", + "isintlike", + "isscalarlike", + "isshape", + "isspmatrix_dok", + "spmatrix", + "upcast", + "upcast_scalar", +] diff --git a/scipy-stubs/sparse/extract.pyi b/scipy-stubs/sparse/extract.pyi index bc0eb39c..b47790a9 100644 --- a/scipy-stubs/sparse/extract.pyi +++ b/scipy-stubs/sparse/extract.pyi @@ -1,4 +1,6 @@ -from scipy._typing import Untyped +# This module is not meant for public use and will be removed in SciPy v2.0.0. +# This stub simply re-exports the imported functions. +# TODO: Add type annotated dummy functions marked deprecated. +from ._extract import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["coo_matrix", "find", "tril", "triu"] diff --git a/scipy-stubs/sparse/lil.pyi b/scipy-stubs/sparse/lil.pyi index bc0eb39c..03322321 100644 --- a/scipy-stubs/sparse/lil.pyi +++ b/scipy-stubs/sparse/lil.pyi @@ -1,4 +1,6 @@ -from scipy._typing import Untyped +# This module is not meant for public use and will be removed in SciPy v2.0.0. +# This stub simply re-exports the imported functions. +# TODO: Add type annotated dummy functions marked deprecated. +from ._lil import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["isspmatrix_lil", "lil_array", "lil_matrix"] diff --git a/scipy-stubs/sparse/linalg/dsolve.pyi b/scipy-stubs/sparse/linalg/dsolve.pyi index bc0eb39c..b9266e0d 100644 --- a/scipy-stubs/sparse/linalg/dsolve.pyi +++ b/scipy-stubs/sparse/linalg/dsolve.pyi @@ -1,4 +1,6 @@ -from scipy._typing import Untyped +# This module is not meant for public use and will be removed in SciPy v2.0.0. +# This stub simply re-exports the imported functions. +# TODO: Add type annotated dummy functions marked deprecated. +from ._dsolve import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["MatrixRankWarning", "SuperLU", "factorized", "spilu", "splu", "spsolve", "spsolve_triangular", "use_solver"] diff --git a/scipy-stubs/sparse/linalg/eigen.pyi b/scipy-stubs/sparse/linalg/eigen.pyi index bc0eb39c..01aea71f 100644 --- a/scipy-stubs/sparse/linalg/eigen.pyi +++ b/scipy-stubs/sparse/linalg/eigen.pyi @@ -1,4 +1,6 @@ -from scipy._typing import Untyped +# This module is not meant for public use and will be removed in SciPy v2.0.0. +# This stub simply re-exports the imported functions. +# TODO: Add type annotated dummy functions marked deprecated. +from ._eigen import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["ArpackError", "ArpackError", "ArpackNoConvergence", "eigs", "eigsh", "lobpcg", "svds"] diff --git a/scipy-stubs/sparse/linalg/interface.pyi b/scipy-stubs/sparse/linalg/interface.pyi index bc0eb39c..8bde4336 100644 --- a/scipy-stubs/sparse/linalg/interface.pyi +++ b/scipy-stubs/sparse/linalg/interface.pyi @@ -1,4 +1,6 @@ -from scipy._typing import Untyped +# This module is not meant for public use and will be removed in SciPy v2.0.0. +# This stub simply re-exports the imported functions. +# TODO: Add type annotated dummy functions marked deprecated. +from ._interface import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["LinearOperator", "aslinearoperator"] diff --git a/scipy-stubs/sparse/linalg/isolve.pyi b/scipy-stubs/sparse/linalg/isolve.pyi index bc0eb39c..124ce0e1 100644 --- a/scipy-stubs/sparse/linalg/isolve.pyi +++ b/scipy-stubs/sparse/linalg/isolve.pyi @@ -1,4 +1,6 @@ -from scipy._typing import Untyped +# This module is not meant for public use and will be removed in SciPy v2.0.0. +# This stub simply re-exports the imported functions. +# TODO: Add type annotated dummy functions marked deprecated. +from ._isolve import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["bicg", "bicgstab", "cg", "cgs", "gcrotmk", "gmres", "lgmres", "lsmr", "lsqr", "minres", "qmr", "tfqmr"] diff --git a/scipy-stubs/sparse/linalg/matfuncs.pyi b/scipy-stubs/sparse/linalg/matfuncs.pyi index bc0eb39c..33ee122d 100644 --- a/scipy-stubs/sparse/linalg/matfuncs.pyi +++ b/scipy-stubs/sparse/linalg/matfuncs.pyi @@ -1,4 +1,8 @@ -from scipy._typing import Untyped +# This module is not meant for public use and will be removed in SciPy v2.0.0. +# This stub simply re-exports the imported functions. +# TODO: Add type annotated dummy functions marked deprecated. +from ._dsolve import spsolve +from ._interface import * +from ._matfuncs import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["LinearOperator", "expm", "inv", "spsolve"] diff --git a/scipy-stubs/sparse/sparsetools.pyi b/scipy-stubs/sparse/sparsetools.pyi index bc0eb39c..a9a2c5b3 100644 --- a/scipy-stubs/sparse/sparsetools.pyi +++ b/scipy-stubs/sparse/sparsetools.pyi @@ -1,4 +1 @@ -from scipy._typing import Untyped - -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [] diff --git a/scipy-stubs/sparse/spfuncs.pyi b/scipy-stubs/sparse/spfuncs.pyi index bc0eb39c..a9a2c5b3 100644 --- a/scipy-stubs/sparse/spfuncs.pyi +++ b/scipy-stubs/sparse/spfuncs.pyi @@ -1,4 +1 @@ -from scipy._typing import Untyped - -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [] diff --git a/scipy-stubs/sparse/sputils.pyi b/scipy-stubs/sparse/sputils.pyi index bc0eb39c..a9a2c5b3 100644 --- a/scipy-stubs/sparse/sputils.pyi +++ b/scipy-stubs/sparse/sputils.pyi @@ -1,4 +1 @@ -from scipy._typing import Untyped - -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = []