From ca5b42c8335ac1bf3a19756fcd5fbe06b2b81e7d Mon Sep 17 00:00:00 2001 From: Pavadol Yamsiri Date: Sat, 5 Oct 2024 18:11:26 +1000 Subject: [PATCH 01/22] `odr`: Add re-exported functions to `__all__` for public private submodules --- scipy-stubs/odr/models.pyi | 8 +++++--- scipy-stubs/odr/odrpack.pyi | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/scipy-stubs/odr/models.pyi b/scipy-stubs/odr/models.pyi index bc0eb39c..4e058999 100644 --- a/scipy-stubs/odr/models.pyi +++ b/scipy-stubs/odr/models.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 ._models import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["Model", "exponential", "multilinear", "polynomial", "quadratic", "unilinear"] diff --git a/scipy-stubs/odr/odrpack.pyi b/scipy-stubs/odr/odrpack.pyi index bc0eb39c..400ec152 100644 --- a/scipy-stubs/odr/odrpack.pyi +++ b/scipy-stubs/odr/odrpack.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 ._odrpack import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["ODR", "Data", "Model", "OdrError", "OdrStop", "OdrWarning", "Output", "RealData", "odr", "odr_error", "odr_stop"] From d2410fbe18bbfd105ddc970908e3534e93294159 Mon Sep 17 00:00:00 2001 From: Pavadol Yamsiri Date: Sat, 5 Oct 2024 18:16:21 +1000 Subject: [PATCH 02/22] `fftpack`: Add re-exported functions to `__all__` for public private submodules --- scipy-stubs/fftpack/basic.pyi | 8 +++++--- scipy-stubs/fftpack/helper.pyi | 8 +++++--- scipy-stubs/fftpack/pseudo_diffs.pyi | 9 ++++++--- scipy-stubs/fftpack/realtransforms.pyi | 8 +++++--- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/scipy-stubs/fftpack/basic.pyi b/scipy-stubs/fftpack/basic.pyi index bc0eb39c..aa742267 100644 --- a/scipy-stubs/fftpack/basic.pyi +++ b/scipy-stubs/fftpack/basic.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 ._basic import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["fft", "fft2", "fftn", "ifft", "ifft2", "ifftn", "irfft", "rfft"] diff --git a/scipy-stubs/fftpack/helper.pyi b/scipy-stubs/fftpack/helper.pyi index bc0eb39c..9167771a 100644 --- a/scipy-stubs/fftpack/helper.pyi +++ b/scipy-stubs/fftpack/helper.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 ._helper import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["fftfreq", "fftshift", "ifftshift", "next_fast_len", "rfftfreq"] diff --git a/scipy-stubs/fftpack/pseudo_diffs.pyi b/scipy-stubs/fftpack/pseudo_diffs.pyi index bc0eb39c..76f9cf58 100644 --- a/scipy-stubs/fftpack/pseudo_diffs.pyi +++ b/scipy-stubs/fftpack/pseudo_diffs.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. +from . import convolve +from ._pseudo_diffs import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["cc_diff", "convolve", "cs_diff", "diff", "hilbert", "ihilbert", "itilbert", "sc_diff", "shift", "ss_diff", "tilbert"] diff --git a/scipy-stubs/fftpack/realtransforms.pyi b/scipy-stubs/fftpack/realtransforms.pyi index bc0eb39c..51a0a13c 100644 --- a/scipy-stubs/fftpack/realtransforms.pyi +++ b/scipy-stubs/fftpack/realtransforms.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 ._realtransforms import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["dct", "dctn", "dst", "dstn", "idct", "idctn", "idst", "idstn"] From 1d5cd4dc52d542669f7dd3216f589b8ef843e07d Mon Sep 17 00:00:00 2001 From: Pavadol Yamsiri Date: Sat, 5 Oct 2024 18:19:39 +1000 Subject: [PATCH 03/22] `ndimage`: Add re-exported functions to `__all__` for public private submodules --- scipy-stubs/ndimage/filters.pyi | 33 ++++++++++++++++++++++++--- scipy-stubs/ndimage/fourier.pyi | 8 ++++--- scipy-stubs/ndimage/interpolation.pyi | 17 +++++++++++--- scipy-stubs/ndimage/measurements.pyi | 26 ++++++++++++++++++--- scipy-stubs/ndimage/morphology.pyi | 29 ++++++++++++++++++++--- 5 files changed, 98 insertions(+), 15 deletions(-) diff --git a/scipy-stubs/ndimage/filters.pyi b/scipy-stubs/ndimage/filters.pyi index bc0eb39c..76a16185 100644 --- a/scipy-stubs/ndimage/filters.pyi +++ b/scipy-stubs/ndimage/filters.pyi @@ -1,4 +1,31 @@ -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 ._filters import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [ + "convolve", + "convolve1d", + "correlate", + "correlate1d", + "gaussian_filter", + "gaussian_filter1d", + "gaussian_gradient_magnitude", + "gaussian_laplace", + "generic_filter", + "generic_filter1d", + "generic_gradient_magnitude", + "generic_laplace", + "laplace", + "maximum_filter", + "maximum_filter1d", + "median_filter", + "minimum_filter", + "minimum_filter1d", + "percentile_filter", + "prewitt", + "rank_filter", + "sobel", + "uniform_filter", + "uniform_filter1d", +] diff --git a/scipy-stubs/ndimage/fourier.pyi b/scipy-stubs/ndimage/fourier.pyi index bc0eb39c..388ef4e2 100644 --- a/scipy-stubs/ndimage/fourier.pyi +++ b/scipy-stubs/ndimage/fourier.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 ._fourier import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["fourier_ellipsoid", "fourier_gaussian", "fourier_shift", "fourier_uniform"] diff --git a/scipy-stubs/ndimage/interpolation.pyi b/scipy-stubs/ndimage/interpolation.pyi index bc0eb39c..3ba5e7ca 100644 --- a/scipy-stubs/ndimage/interpolation.pyi +++ b/scipy-stubs/ndimage/interpolation.pyi @@ -1,4 +1,15 @@ -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 ._interpolation import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [ + "affine_transform", + "geometric_transform", + "map_coordinates", + "rotate", + "shift", + "spline_filter", + "spline_filter1d", + "zoom", +] diff --git a/scipy-stubs/ndimage/measurements.pyi b/scipy-stubs/ndimage/measurements.pyi index bc0eb39c..c35e2f56 100644 --- a/scipy-stubs/ndimage/measurements.pyi +++ b/scipy-stubs/ndimage/measurements.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. +from ._measurements import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [ + "center_of_mass", + "extrema", + "find_objects", + "histogram", + "label", + "labeled_comprehension", + "maximum", + "maximum_position", + "mean", + "median", + "minimum", + "minimum_position", + "standard_deviation", + "sum", + "sum_labels", + "variance", + "watershed_ift", +] diff --git a/scipy-stubs/ndimage/morphology.pyi b/scipy-stubs/ndimage/morphology.pyi index bc0eb39c..30447dcf 100644 --- a/scipy-stubs/ndimage/morphology.pyi +++ b/scipy-stubs/ndimage/morphology.pyi @@ -1,4 +1,27 @@ -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 ._morphology import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [ + "binary_closing", + "binary_dilation", + "binary_erosion", + "binary_fill_holes", + "binary_hit_or_miss", + "binary_opening", + "binary_propagation", + "black_tophat", + "distance_transform_bf", + "distance_transform_cdt", + "distance_transform_edt", + "generate_binary_structure", + "grey_closing", + "grey_dilation", + "grey_erosion", + "grey_opening", + "iterate_structure", + "morphological_gradient", + "morphological_laplace", + "white_tophat", +] From 5fb38358bbd141ad24d96db123712d7510dc4fd5 Mon Sep 17 00:00:00 2001 From: Pavadol Yamsiri Date: Sat, 5 Oct 2024 18:27:08 +1000 Subject: [PATCH 04/22] `stats`: Add re-exported functions to `__all__` for public private submodules --- scipy-stubs/stats/biasedurn.pyi | 5 +- scipy-stubs/stats/kde.pyi | 8 +-- scipy-stubs/stats/morestats.pyi | 43 ++++++++++++++-- scipy-stubs/stats/mstats_basic.pyi | 67 +++++++++++++++++++++++-- scipy-stubs/stats/mstats_extras.pyi | 19 +++++-- scipy-stubs/stats/mvn.pyi | 5 +- scipy-stubs/stats/stats.pyi | 78 +++++++++++++++++++++++++++-- 7 files changed, 202 insertions(+), 23 deletions(-) diff --git a/scipy-stubs/stats/biasedurn.pyi b/scipy-stubs/stats/biasedurn.pyi index bc0eb39c..a9a2c5b3 100644 --- a/scipy-stubs/stats/biasedurn.pyi +++ b/scipy-stubs/stats/biasedurn.pyi @@ -1,4 +1 @@ -from scipy._typing import Untyped - -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [] diff --git a/scipy-stubs/stats/kde.pyi b/scipy-stubs/stats/kde.pyi index bc0eb39c..2957b7e0 100644 --- a/scipy-stubs/stats/kde.pyi +++ b/scipy-stubs/stats/kde.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 ._kde import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["gaussian_kde"] diff --git a/scipy-stubs/stats/morestats.pyi b/scipy-stubs/stats/morestats.pyi index bc0eb39c..fd093127 100644 --- a/scipy-stubs/stats/morestats.pyi +++ b/scipy-stubs/stats/morestats.pyi @@ -1,4 +1,41 @@ -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 ._mgc import * +from ._morestats import * +from ._mstats_basic import * +from .contingency import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [ + "anderson", + "anderson_ksamp", + "ansari", + "bartlett", + "bayes_mvs", + "boxcox", + "boxcox_llf", + "boxcox_normmax", + "boxcox_normplot", + "chi2_contingency", + "circmean", + "circstd", + "circvar", + "distributions", + "find_repeats", + "fligner", + "kstat", + "kstatvar", + "levene", + "median_test", + "mood", + "mvsdist", + "ppcc_max", + "ppcc_plot", + "probplot", + "shapiro", + "wilcoxon", + "yeojohnson", + "yeojohnson_llf", + "yeojohnson_normmax", + "yeojohnson_normplot", +] diff --git a/scipy-stubs/stats/mstats_basic.pyi b/scipy-stubs/stats/mstats_basic.pyi index bc0eb39c..c6fd7e7f 100644 --- a/scipy-stubs/stats/mstats_basic.pyi +++ b/scipy-stubs/stats/mstats_basic.pyi @@ -1,4 +1,65 @@ -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 ._mstats_basic import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [ + "argstoarray", + "brunnermunzel", + "count_tied_groups", + "describe", + "f_oneway", + "find_repeats", + "friedmanchisquare", + "kendalltau", + "kendalltau_seasonal", + "kruskal", + "kruskalwallis", + "ks_1samp", + "ks_2samp", + "ks_twosamp", + "kstest", + "kurtosis", + "kurtosistest", + "linregress", + "mannwhitneyu", + "meppf", + "mode", + "moment", + "mquantiles", + "msign", + "normaltest", + "obrientransform", + "pearsonr", + "plotting_positions", + "pointbiserialr", + "rankdata", + "scoreatpercentile", + "sem", + "sen_seasonal_slopes", + "siegelslopes", + "skew", + "skewtest", + "spearmanr", + "theilslopes", + "tmax", + "tmean", + "tmin", + "trim", + "trima", + "trimboth", + "trimmed_mean", + "trimmed_std", + "trimmed_stde", + "trimmed_var", + "trimr", + "trimtail", + "tsem", + "ttest_1samp", + "ttest_ind", + "ttest_onesamp", + "ttest_rel", + "tvar", + "variation", + "winsorize", +] diff --git a/scipy-stubs/stats/mstats_extras.pyi b/scipy-stubs/stats/mstats_extras.pyi index bc0eb39c..c745bd35 100644 --- a/scipy-stubs/stats/mstats_extras.pyi +++ b/scipy-stubs/stats/mstats_extras.pyi @@ -1,4 +1,17 @@ -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 ._mstats_extras import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [ + "compare_medians_ms", + "hdmedian", + "hdquantiles", + "hdquantiles_sd", + "idealfourths", + "median_cihs", + "mjci", + "mquantiles_cimj", + "rsh", + "trimmed_mean_ci", +] diff --git a/scipy-stubs/stats/mvn.pyi b/scipy-stubs/stats/mvn.pyi index bc0eb39c..a9a2c5b3 100644 --- a/scipy-stubs/stats/mvn.pyi +++ b/scipy-stubs/stats/mvn.pyi @@ -1,4 +1 @@ -from scipy._typing import Untyped - -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [] diff --git a/scipy-stubs/stats/stats.pyi b/scipy-stubs/stats/stats.pyi index bc0eb39c..fd891a4f 100644 --- a/scipy-stubs/stats/stats.pyi +++ b/scipy-stubs/stats/stats.pyi @@ -1,4 +1,76 @@ -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 . import mstats_basic +from ._mgc import * +from ._stats_py import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [ + "alexandergovern", + "brunnermunzel", + "chisquare", + "combine_pvalues", + "cumfreq", + "describe", + "distributions", + "energy_distance", + "f_oneway", + "find_repeats", + "fisher_exact", + "friedmanchisquare", + "gmean", + "gstd", + "gzscore", + "hmean", + "iqr", + "jarque_bera", + "kendalltau", + "kruskal", + "ks_1samp", + "ks_2samp", + "kstest", + "kurtosis", + "kurtosistest", + "linregress", + "median_abs_deviation", + "mode", + "moment", + "mstats_basic", + "multiscale_graphcorr", + "normaltest", + "obrientransform", + "pearsonr", + "percentileofscore", + "pmean", + "pointbiserialr", + "power_divergence", + "rankdata", + "ranksums", + "relfreq", + "scoreatpercentile", + "sem", + "siegelslopes", + "sigmaclip", + "skew", + "skewtest", + "spearmanr", + "theilslopes", + "tiecorrect", + "tmax", + "tmean", + "tmin", + "trim1", + "trim_mean", + "trimboth", + "tsem", + "tstd", + "ttest_1samp", + "ttest_ind", + "ttest_ind_from_stats", + "ttest_rel", + "tvar", + "wasserstein_distance", + "weightedtau", + "zmap", + "zscore", +] From 0e4a2be083b746091420419f93161d81f8e1cf58 Mon Sep 17 00:00:00 2001 From: Pavadol Yamsiri Date: Sat, 5 Oct 2024 18:34:16 +1000 Subject: [PATCH 05/22] `interpolate`: Add re-exported functions to `__all__` for public private submodules --- scipy-stubs/interpolate/dfitpack.pyi | 34 ++++++++++++++++++++++--- scipy-stubs/interpolate/fitpack.pyi | 21 ++++++++++++--- scipy-stubs/interpolate/fitpack2.pyi | 19 +++++++++++--- scipy-stubs/interpolate/interpolate.pyi | 22 +++++++++++++--- scipy-stubs/interpolate/ndgriddata.pyi | 8 +++--- scipy-stubs/interpolate/polyint.pyi | 14 +++++++--- scipy-stubs/interpolate/rbf.pyi | 8 +++--- 7 files changed, 105 insertions(+), 21 deletions(-) diff --git a/scipy-stubs/interpolate/dfitpack.pyi b/scipy-stubs/interpolate/dfitpack.pyi index bc0eb39c..33b7264b 100644 --- a/scipy-stubs/interpolate/dfitpack.pyi +++ b/scipy-stubs/interpolate/dfitpack.pyi @@ -1,4 +1,32 @@ -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 python Fortran file which doesn't currently have a stub. -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [ + "bispeu", + "bispev", + "curfit", + "dblint", + "fpchec", + "fpcurf0", + "fpcurf1", + "fpcurfm1", + "parcur", + "parder", + "pardeu", + "pardtc", + "percur", + "regrid_smth", + "regrid_smth_spher", + "spalde", + "spherfit_lsq", + "spherfit_smth", + "splder", + "splev", + "splint", + "sproot", + "surfit_lsq", + "surfit_smth", + "types", +] diff --git a/scipy-stubs/interpolate/fitpack.pyi b/scipy-stubs/interpolate/fitpack.pyi index bc0eb39c..0be33bdd 100644 --- a/scipy-stubs/interpolate/fitpack.pyi +++ b/scipy-stubs/interpolate/fitpack.pyi @@ -1,4 +1,19 @@ -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 ._fitpack_py import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [ + "BSpline", + "bisplev", + "bisplrep", + "insert", + "spalde", + "splantider", + "splder", + "splev", + "splint", + "splprep", + "splrep", + "sproot", +] diff --git a/scipy-stubs/interpolate/fitpack2.pyi b/scipy-stubs/interpolate/fitpack2.pyi index bc0eb39c..438efb78 100644 --- a/scipy-stubs/interpolate/fitpack2.pyi +++ b/scipy-stubs/interpolate/fitpack2.pyi @@ -1,4 +1,17 @@ -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 ._fitpack2 import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [ + "BivariateSpline", + "InterpolatedUnivariateSpline", + "LSQBivariateSpline", + "LSQSphereBivariateSpline", + "LSQUnivariateSpline", + "RectBivariateSpline", + "RectSphereBivariateSpline", + "SmoothBivariateSpline", + "SmoothSphereBivariateSpline", + "UnivariateSpline", +] diff --git a/scipy-stubs/interpolate/interpolate.pyi b/scipy-stubs/interpolate/interpolate.pyi index bc0eb39c..9e306fd8 100644 --- a/scipy-stubs/interpolate/interpolate.pyi +++ b/scipy-stubs/interpolate/interpolate.pyi @@ -1,4 +1,20 @@ -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 ._fitpack2 import * +from ._interpolate import * +from ._rgi import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [ + "BPoly", + "BSpline", + "NdPPoly", + "PPoly", + "RectBivariateSpline", + "RegularGridInterpolator", + "interp1d", + "interp2d", + "interpn", + "lagrange", + "make_interp_spline", +] diff --git a/scipy-stubs/interpolate/ndgriddata.pyi b/scipy-stubs/interpolate/ndgriddata.pyi index bc0eb39c..5a40c6cf 100644 --- a/scipy-stubs/interpolate/ndgriddata.pyi +++ b/scipy-stubs/interpolate/ndgriddata.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 ._ndgriddata import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["CloughTocher2DInterpolator", "LinearNDInterpolator", "NearestNDInterpolator", "griddata"] diff --git a/scipy-stubs/interpolate/polyint.pyi b/scipy-stubs/interpolate/polyint.pyi index bc0eb39c..deb0425f 100644 --- a/scipy-stubs/interpolate/polyint.pyi +++ b/scipy-stubs/interpolate/polyint.pyi @@ -1,4 +1,12 @@ -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 ._polyint import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [ + "BarycentricInterpolator", + "KroghInterpolator", + "approximate_taylor_polynomial", + "barycentric_interpolate", + "krogh_interpolate", +] diff --git a/scipy-stubs/interpolate/rbf.pyi b/scipy-stubs/interpolate/rbf.pyi index bc0eb39c..fbf225ba 100644 --- a/scipy-stubs/interpolate/rbf.pyi +++ b/scipy-stubs/interpolate/rbf.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 ._rbf import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["Rbf"] From f994bfa76a589dfa5b3eaa0f281d74f85c720b43 Mon Sep 17 00:00:00 2001 From: Pavadol Yamsiri Date: Sat, 5 Oct 2024 18:40:19 +1000 Subject: [PATCH 06/22] `io`: Add re-exported functions to `__all__` for public private submodules --- scipy-stubs/io/arff/arffread.pyi | 8 +++++--- scipy-stubs/io/harwell_boeing.pyi | 8 +++++--- scipy-stubs/io/idl.pyi | 8 +++++--- scipy-stubs/io/matlab/byteordercodes.pyi | 5 +---- scipy-stubs/io/matlab/mio.pyi | 8 +++++--- scipy-stubs/io/matlab/mio4.pyi | 5 +---- scipy-stubs/io/matlab/mio5.pyi | 8 +++++--- scipy-stubs/io/matlab/mio5_params.pyi | 8 +++++--- scipy-stubs/io/matlab/mio5_utils.pyi | 5 +---- scipy-stubs/io/matlab/mio_utils.pyi | 5 +---- scipy-stubs/io/matlab/miobase.pyi | 8 +++++--- scipy-stubs/io/matlab/streams.pyi | 5 +---- scipy-stubs/io/mmio.pyi | 8 +++++--- scipy-stubs/io/netcdf.pyi | 8 +++++--- 14 files changed, 50 insertions(+), 47 deletions(-) diff --git a/scipy-stubs/io/arff/arffread.pyi b/scipy-stubs/io/arff/arffread.pyi index bc0eb39c..35b97838 100644 --- a/scipy-stubs/io/arff/arffread.pyi +++ b/scipy-stubs/io/arff/arffread.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 ._arffread import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["ArffError", "MetaData", "ParseArffError", "loadarff"] diff --git a/scipy-stubs/io/harwell_boeing.pyi b/scipy-stubs/io/harwell_boeing.pyi index bc0eb39c..74e94aad 100644 --- a/scipy-stubs/io/harwell_boeing.pyi +++ b/scipy-stubs/io/harwell_boeing.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 ._harwell_boeing import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["hb_read", "hb_write"] diff --git a/scipy-stubs/io/idl.pyi b/scipy-stubs/io/idl.pyi index bc0eb39c..5e10b5ad 100644 --- a/scipy-stubs/io/idl.pyi +++ b/scipy-stubs/io/idl.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 ._idl import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["readsav"] diff --git a/scipy-stubs/io/matlab/byteordercodes.pyi b/scipy-stubs/io/matlab/byteordercodes.pyi index bc0eb39c..a9a2c5b3 100644 --- a/scipy-stubs/io/matlab/byteordercodes.pyi +++ b/scipy-stubs/io/matlab/byteordercodes.pyi @@ -1,4 +1 @@ -from scipy._typing import Untyped - -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [] diff --git a/scipy-stubs/io/matlab/mio.pyi b/scipy-stubs/io/matlab/mio.pyi index bc0eb39c..0cee06cc 100644 --- a/scipy-stubs/io/matlab/mio.pyi +++ b/scipy-stubs/io/matlab/mio.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 ._mio import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["loadmat", "savemat", "whosmat"] diff --git a/scipy-stubs/io/matlab/mio4.pyi b/scipy-stubs/io/matlab/mio4.pyi index bc0eb39c..a9a2c5b3 100644 --- a/scipy-stubs/io/matlab/mio4.pyi +++ b/scipy-stubs/io/matlab/mio4.pyi @@ -1,4 +1 @@ -from scipy._typing import Untyped - -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [] diff --git a/scipy-stubs/io/matlab/mio5.pyi b/scipy-stubs/io/matlab/mio5.pyi index bc0eb39c..fa0bed56 100644 --- a/scipy-stubs/io/matlab/mio5.pyi +++ b/scipy-stubs/io/matlab/mio5.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 ._mio5 import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["MatReadError", "MatReadWarning", "MatWriteError", "MatlabFunction", "MatlabObject", "mat_struct", "varmats_from_mat"] diff --git a/scipy-stubs/io/matlab/mio5_params.pyi b/scipy-stubs/io/matlab/mio5_params.pyi index bc0eb39c..86e7ea26 100644 --- a/scipy-stubs/io/matlab/mio5_params.pyi +++ b/scipy-stubs/io/matlab/mio5_params.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 ._mio5_params import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["MatlabFunction", "MatlabObject", "MatlabOpaque", "mat_struct"] diff --git a/scipy-stubs/io/matlab/mio5_utils.pyi b/scipy-stubs/io/matlab/mio5_utils.pyi index bc0eb39c..a9a2c5b3 100644 --- a/scipy-stubs/io/matlab/mio5_utils.pyi +++ b/scipy-stubs/io/matlab/mio5_utils.pyi @@ -1,4 +1 @@ -from scipy._typing import Untyped - -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [] diff --git a/scipy-stubs/io/matlab/mio_utils.pyi b/scipy-stubs/io/matlab/mio_utils.pyi index bc0eb39c..a9a2c5b3 100644 --- a/scipy-stubs/io/matlab/mio_utils.pyi +++ b/scipy-stubs/io/matlab/mio_utils.pyi @@ -1,4 +1 @@ -from scipy._typing import Untyped - -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [] diff --git a/scipy-stubs/io/matlab/miobase.pyi b/scipy-stubs/io/matlab/miobase.pyi index bc0eb39c..3a6d00be 100644 --- a/scipy-stubs/io/matlab/miobase.pyi +++ b/scipy-stubs/io/matlab/miobase.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 ._miobase import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["MatReadError", "MatReadWarning", "MatWriteError"] diff --git a/scipy-stubs/io/matlab/streams.pyi b/scipy-stubs/io/matlab/streams.pyi index bc0eb39c..a9a2c5b3 100644 --- a/scipy-stubs/io/matlab/streams.pyi +++ b/scipy-stubs/io/matlab/streams.pyi @@ -1,4 +1 @@ -from scipy._typing import Untyped - -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [] diff --git a/scipy-stubs/io/mmio.pyi b/scipy-stubs/io/mmio.pyi index bc0eb39c..91f1e0f9 100644 --- a/scipy-stubs/io/mmio.pyi +++ b/scipy-stubs/io/mmio.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 ._mmio import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["mminfo", "mmread", "mmwrite"] diff --git a/scipy-stubs/io/netcdf.pyi b/scipy-stubs/io/netcdf.pyi index bc0eb39c..527f52ea 100644 --- a/scipy-stubs/io/netcdf.pyi +++ b/scipy-stubs/io/netcdf.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 ._netcdf import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["netcdf_file", "netcdf_variable"] From e10506544f51b5d0f4e2b90b54685ea835374a9f Mon Sep 17 00:00:00 2001 From: Pavadol Yamsiri Date: Sat, 5 Oct 2024 18:54:42 +1000 Subject: [PATCH 07/22] `signal`: Add re-exported functions to `__all__` for public private submodules --- scipy-stubs/signal/bsplines.pyi | 8 ++-- scipy-stubs/signal/filter_design.pyi | 55 ++++++++++++++++++++++-- scipy-stubs/signal/fir_filter_design.pyi | 8 ++-- scipy-stubs/signal/lti_conversion.pyi | 8 ++-- scipy-stubs/signal/ltisys.pyi | 40 +++++++++++++++-- scipy-stubs/signal/signaltools.pyi | 52 ++++++++++++++++++++-- scipy-stubs/signal/spectral.pyi | 20 +++++++-- scipy-stubs/signal/spline.pyi | 9 ++-- scipy-stubs/signal/waveforms.pyi | 8 ++-- scipy-stubs/signal/wavelets.pyi | 8 ++-- scipy-stubs/signal/windows/windows.pyi | 33 ++++++++++++-- 11 files changed, 216 insertions(+), 33 deletions(-) diff --git a/scipy-stubs/signal/bsplines.pyi b/scipy-stubs/signal/bsplines.pyi index bc0eb39c..8af3880b 100644 --- a/scipy-stubs/signal/bsplines.pyi +++ b/scipy-stubs/signal/bsplines.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 ._spline_filters import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["cspline1d", "cspline1d_eval", "cspline2d", "gauss_spline", "qspline1d", "qspline1d_eval", "sepfir2d", "spline_filter"] diff --git a/scipy-stubs/signal/filter_design.pyi b/scipy-stubs/signal/filter_design.pyi index bc0eb39c..a12f7860 100644 --- a/scipy-stubs/signal/filter_design.pyi +++ b/scipy-stubs/signal/filter_design.pyi @@ -1,4 +1,53 @@ -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 ._filter_design import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [ + "BadCoefficients", + "band_stop_obj", + "bessel", + "besselap", + "bilinear", + "bilinear_zpk", + "buttap", + "butter", + "buttord", + "cheb1ap", + "cheb1ord", + "cheb2ap", + "cheb2ord", + "cheby1", + "cheby2", + "ellip", + "ellipap", + "ellipord", + "findfreqs", + "freqs", + "freqs_zpk", + "freqz", + "freqz_zpk", + "gammatone", + "group_delay", + "iircomb", + "iirdesign", + "iirfilter", + "iirnotch", + "iirpeak", + "lp2bp", + "lp2bp_zpk", + "lp2bs", + "lp2bs_zpk", + "lp2hp", + "lp2hp_zpk", + "lp2lp", + "lp2lp_zpk", + "normalize", + "sos2tf", + "sos2zpk", + "sosfreqz", + "tf2sos", + "tf2zpk", + "zpk2sos", + "zpk2tf", +] diff --git a/scipy-stubs/signal/fir_filter_design.pyi b/scipy-stubs/signal/fir_filter_design.pyi index bc0eb39c..c17a1bc3 100644 --- a/scipy-stubs/signal/fir_filter_design.pyi +++ b/scipy-stubs/signal/fir_filter_design.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 ._fir_filter_design import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["firls", "firwin", "firwin2", "kaiser_atten", "kaiser_beta", "kaiserord", "minimum_phase", "remez"] diff --git a/scipy-stubs/signal/lti_conversion.pyi b/scipy-stubs/signal/lti_conversion.pyi index bc0eb39c..a8fbbb73 100644 --- a/scipy-stubs/signal/lti_conversion.pyi +++ b/scipy-stubs/signal/lti_conversion.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 ._lti_conversion import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["abcd_normalize", "cont2discrete", "normalize", "ss2tf", "ss2zpk", "tf2ss", "tf2zpk", "zpk2ss", "zpk2tf"] diff --git a/scipy-stubs/signal/ltisys.pyi b/scipy-stubs/signal/ltisys.pyi index bc0eb39c..db7b3cc0 100644 --- a/scipy-stubs/signal/ltisys.pyi +++ b/scipy-stubs/signal/ltisys.pyi @@ -1,4 +1,38 @@ -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 ._filter_design import * +from ._lti_conversion import * +from ._ltisys import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [ + "StateSpace", + "TransferFunction", + "ZerosPolesGain", + "abcd_normalize", + "bode", + "cont2discrete", + "dbode", + "dfreqresp", + "dimpulse", + "dlsim", + "dlti", + "dstep", + "freqresp", + "freqs", + "freqs_zpk", + "freqz", + "freqz_zpk", + "impulse", + "lsim", + "lti", + "normalize", + "place_poles", + "ss2tf", + "ss2zpk", + "step", + "tf2ss", + "tf2zpk", + "zpk2ss", + "zpk2tf", +] diff --git a/scipy-stubs/signal/signaltools.pyi b/scipy-stubs/signal/signaltools.pyi index bc0eb39c..a652bd9b 100644 --- a/scipy-stubs/signal/signaltools.pyi +++ b/scipy-stubs/signal/signaltools.pyi @@ -1,4 +1,50 @@ -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 ._filter_design import * +from ._fir_filter_design import * +from ._ltisys import * +from ._signaltools import * +from ._upfirdn import * +from .windows import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [ + "cheby1", + "choose_conv_method", + "cmplx_sort", + "convolve", + "convolve2d", + "correlate", + "correlate2d", + "correlation_lags", + "decimate", + "deconvolve", + "detrend", + "dlti", + "fftconvolve", + "filtfilt", + "firwin", + "get_window", + "hilbert", + "hilbert2", + "invres", + "invresz", + "lfilter", + "lfilter_zi", + "lfiltic", + "medfilt", + "medfilt2d", + "oaconvolve", + "order_filter", + "resample", + "resample_poly", + "residue", + "residuez", + "sosfilt", + "sosfilt_zi", + "sosfiltfilt", + "unique_roots", + "upfirdn", + "vectorstrength", + "wiener", +] diff --git a/scipy-stubs/signal/spectral.pyi b/scipy-stubs/signal/spectral.pyi index bc0eb39c..0392762a 100644 --- a/scipy-stubs/signal/spectral.pyi +++ b/scipy-stubs/signal/spectral.pyi @@ -1,4 +1,18 @@ -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 ._spectral_py import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [ + "check_COLA", + "check_NOLA", + "coherence", + "csd", + "get_window", + "istft", + "lombscargle", + "periodogram", + "spectrogram", + "stft", + "welch", +] diff --git a/scipy-stubs/signal/spline.pyi b/scipy-stubs/signal/spline.pyi index bc0eb39c..a35dce78 100644 --- a/scipy-stubs/signal/spline.pyi +++ b/scipy-stubs/signal/spline.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. +from ._spline import * +from ._spline_filters import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["cspline2d", "qspline2d", "sepfir2d", "symiirorder1", "symiirorder2"] diff --git a/scipy-stubs/signal/waveforms.pyi b/scipy-stubs/signal/waveforms.pyi index bc0eb39c..9a56a464 100644 --- a/scipy-stubs/signal/waveforms.pyi +++ b/scipy-stubs/signal/waveforms.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 ._waveforms import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["chirp", "gausspulse", "sawtooth", "square", "sweep_poly", "unit_impulse"] diff --git a/scipy-stubs/signal/wavelets.pyi b/scipy-stubs/signal/wavelets.pyi index bc0eb39c..fc4aeac8 100644 --- a/scipy-stubs/signal/wavelets.pyi +++ b/scipy-stubs/signal/wavelets.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 ._wavelets import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = ["cascade", "convolve", "cwt", "daub", "morlet", "morlet2", "qmf", "ricker"] diff --git a/scipy-stubs/signal/windows/windows.pyi b/scipy-stubs/signal/windows/windows.pyi index bc0eb39c..0c0cf105 100644 --- a/scipy-stubs/signal/windows/windows.pyi +++ b/scipy-stubs/signal/windows/windows.pyi @@ -1,4 +1,31 @@ -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 ._windows import * -def __dir__() -> Untyped: ... -def __getattr__(name) -> Untyped: ... +__all__ = [ + "barthann", + "bartlett", + "blackman", + "blackmanharris", + "bohman", + "boxcar", + "chebwin", + "cosine", + "dpss", + "exponential", + "flattop", + "gaussian", + "general_cosine", + "general_gaussian", + "general_hamming", + "get_window", + "hamming", + "hann", + "kaiser", + "nuttall", + "parzen", + "taylor", + "triang", + "tukey", +] From 060db27201bbf2048e0c581c4a97ef13d8040dd6 Mon Sep 17 00:00:00 2001 From: Pavadol Yamsiri Date: Sat, 5 Oct 2024 19:22:51 +1000 Subject: [PATCH 08/22] `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__ = [] From 9198b8ed20c5db70d19427ce0704741ebf3b2495 Mon Sep 17 00:00:00 2001 From: Pavadol Yamsiri Date: Mon, 7 Oct 2024 15:28:23 +1100 Subject: [PATCH 09/22] bug_fix: Add type annotations to empty `__all__` --- scipy-stubs/io/matlab/byteordercodes.pyi | 2 +- scipy-stubs/io/matlab/mio4.pyi | 2 +- scipy-stubs/io/matlab/mio5_utils.pyi | 2 +- scipy-stubs/io/matlab/mio_utils.pyi | 2 +- scipy-stubs/io/matlab/streams.pyi | 2 +- scipy-stubs/sparse/sparsetools.pyi | 2 +- scipy-stubs/sparse/spfuncs.pyi | 2 +- scipy-stubs/sparse/sputils.pyi | 2 +- scipy-stubs/stats/biasedurn.pyi | 2 +- scipy-stubs/stats/mvn.pyi | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/scipy-stubs/io/matlab/byteordercodes.pyi b/scipy-stubs/io/matlab/byteordercodes.pyi index a9a2c5b3..c9c2ef67 100644 --- a/scipy-stubs/io/matlab/byteordercodes.pyi +++ b/scipy-stubs/io/matlab/byteordercodes.pyi @@ -1 +1 @@ -__all__ = [] +__all__: list[str] = [] diff --git a/scipy-stubs/io/matlab/mio4.pyi b/scipy-stubs/io/matlab/mio4.pyi index a9a2c5b3..c9c2ef67 100644 --- a/scipy-stubs/io/matlab/mio4.pyi +++ b/scipy-stubs/io/matlab/mio4.pyi @@ -1 +1 @@ -__all__ = [] +__all__: list[str] = [] diff --git a/scipy-stubs/io/matlab/mio5_utils.pyi b/scipy-stubs/io/matlab/mio5_utils.pyi index a9a2c5b3..c9c2ef67 100644 --- a/scipy-stubs/io/matlab/mio5_utils.pyi +++ b/scipy-stubs/io/matlab/mio5_utils.pyi @@ -1 +1 @@ -__all__ = [] +__all__: list[str] = [] diff --git a/scipy-stubs/io/matlab/mio_utils.pyi b/scipy-stubs/io/matlab/mio_utils.pyi index a9a2c5b3..c9c2ef67 100644 --- a/scipy-stubs/io/matlab/mio_utils.pyi +++ b/scipy-stubs/io/matlab/mio_utils.pyi @@ -1 +1 @@ -__all__ = [] +__all__: list[str] = [] diff --git a/scipy-stubs/io/matlab/streams.pyi b/scipy-stubs/io/matlab/streams.pyi index a9a2c5b3..c9c2ef67 100644 --- a/scipy-stubs/io/matlab/streams.pyi +++ b/scipy-stubs/io/matlab/streams.pyi @@ -1 +1 @@ -__all__ = [] +__all__: list[str] = [] diff --git a/scipy-stubs/sparse/sparsetools.pyi b/scipy-stubs/sparse/sparsetools.pyi index a9a2c5b3..c9c2ef67 100644 --- a/scipy-stubs/sparse/sparsetools.pyi +++ b/scipy-stubs/sparse/sparsetools.pyi @@ -1 +1 @@ -__all__ = [] +__all__: list[str] = [] diff --git a/scipy-stubs/sparse/spfuncs.pyi b/scipy-stubs/sparse/spfuncs.pyi index a9a2c5b3..c9c2ef67 100644 --- a/scipy-stubs/sparse/spfuncs.pyi +++ b/scipy-stubs/sparse/spfuncs.pyi @@ -1 +1 @@ -__all__ = [] +__all__: list[str] = [] diff --git a/scipy-stubs/sparse/sputils.pyi b/scipy-stubs/sparse/sputils.pyi index a9a2c5b3..c9c2ef67 100644 --- a/scipy-stubs/sparse/sputils.pyi +++ b/scipy-stubs/sparse/sputils.pyi @@ -1 +1 @@ -__all__ = [] +__all__: list[str] = [] diff --git a/scipy-stubs/stats/biasedurn.pyi b/scipy-stubs/stats/biasedurn.pyi index a9a2c5b3..c9c2ef67 100644 --- a/scipy-stubs/stats/biasedurn.pyi +++ b/scipy-stubs/stats/biasedurn.pyi @@ -1 +1 @@ -__all__ = [] +__all__: list[str] = [] diff --git a/scipy-stubs/stats/mvn.pyi b/scipy-stubs/stats/mvn.pyi index a9a2c5b3..c9c2ef67 100644 --- a/scipy-stubs/stats/mvn.pyi +++ b/scipy-stubs/stats/mvn.pyi @@ -1 +1 @@ -__all__ = [] +__all__: list[str] = [] From 909a1bc41d3ad390119d7e8d504b9bb601e85a2c Mon Sep 17 00:00:00 2001 From: Pavadol Yamsiri Date: Mon, 7 Oct 2024 15:44:21 +1100 Subject: [PATCH 10/22] bug_fix: Add a dummy version of `convolve` This is to be able to export out `convolve` without needing the Cython module `convolve.pyx` to have type stubs. --- scipy-stubs/fftpack/pseudo_diffs.pyi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scipy-stubs/fftpack/pseudo_diffs.pyi b/scipy-stubs/fftpack/pseudo_diffs.pyi index 76f9cf58..1b6083f0 100644 --- a/scipy-stubs/fftpack/pseudo_diffs.pyi +++ b/scipy-stubs/fftpack/pseudo_diffs.pyi @@ -1,7 +1,11 @@ # 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 . import convolve +from typing_extensions import deprecated + from ._pseudo_diffs import * +@deprecated("will be removed in SciPy v2.0.0") +def convolve(*args: object, **kwargs: object) -> object: ... + __all__ = ["cc_diff", "convolve", "cs_diff", "diff", "hilbert", "ihilbert", "itilbert", "sc_diff", "shift", "ss_diff", "tilbert"] From c0a6651efe56f3cc76acce230b5cd6175e5a0c50 Mon Sep 17 00:00:00 2001 From: Pavadol Yamsiri Date: Mon, 7 Oct 2024 17:26:05 +1100 Subject: [PATCH 11/22] `io`: Add dummy functions and classes instead of re-exporting For public private modules. --- scipy-stubs/io/arff/arffread.pyi | 21 +++++++++++-- scipy-stubs/io/harwell_boeing.pyi | 9 ++++-- scipy-stubs/io/idl.pyi | 13 ++++++-- scipy-stubs/io/matlab/mio.pyi | 19 ++++++++++-- scipy-stubs/io/matlab/mio5.pyi | 28 +++++++++++++++-- scipy-stubs/io/matlab/mio5_params.pyi | 20 +++++++++++-- scipy-stubs/io/matlab/miobase.pyi | 13 ++++++-- scipy-stubs/io/mmio.pyi | 13 ++++++-- scipy-stubs/io/netcdf.pyi | 43 +++++++++++++++++++++++++-- 9 files changed, 152 insertions(+), 27 deletions(-) diff --git a/scipy-stubs/io/arff/arffread.pyi b/scipy-stubs/io/arff/arffread.pyi index 35b97838..3bee6c82 100644 --- a/scipy-stubs/io/arff/arffread.pyi +++ b/scipy-stubs/io/arff/arffread.pyi @@ -1,6 +1,21 @@ # 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 ._arffread import * +from typing_extensions import deprecated __all__ = ["ArffError", "MetaData", "ParseArffError", "loadarff"] + +@deprecated("will be removed in SciPy v2.0.0") +class ArffError: ... + +@deprecated("will be removed in SciPy v2.0.0") +class MetaData: + def __init__(self, rel: object, attr: object) -> None: ... + def __getitem__(self, key: object) -> object: ... + def __iter__(self) -> object: ... + def names(self) -> object: ... + def types(self) -> object: ... + +@deprecated("will be removed in SciPy v2.0.0") +class ParseArffError: ... + +@deprecated("will be removed in SciPy v2.0.0") +def loadarff(f: object) -> object: ... diff --git a/scipy-stubs/io/harwell_boeing.pyi b/scipy-stubs/io/harwell_boeing.pyi index 74e94aad..519ccc1a 100644 --- a/scipy-stubs/io/harwell_boeing.pyi +++ b/scipy-stubs/io/harwell_boeing.pyi @@ -1,6 +1,9 @@ # 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 ._harwell_boeing import * +from typing_extensions import deprecated __all__ = ["hb_read", "hb_write"] + +@deprecated("will be removed in SciPy v2.0.0") +def hb_read(path_or_open_file: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def hb_write(path_or_open_file: object, m: object, hb_info: object = ...) -> None: ... diff --git a/scipy-stubs/io/idl.pyi b/scipy-stubs/io/idl.pyi index 5e10b5ad..6d621b94 100644 --- a/scipy-stubs/io/idl.pyi +++ b/scipy-stubs/io/idl.pyi @@ -1,6 +1,13 @@ # 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 ._idl import * +from typing_extensions import deprecated __all__ = ["readsav"] + +@deprecated("will be removed in SciPy v2.0.0") +def readsav( + file_name: object, + idict: object = ..., + python_dict: object = ..., + uncompressed_file_name: object = ..., + verbose: object = ..., +) -> object: ... diff --git a/scipy-stubs/io/matlab/mio.pyi b/scipy-stubs/io/matlab/mio.pyi index 0cee06cc..2ca6d3e2 100644 --- a/scipy-stubs/io/matlab/mio.pyi +++ b/scipy-stubs/io/matlab/mio.pyi @@ -1,6 +1,19 @@ # 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 ._mio import * +from typing_extensions import deprecated __all__ = ["loadmat", "savemat", "whosmat"] + +@deprecated("will be removed in SciPy v2.0.0") +def loadmat(file_name: object, mdict: object = ..., appendmat: object = ..., **kwargs: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def savemat( + file_name: object, + mdict: object, + appendmat: object = ..., + format: object = ..., + long_field_names: object = ..., + do_compression: object = ..., + oned_as: object = ..., +) -> None: ... +@deprecated("will be removed in SciPy v2.0.0") +def whosmat(file_name: object, appendmat: object = ..., **kwargs: object) -> object: ... diff --git a/scipy-stubs/io/matlab/mio5.pyi b/scipy-stubs/io/matlab/mio5.pyi index fa0bed56..e8328bde 100644 --- a/scipy-stubs/io/matlab/mio5.pyi +++ b/scipy-stubs/io/matlab/mio5.pyi @@ -1,6 +1,28 @@ # 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 ._mio5 import * +from typing_extensions import Self, deprecated __all__ = ["MatReadError", "MatReadWarning", "MatWriteError", "MatlabFunction", "MatlabObject", "mat_struct", "varmats_from_mat"] + +@deprecated("will be removed in SciPy v2.0.0") +class MatReadError: ... + +@deprecated("will be removed in SciPy v2.0.0") +class MatWriteError: ... + +@deprecated("will be removed in SciPy v2.0.0") +class MatReadWarning: ... + +@deprecated("will be removed in SciPy v2.0.0") +class MatlabFunction: + def __new__(cls: type[Self], input_array: object) -> Self: ... + +@deprecated("will be removed in SciPy v2.0.0") +class MatlabObject: + def __new__(cls: type[Self], input_array: object, classname: object = ...) -> Self: ... + def __array_finalize__(self, obj: Self) -> None: ... + +@deprecated("will be removed in SciPy v2.0.0") +class mat_struct: ... + +@deprecated("will be removed in SciPy v2.0.0") +def varmats_from_mat(file_obj: object) -> object: ... diff --git a/scipy-stubs/io/matlab/mio5_params.pyi b/scipy-stubs/io/matlab/mio5_params.pyi index 86e7ea26..34d5e7f2 100644 --- a/scipy-stubs/io/matlab/mio5_params.pyi +++ b/scipy-stubs/io/matlab/mio5_params.pyi @@ -1,6 +1,20 @@ # 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 ._mio5_params import * +from typing_extensions import Self, deprecated __all__ = ["MatlabFunction", "MatlabObject", "MatlabOpaque", "mat_struct"] + +@deprecated("will be removed in SciPy v2.0.0") +class MatlabFunction: + def __new__(cls: type[Self], input_array: object) -> Self: ... + +@deprecated("will be removed in SciPy v2.0.0") +class MatlabObject: + def __new__(cls: type[Self], input_array: object, classname: object = ...) -> Self: ... + def __array_finalize__(self, obj: Self) -> None: ... + +@deprecated("will be removed in SciPy v2.0.0") +class MatlabOpaque: + def __new__(cls: type[Self], input_array: object) -> Self: ... + +@deprecated("will be removed in SciPy v2.0.0") +class mat_struct: ... diff --git a/scipy-stubs/io/matlab/miobase.pyi b/scipy-stubs/io/matlab/miobase.pyi index 3a6d00be..da3cb5ca 100644 --- a/scipy-stubs/io/matlab/miobase.pyi +++ b/scipy-stubs/io/matlab/miobase.pyi @@ -1,6 +1,13 @@ # 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 ._miobase import * +from typing_extensions import deprecated __all__ = ["MatReadError", "MatReadWarning", "MatWriteError"] + +@deprecated("will be removed in SciPy v2.0.0") +class MatReadError: ... + +@deprecated("will be removed in SciPy v2.0.0") +class MatWriteError: ... + +@deprecated("will be removed in SciPy v2.0.0") +class MatReadWarning: ... diff --git a/scipy-stubs/io/mmio.pyi b/scipy-stubs/io/mmio.pyi index 91f1e0f9..724d7872 100644 --- a/scipy-stubs/io/mmio.pyi +++ b/scipy-stubs/io/mmio.pyi @@ -1,6 +1,13 @@ # 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 ._mmio import * +from typing_extensions import deprecated __all__ = ["mminfo", "mmread", "mmwrite"] + +@deprecated("will be removed in SciPy v2.0.0") +def mminfo(source: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def mmread(source: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def mmwrite( + target: object, a: object, comment: object = ..., field: object = ..., precision: object = ..., symmetry: object = ... +) -> None: ... diff --git a/scipy-stubs/io/netcdf.pyi b/scipy-stubs/io/netcdf.pyi index 527f52ea..6fb0def5 100644 --- a/scipy-stubs/io/netcdf.pyi +++ b/scipy-stubs/io/netcdf.pyi @@ -1,6 +1,43 @@ # 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 ._netcdf import * +from typing_extensions import deprecated __all__ = ["netcdf_file", "netcdf_variable"] + +@deprecated("will be removed in SciPy v2.0.0") +class netcdf_file: + def __init__( + self, filename: object, mode: object = ..., mmap: object = ..., version: object = ..., maskandscale: object = ... + ) -> None: ... + def flush(self) -> None: ... + def close(self) -> None: ... + def createVariable(self, name: object, type: object, dimensions: object) -> object: ... + def createDimension(self, name: object, length: object) -> None: ... + def sync(self) -> None: ... + def __del__(self) -> None: ... + def __enter__(self) -> object: ... + def __exit__(self, type: object, value: object, traceback: object) -> None: ... + def __setattr__(self, attr: object, value: object) -> None: ... + +@deprecated("will be removed in SciPy v2.0.0") +class netcdf_variable: + def __init__( + self, + data: object, + typecode: object, + size: object, + shape: object, + dimensions: object, + attributes: object = ..., + maskandscale: object = ..., + ) -> None: ... + @property + def isrec(self) -> object: ... + @property + def shape(self) -> object: ... + def assignValue(self, value: object) -> None: ... + def getValue(self) -> object: ... + def itemsize(self) -> object: ... + def typecode(self) -> object: ... + def __getitem__(self, index: object) -> object: ... + def __setattr__(self, attr: object, value: object) -> None: ... + def __setitem__(self, index: object, data: object) -> None: ... From b8ca1c2f596829ebc40674f03bc43d1320caba35 Mon Sep 17 00:00:00 2001 From: Pavadol Yamsiri Date: Mon, 7 Oct 2024 17:40:15 +1100 Subject: [PATCH 12/22] `io.arff`: Do an explicit re-export of _arffread symbols. The linter does not like operations on `__all__` and before this patch, `_arffread` had no explicit `__all__` which lead to stubtest errors. --- scipy-stubs/io/arff/__init__.pyi | 6 ++++-- scipy-stubs/io/arff/_arffread.pyi | 14 ++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/scipy-stubs/io/arff/__init__.pyi b/scipy-stubs/io/arff/__init__.pyi index 5d929362..9c0c30a8 100644 --- a/scipy-stubs/io/arff/__init__.pyi +++ b/scipy-stubs/io/arff/__init__.pyi @@ -1,2 +1,4 @@ -from . import arffread as arffread -from ._arffread import * +from . import arffread +from ._arffread import ArffError, MetaData, ParseArffError, loadarff + +__all__ = ["ArffError", "MetaData", "ParseArffError", "arffread", "loadarff"] diff --git a/scipy-stubs/io/arff/_arffread.pyi b/scipy-stubs/io/arff/_arffread.pyi index 18fefcc6..2a323e2a 100644 --- a/scipy-stubs/io/arff/_arffread.pyi +++ b/scipy-stubs/io/arff/_arffread.pyi @@ -1,5 +1,7 @@ from scipy._typing import Untyped +__all__ = ["ArffError", "MetaData", "ParseArffError", "loadarff"] + r_meta: Untyped r_comment: Untyped r_empty: Untyped @@ -16,7 +18,7 @@ class ArffError(OSError): ... class ParseArffError(ArffError): ... class Attribute: - type_name: Untyped + type_name: str | None name: Untyped range: Untyped dtype: Untyped @@ -26,7 +28,7 @@ class Attribute: def parse_data(self, data_str): ... class NominalAttribute(Attribute): - type_name: str + type_name: str | None values: Untyped range: Untyped dtype: Untyped @@ -36,7 +38,7 @@ class NominalAttribute(Attribute): def parse_data(self, data_str) -> Untyped: ... class NumericAttribute(Attribute): - type_name: str + type_name: str | None dtype: Untyped def __init__(self, name) -> None: ... @classmethod @@ -44,15 +46,15 @@ class NumericAttribute(Attribute): def parse_data(self, data_str) -> Untyped: ... class StringAttribute(Attribute): - type_name: str + type_name: str | None def __init__(self, name) -> None: ... @classmethod def parse_attribute(cls, name, attr_string) -> Untyped: ... class DateAttribute(Attribute): + type_name: str | None date_format: Untyped datetime_unit: Untyped - type_name: str range: Untyped dtype: Untyped def __init__(self, name, date_format, datetime_unit) -> None: ... @@ -61,7 +63,7 @@ class DateAttribute(Attribute): def parse_data(self, data_str) -> Untyped: ... class RelationalAttribute(Attribute): - type_name: str + type_name: str | None dtype: Untyped attributes: Untyped dialect: Untyped From b55d23cca7a1c4199f2788bc17e456f77881596f Mon Sep 17 00:00:00 2001 From: Pavadol Yamsiri Date: Mon, 7 Oct 2024 18:16:59 +1100 Subject: [PATCH 13/22] `fftpack`: Add deprecated dummy function/class stubs Additionally add a stub file for the `convolve` module which was missing one as it was originally a Cython file. This module is not fully typed. --- scipy-stubs/fftpack/basic.pyi | 21 ++++++++-- scipy-stubs/fftpack/convolve.pyi | 10 +++++ scipy-stubs/fftpack/helper.pyi | 19 +++++++-- scipy-stubs/fftpack/pseudo_diffs.pyi | 28 ++++++++++--- scipy-stubs/fftpack/realtransforms.pyi | 57 ++++++++++++++++++++++++-- 5 files changed, 120 insertions(+), 15 deletions(-) create mode 100644 scipy-stubs/fftpack/convolve.pyi diff --git a/scipy-stubs/fftpack/basic.pyi b/scipy-stubs/fftpack/basic.pyi index aa742267..60ec3a75 100644 --- a/scipy-stubs/fftpack/basic.pyi +++ b/scipy-stubs/fftpack/basic.pyi @@ -1,6 +1,21 @@ # 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 ._basic import * +from typing_extensions import deprecated __all__ = ["fft", "fft2", "fftn", "ifft", "ifft2", "ifftn", "irfft", "rfft"] + +@deprecated("will be removed in SciPy v2.0.0") +def fft(x: object, n: object = ..., axis: object = ..., overwrite_x: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ifft(x: object, n: object = ..., axis: object = ..., overwrite_x: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def rfft(x: object, n: object = ..., axis: object = ..., overwrite_x: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def irfft(x: object, n: object = ..., axis: object = ..., overwrite_x: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def fftn(x: object, shape: object = ..., axes: object = ..., overwrite_x: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ifftn(x: object, shape: object = ..., axes: object = ..., overwrite_x: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def fft2(x: object, shape: object = ..., axes: object = ..., overwrite_x: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ifft2(x: object, shape: object = ..., axes: object = ..., overwrite_x: object = ...) -> object: ... diff --git a/scipy-stubs/fftpack/convolve.pyi b/scipy-stubs/fftpack/convolve.pyi new file mode 100644 index 00000000..2bc7654c --- /dev/null +++ b/scipy-stubs/fftpack/convolve.pyi @@ -0,0 +1,10 @@ +from scipy._typing import Untyped + +__all__ = ["convolve", "convolve_z", "destroy_convolve_cache", "init_convolution_kernel"] + +def convolve(inout: Untyped, omega: Untyped, swap_real_imag: bool = False, overwrite_x: bool = False) -> Untyped: ... +def convolve_z(inout: Untyped, omega_real: Untyped, omega_imag: Untyped, overwrite_x: bool = False) -> Untyped: ... +def init_convolution_kernel( + n: int, kernel_func: Untyped, d: int = 0, zero_nyquist: int | None = None, kernel_func_extra_args: Untyped = () +) -> Untyped: ... +def destroy_convolve_cache() -> None: ... diff --git a/scipy-stubs/fftpack/helper.pyi b/scipy-stubs/fftpack/helper.pyi index 9167771a..0ee20925 100644 --- a/scipy-stubs/fftpack/helper.pyi +++ b/scipy-stubs/fftpack/helper.pyi @@ -1,6 +1,19 @@ # 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 ._helper import * +from typing_extensions import deprecated __all__ = ["fftfreq", "fftshift", "ifftshift", "next_fast_len", "rfftfreq"] + +@deprecated("will be removed in SciPy v2.0.0") +def fftfreq( + n: object, + d: object = ..., + device: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def fftshift(x: object, axes: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ifftshift(x: object, axes: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def next_fast_len(target: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def rfftfreq(n: object, d: object = ...) -> object: ... diff --git a/scipy-stubs/fftpack/pseudo_diffs.pyi b/scipy-stubs/fftpack/pseudo_diffs.pyi index 1b6083f0..d42c6c2f 100644 --- a/scipy-stubs/fftpack/pseudo_diffs.pyi +++ b/scipy-stubs/fftpack/pseudo_diffs.pyi @@ -1,11 +1,27 @@ # 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 typing_extensions import deprecated -from ._pseudo_diffs import * - -@deprecated("will be removed in SciPy v2.0.0") -def convolve(*args: object, **kwargs: object) -> object: ... +from . import convolve as convolve __all__ = ["cc_diff", "convolve", "cs_diff", "diff", "hilbert", "ihilbert", "itilbert", "sc_diff", "shift", "ss_diff", "tilbert"] + +@deprecated("will be removed in SciPy v2.0.0") +def diff(x: object, order: object = 1, period: object = ..., _cache: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def tilbert(x: object, h: object, period: object = ..., _cache: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def itilbert(x: object, h: object, period: object = ..., _cache: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def hilbert(x: object, _cache: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ihilbert(x: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def cs_diff(x: object, a: object, b: object, period: object = ..., _cache: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def sc_diff(x: object, a: object, b: object, period: object = ..., _cache: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ss_diff(x: object, a: object, b: object, period: object = ..., _cache: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def cc_diff(x: object, a: object, b: object, period: object = ..., _cache: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def shift(x: object, a: object, period: object = ..., _cache: object = ...) -> object: ... diff --git a/scipy-stubs/fftpack/realtransforms.pyi b/scipy-stubs/fftpack/realtransforms.pyi index 51a0a13c..bd415e66 100644 --- a/scipy-stubs/fftpack/realtransforms.pyi +++ b/scipy-stubs/fftpack/realtransforms.pyi @@ -1,6 +1,57 @@ # 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 ._realtransforms import * +from typing_extensions import deprecated __all__ = ["dct", "dctn", "dst", "dstn", "idct", "idctn", "idst", "idstn"] + +@deprecated("will be removed in SciPy v2.0.0") +def dctn( + x: object, + type: object = ..., + shape: object = ..., + axes: object = ..., + norm: object = ..., + overwrite_x: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def idctn( + x: object, + type: object = ..., + shape: object = ..., + axes: object = ..., + norm: object = ..., + overwrite_x: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def dstn( + x: object, + type: object = ..., + shape: object = ..., + axes: object = ..., + norm: object = ..., + overwrite_x: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def idstn( + x: object, + type: object = ..., + shape: object = ..., + axes: object = ..., + norm: object = ..., + overwrite_x: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def dct( + x: object, type: object = ..., n: object = ..., axis: object = ..., norm: object = ..., overwrite_x: object = ... +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def idct( + x: object, type: object = ..., n: object = ..., axis: object = ..., norm: object = ..., overwrite_x: object = ... +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def dst( + x: object, type: object = ..., n: object = ..., axis: object = ..., norm: object = ..., overwrite_x: object = ... +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def idst( + x: object, type: object = ..., n: object = ..., axis: object = ..., norm: object = ..., overwrite_x: object = ... +) -> object: ... From fdf4aba1e8028456b4aec6e14cb06d0c98a9ef01 Mon Sep 17 00:00:00 2001 From: Pavadol Yamsiri Date: Mon, 7 Oct 2024 20:08:11 +1100 Subject: [PATCH 14/22] `ndimage`: Add deprecated dummy functions --- scipy-stubs/ndimage/filters.pyi | 222 +++++++++++++++++++++++++- scipy-stubs/ndimage/fourier.pyi | 13 +- scipy-stubs/ndimage/interpolation.pyi | 80 +++++++++- scipy-stubs/ndimage/measurements.pyi | 43 ++++- scipy-stubs/ndimage/morphology.pyi | 189 +++++++++++++++++++++- 5 files changed, 532 insertions(+), 15 deletions(-) diff --git a/scipy-stubs/ndimage/filters.pyi b/scipy-stubs/ndimage/filters.pyi index 76a16185..077ecd0e 100644 --- a/scipy-stubs/ndimage/filters.pyi +++ b/scipy-stubs/ndimage/filters.pyi @@ -1,7 +1,5 @@ # 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 ._filters import * +from typing_extensions import deprecated __all__ = [ "convolve", @@ -29,3 +27,221 @@ __all__ = [ "uniform_filter", "uniform_filter1d", ] + +@deprecated("will be removed in SciPy v2.0.0") +def convolve( + input: object, weights: object, output: object = ..., mode: object = ..., cval: object = ..., origin: object = ... +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def convolve1d( + input: object, + weights: object, + axis: object = ..., + output: object = ..., + mode: object = ..., + cval: object = ..., + origin: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def correlate( + input: object, weights: object, output: object = ..., mode: object = ..., cval: object = ..., origin: object = ... +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def correlate1d( + input: object, + weights: object, + axis: object = ..., + output: object = ..., + mode: object = ..., + cval: object = ..., + origin: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def gaussian_filter( + input: object, + sigma: object, + order: object = ..., + output: object = ..., + mode: object = ..., + cval: object = ..., + truncate: object = ..., + *, + radius: object = ..., + axes: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def gaussian_filter1d( + input: object, + sigma: object, + axis: object = ..., + order: object = ..., + output: object = ..., + mode: object = ..., + cval: object = ..., + truncate: object = ..., + *, + radius: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def gaussian_gradient_magnitude( + input: object, sigma: object, output: object = ..., mode: object = ..., cval: object = ..., **kwargs: object +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def gaussian_laplace( + input: object, sigma: object, output: object = ..., mode: object = ..., cval: object = ..., **kwargs: object +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def generic_filter( + input: object, + function: object, + size: object = ..., + footprint: object = ..., + output: object = ..., + mode: object = ..., + cval: object = ..., + origin: object = ..., + extra_arguments: object = ..., + extra_keywords: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def generic_filter1d( + input: object, + function: object, + filter_size: object, + axis: object = ..., + output: object = ..., + mode: object = ..., + cval: object = ..., + origin: object = ..., + extra_arguments: object = ..., + extra_keywords: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def generic_gradient_magnitude( + input: object, + derivative: object, + output: object = ..., + mode: object = ..., + cval: object = ..., + extra_arguments: object = ..., + extra_keywords: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def generic_laplace( + input: object, + derivative2: object, + output: object = ..., + mode: object = ..., + cval: object = ..., + extra_arguments: object = ..., + extra_keywords: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def laplace(input: object, output: object = ..., mode: object = ..., cval: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def maximum_filter( + input: object, + size: object = ..., + footprint: object = ..., + output: object = ..., + mode: object = ..., + cval: object = ..., + origin: object = ..., + *, + axes: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def maximum_filter1d( + input: object, + size: object, + axis: object = ..., + output: object = ..., + mode: object = ..., + cval: object = ..., + origin: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def median_filter( + input: object, + size: object = ..., + footprint: object = ..., + output: object = ..., + mode: object = ..., + cval: object = ..., + origin: object = ..., + *, + axes: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def minimum_filter( + input: object, + size: object = ..., + footprint: object = ..., + output: object = ..., + mode: object = ..., + cval: object = ..., + origin: object = ..., + *, + axes: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def minimum_filter1d( + input: object, + size: object, + axis: object = ..., + output: object = ..., + mode: object = ..., + cval: object = ..., + origin: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def percentile_filter( + input: object, + percentile: object, + size: object = ..., + footprint: object = ..., + output: object = ..., + mode: object = ..., + cval: object = ..., + origin: object = ..., + *, + axes: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def prewitt(input: object, axis: object = ..., output: object = ..., mode: object = ..., cval: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def rank_filter( + input: object, + rank: object, + size: object = ..., + footprint: object = ..., + output: object = ..., + mode: object = ..., + cval: object = ..., + origin: object = ..., + *, + axes: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def sobel(input: object, axis: object = ..., output: object = ..., mode: object = ..., cval: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def uniform_filter( + input: object, + size: object = ..., + output: object = ..., + mode: object = ..., + cval: object = ..., + origin: object = ..., + *, + axes: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def uniform_filter1d( + input: object, + size: object, + axis: object = ..., + output: object = ..., + mode: object = ..., + cval: object = ..., + origin: object = ..., +) -> object: ... diff --git a/scipy-stubs/ndimage/fourier.pyi b/scipy-stubs/ndimage/fourier.pyi index 388ef4e2..dced5cce 100644 --- a/scipy-stubs/ndimage/fourier.pyi +++ b/scipy-stubs/ndimage/fourier.pyi @@ -1,6 +1,13 @@ # 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 ._fourier import * +from typing_extensions import deprecated __all__ = ["fourier_ellipsoid", "fourier_gaussian", "fourier_shift", "fourier_uniform"] + +@deprecated("will be removed in SciPy v2.0.0") +def fourier_gaussian(input: object, sigma: object, n: object = ..., axis: object = ..., output: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def fourier_uniform(input: object, size: object, n: object = ..., axis: object = ..., output: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def fourier_ellipsoid(input: object, size: object, n: object = ..., axis: object = ..., output: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def fourier_shift(input: object, shift: object, n: object = ..., axis: object = ..., output: object = ...) -> object: ... diff --git a/scipy-stubs/ndimage/interpolation.pyi b/scipy-stubs/ndimage/interpolation.pyi index 3ba5e7ca..491d5504 100644 --- a/scipy-stubs/ndimage/interpolation.pyi +++ b/scipy-stubs/ndimage/interpolation.pyi @@ -1,7 +1,5 @@ # 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 ._interpolation import * +from typing_extensions import deprecated __all__ = [ "affine_transform", @@ -13,3 +11,79 @@ __all__ = [ "spline_filter1d", "zoom", ] + +@deprecated("will be removed in SciPy v2.0.0") +def affine_transform( + input: object, + matrix: object, + offset: object = ..., + output_shape: object = ..., + output: object = ..., + order: object = ..., + mode: object = ..., + cval: object = ..., + prefilter: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def geometric_transform( + input: object, + mapping: object, + output_shape: object = ..., + output: object = ..., + order: object = ..., + mode: object = ..., + cval: object = ..., + prefilter: object = ..., + extra_arguments: object = ..., + extra_keywords: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def map_coordinates( + input: object, + coordinates: object, + output: object = ..., + order: object = ..., + mode: object = ..., + cval: object = ..., + prefilter: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def rotate( + input: object, + angle: object, + axes: object = ..., + reshape: object = ..., + output: object = ..., + order: object = ..., + mode: object = ..., + cval: object = ..., + prefilter: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def shift( + input: object, + shift: object, + output: object = ..., + order: object = ..., + mode: object = ..., + cval: object = ..., + prefilter: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def spline_filter(input: object, order: object = ..., output: object = ..., mode: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def spline_filter1d( + input: object, order: object = ..., axis: object = ..., output: object = ..., mode: object = ... +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def zoom( + input: object, + zoom: object, + output: object = ..., + order: object = ..., + mode: object = ..., + cval: object = ..., + prefilter: object = ..., + *, + grid_mode: object = ..., +) -> object: ... diff --git a/scipy-stubs/ndimage/measurements.pyi b/scipy-stubs/ndimage/measurements.pyi index c35e2f56..e5106e15 100644 --- a/scipy-stubs/ndimage/measurements.pyi +++ b/scipy-stubs/ndimage/measurements.pyi @@ -1,7 +1,5 @@ # 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 ._measurements import * +from typing_extensions import deprecated __all__ = [ "center_of_mass", @@ -22,3 +20,42 @@ __all__ = [ "variance", "watershed_ift", ] + +@deprecated("will be removed in SciPy v2.0.0") +def label(input: object, structure: object = ..., output: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def find_objects(input: object, max_label: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def value_indices(arr: object, *, ignore_value: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def labeled_comprehension( + input: object, labels: object, index: object, func: object, out_dtype: object, default: object, pass_positions: object = ... +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def sum(input: object, labels: object = ..., index: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def sum_labels(input: object, labels: object = ..., index: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def mean(input: object, labels: object = ..., index: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def variance(input: object, labels: object = ..., index: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def standard_deviation(input: object, labels: object = ..., index: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def minimum(input: object, labels: object = ..., index: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def maximum(input: object, labels: object = ..., index: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def median(input: object, labels: object = ..., index: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def minimum_position(input: object, labels: object = ..., index: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def maximum_position(input: object, labels: object = ..., index: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def extrema(input: object, labels: object = ..., index: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def center_of_mass(input: object, labels: object = ..., index: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def histogram(input: object, min: object, max: object, bins: object, labels: object = ..., index: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def watershed_ift(input: object, markers: object, structure: object = ..., output: object = ...) -> object: ... diff --git a/scipy-stubs/ndimage/morphology.pyi b/scipy-stubs/ndimage/morphology.pyi index 30447dcf..a3545d41 100644 --- a/scipy-stubs/ndimage/morphology.pyi +++ b/scipy-stubs/ndimage/morphology.pyi @@ -1,7 +1,5 @@ # 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 ._morphology import * +from typing_extensions import deprecated __all__ = [ "binary_closing", @@ -25,3 +23,188 @@ __all__ = [ "morphological_laplace", "white_tophat", ] + +@deprecated("will be removed in SciPy v2.0.0") +def binary_closing( + input: object, + structure: object = ..., + iterations: object = ..., + output: object = ..., + origin: object = ..., + mask: object = ..., + border_value: object = ..., + brute_force: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def binary_dilation( + input: object, + structure: object = ..., + iterations: object = ..., + mask: object = ..., + output: object = ..., + border_value: object = ..., + origin: object = ..., + brute_force: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def binary_erosion( + input: object, + structure: object = ..., + iterations: object = ..., + mask: object = ..., + output: object = ..., + border_value: object = ..., + origin: object = ..., + brute_force: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def binary_fill_holes(input: object, structure: object = ..., output: object = ..., origin: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def binary_hit_or_miss( + input: object, + structure1: object = ..., + structure2: object = ..., + output: object = ..., + origin1: object = ..., + origin2: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def binary_opening( + input: object, + structure: object = ..., + iterations: object = ..., + output: object = ..., + origin: object = ..., + mask: object = ..., + border_value: object = ..., + brute_force: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def binary_propagation( + input: object, + structure: object = ..., + mask: object = ..., + output: object = ..., + border_value: object = ..., + origin: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def black_tophat( + input: object, + size: object = ..., + footprint: object = ..., + structure: object = ..., + output: object = ..., + mode: object = ..., + cval: object = ..., + origin: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def distance_transform_bf( + input: object, + metric: object = ..., + sampling: object = ..., + return_distances: object = ..., + return_indices: object = ..., + distances: object = ..., + indices: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def distance_transform_cdt( + input: object, + metric: object = ..., + return_distances: object = ..., + return_indices: object = ..., + distances: object = ..., + indices: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def distance_transform_edt( + input: object, + sampling: object = ..., + return_distances: object = ..., + return_indices: object = ..., + distances: object = ..., + indices: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def generate_binary_structure(rank: object, connectivity: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def grey_closing( + input: object, + size: object = ..., + footprint: object = ..., + structure: object = ..., + output: object = ..., + mode: object = ..., + cval: object = ..., + origin: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def grey_dilation( + input: object, + size: object = ..., + footprint: object = ..., + structure: object = ..., + output: object = ..., + mode: object = ..., + cval: object = ..., + origin: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def grey_erosion( + input: object, + size: object = ..., + footprint: object = ..., + structure: object = ..., + output: object = ..., + mode: object = ..., + cval: object = ..., + origin: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def grey_opening( + input: object, + size: object = ..., + footprint: object = ..., + structure: object = ..., + output: object = ..., + mode: object = ..., + cval: object = ..., + origin: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def iterate_structure(structure: object, iterations: object, origin: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def morphological_gradient( + input: object, + size: object = ..., + footprint: object = ..., + structure: object = ..., + output: object = ..., + mode: object = ..., + cval: object = ..., + origin: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def morphological_laplace( + input: object, + size: object = ..., + footprint: object = ..., + structure: object = ..., + output: object = ..., + mode: object = ..., + cval: object = ..., + origin: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def white_tophat( + input: object, + size: object = ..., + footprint: object = ..., + structure: object = ..., + output: object = ..., + mode: object = ..., + cval: object = ..., + origin: object = ..., +) -> object: ... From 34435fd98d1a3790a8cb16d446a3ce447bdcb805 Mon Sep 17 00:00:00 2001 From: Pavadol Yamsiri Date: Mon, 7 Oct 2024 21:04:40 +1100 Subject: [PATCH 15/22] `stats`: Add deprecated dummy functions --- scipy-stubs/stats/kde.pyi | 28 +++- scipy-stubs/stats/morestats.pyi | 122 ++++++++++++++- scipy-stubs/stats/mstats_basic.pyi | 177 ++++++++++++++++++++- scipy-stubs/stats/mstats_extras.pyi | 27 +++- scipy-stubs/stats/stats.pyi | 234 +++++++++++++++++++++++++++- 5 files changed, 568 insertions(+), 20 deletions(-) diff --git a/scipy-stubs/stats/kde.pyi b/scipy-stubs/stats/kde.pyi index 2957b7e0..568eb044 100644 --- a/scipy-stubs/stats/kde.pyi +++ b/scipy-stubs/stats/kde.pyi @@ -1,6 +1,28 @@ # 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 ._kde import * +from typing_extensions import deprecated __all__ = ["gaussian_kde"] + +@deprecated("will be removed in SciPy v2.0.0") +class gaussian_kde: + @property + def inv_cov(self) -> object: ... + @property + def weights(self) -> object: ... + @property + def neff(self) -> object: ... + def __init__(self, dataset: object, bw_method: object = ..., weights: object = ...) -> None: ... + def evaluate(self, points: object) -> object: ... + def integrate_gaussian(self, mean: object, cov: object) -> object: ... + def integrate_box_1d(self, low: object, high: object) -> object: ... + def integrate_box(self, low_bounds: object, high_bounds: object, maxpts: object = ...) -> object: ... + def integrate_kde(self, other: object) -> object: ... + def resample(self, size: object = ..., seed: object = ...) -> object: ... + def scotts_factor(self) -> object: ... + def silverman_factor(self) -> object: ... + def set_bandwidth(self, bw_method: object = ...) -> object: ... + def pdf(self, x: object) -> object: ... + def logpdf(self, x: object) -> object: ... + def marginal(self, dimensions: object) -> object: ... + __call__ = evaluate + covariance_factor = scotts_factor diff --git a/scipy-stubs/stats/morestats.pyi b/scipy-stubs/stats/morestats.pyi index fd093127..41754e06 100644 --- a/scipy-stubs/stats/morestats.pyi +++ b/scipy-stubs/stats/morestats.pyi @@ -1,10 +1,7 @@ # 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 ._mgc import * -from ._morestats import * -from ._mstats_basic import * -from .contingency import * +from typing_extensions import deprecated + +from . import distributions __all__ = [ "anderson", @@ -39,3 +36,116 @@ __all__ = [ "yeojohnson_normmax", "yeojohnson_normplot", ] + +# mstats_basic +@deprecated("will be removed in SciPy v2.0.0") +def find_repeats(arr: object) -> object: ... + +# contingency +@deprecated("will be removed in SciPy v2.0.0") +def chi2_contingency(observed: object, correction: object = ..., lambda_: object = ...) -> object: ... + +# morestats +@deprecated("will be removed in SciPy v2.0.0") +def bayes_mvs(data: object, alpha: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def mvsdist(data: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def kstat(data: object, n: object = ..., *, axis: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def kstatvar(data: object, n: object = ..., *, axis: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def probplot( + x: object, + sparams: object = ..., + dist: object = ..., + fit: object = ..., + plot: object = ..., + rvalue: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ppcc_max(x: object, brack: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ppcc_plot(x: object, a: object, b: object, dist: object = ..., plot: object = ..., N: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def boxcox_llf(lmb: object, data: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def boxcox(x: object, lmbda: object = ..., alpha: object = ..., optimizer: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def boxcox_normmax( + x: object, + brack: object = ..., + method: object = ..., + optimizer: object = ..., + *, + ymax: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def boxcox_normplot(x: object, la: object, lb: object, plot: object = ..., N: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def yeojohnson(x: object, lmbda: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def yeojohnson_llf(lmb: object, data: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def yeojohnson_normmax(x: object, brack: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def yeojohnson_normplot(x: object, la: object, lb: object, plot: object = ..., N: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def shapiro(x: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def anderson(x: object, dist: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def anderson_ksamp(samples: object, midrank: object = ..., *, method: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ansari(x: object, y: object, alternative: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def bartlett(*samples: object, axis: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def levene(*samples: object, center: object = ..., proportiontocut: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def fligner(*samples: object, center: object = ..., proportiontocut: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def mood(x: object, y: object, axis: object = ..., alternative: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def wilcoxon_result_unpacker(res: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def wilcoxon_result_object(statistic: object, pvalue: object, zstatistic: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def wilcoxon_outputs(kwds: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def wilcoxon( + x: object, + y: object = ..., + zero_method: object = ..., + correction: object = ..., + alternative: object = ..., + method: object = ..., + *, + axis: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def median_test( + *samples: object, + ties: object = ..., + correction: object = ..., + lambda_: object = ..., + nan_policy: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def circmean(samples: object, high: object = ..., low: object = ..., axis: object = ..., nan_policy: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def circvar(samples: object, high: object = ..., low: object = ..., axis: object = ..., nan_policy: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def circstd( + samples: object, + high: object = ..., + low: object = ..., + axis: object = ..., + nan_policy: object = ..., + *, + normalize: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def directional_stats(samples: object, *, axis: object = ..., normalize: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def false_discovery_control(ps: object, *, axis: object = ..., method: object = ...) -> object: ... diff --git a/scipy-stubs/stats/mstats_basic.pyi b/scipy-stubs/stats/mstats_basic.pyi index c6fd7e7f..a92551fc 100644 --- a/scipy-stubs/stats/mstats_basic.pyi +++ b/scipy-stubs/stats/mstats_basic.pyi @@ -1,7 +1,5 @@ # 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 ._mstats_basic import * +from typing_extensions import deprecated __all__ = [ "argstoarray", @@ -63,3 +61,176 @@ __all__ = [ "variation", "winsorize", ] + +@deprecated("will be removed in SciPy v2.0.0") +def argstoarray(*args: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def find_repeats(arr: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def count_tied_groups(x: object, use_missing: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def rankdata(data: object, axis: object = ..., use_missing: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def mode(a: object, axis: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def msign(x: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def pearsonr(x: object, y: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def spearmanr( + x: object, + y: object = ..., + use_ties: object = ..., + axis: object = ..., + nan_policy: object = ..., + alternative: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def kendalltau( + x: object, + y: object, + use_ties: object = ..., + use_missing: object = ..., + method: object = ..., + alternative: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def kendalltau_seasonal(x: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def pointbiserialr(x: object, y: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def linregress(x: object, y: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def theilslopes(y: object, x: object = ..., alpha: object = ..., method: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def siegelslopes(y: object, x: object = ..., method: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def sen_seasonal_slopes(x: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ttest_onesamp(a: object, popmean: object, axis: object = ..., alternative: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ttest_1samp(a: object, popmean: object, axis: object = ..., alternative: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ttest_ind(a: object, b: object, axis: object = ..., equal_var: object = ..., alternative: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ttest_rel(a: object, b: object, axis: object = ..., alternative: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def mannwhitneyu(x: object, y: object, use_continuity: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def kruskal(*args: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def kruskalwallis(*args: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ks_1samp(x: object, cdf: object, args: object = ..., alternative: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ks_2samp(data1: object, data2: object, alternative: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ks_twosamp(data1: object, data2: object, alternative: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def kstest(data1: object, data2: object, args: object = ..., alternative: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def trima(a: object, limits: object = ..., inclusive: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def trimr(a: object, limits: object = ..., inclusive: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def trim( + a: object, + limits: object = ..., + inclusive: object = ..., + relative: object = ..., + axis: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def trimboth(data: object, proportiontocut: object = ..., inclusive: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def trimtail( + data: object, + proportiontocut: object = ..., + tail: object = ..., + inclusive: object = ..., + axis: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def trimmed_mean(a: object, limits: object = ..., inclusive: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def trimmed_var( + a: object, + limits: object = ..., + inclusive: object = ..., + relative: object = ..., + axis: object = ..., + ddof: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def trimmed_std( + a: object, + limits: object = ..., + inclusive: object = ..., + relative: object = ..., + axis: object = ..., + ddof: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def trimmed_stde(a: object, limits: object = ..., inclusive: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def tmean(a: object, limits: object = ..., inclusive: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def tvar(a: object, limits: object = ..., inclusive: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def tmin(a: object, lowerlimit: object = ..., axis: object = ..., inclusive: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def tmax(a: object, upperlimit: object = ..., axis: object = ..., inclusive: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def tsem(a: object, limits: object = ..., inclusive: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def winsorize( + a: object, + limits: object = ..., + inclusive: object = ..., + inplace: object = ..., + axis: object = ..., + nan_policy: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def moment(a: object, moment: object = ..., axis: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def variation(a: object, axis: object = ..., ddof: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def skew(a: object, axis: object = ..., bias: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def kurtosis(a: object, axis: object = ..., fisher: object = ..., bias: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def describe(a: object, axis: object = ..., ddof: object = ..., bias: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def stde_median(data: object, axis: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def skewtest(a: object, axis: object = ..., alternative: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def kurtosistest(a: object, axis: object = ..., alternative: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def normaltest(a: object, axis: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def mquantiles( + a: object, + prob: object = ..., + alphap: object = ..., + betap: object = ..., + axis: object = ..., + limit: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def scoreatpercentile(data: object, per: object, limit: object = ..., alphap: object = ..., betap: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def meppf(data: object, alpha: object = ..., beta: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def plotting_positions(data: object, alpha: object = ..., beta: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def obrientransform(*args: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def sem(a: object, axis: object = ..., ddof: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def f_oneway(*args: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def friedmanchisquare(*args: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def brunnermunzel(x: object, y: object, alternative: object = ...) -> object: ... diff --git a/scipy-stubs/stats/mstats_extras.pyi b/scipy-stubs/stats/mstats_extras.pyi index c745bd35..d587da23 100644 --- a/scipy-stubs/stats/mstats_extras.pyi +++ b/scipy-stubs/stats/mstats_extras.pyi @@ -1,7 +1,5 @@ # 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 ._mstats_extras import * +from typing_extensions import deprecated __all__ = [ "compare_medians_ms", @@ -15,3 +13,26 @@ __all__ = [ "rsh", "trimmed_mean_ci", ] + +@deprecated("will be removed in SciPy v2.0.0") +def hdquantiles(data: object, prob: object = ..., axis: object = ..., var: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def hdmedian(data: object, axis: int = -1, var: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def hdquantiles_sd(data: object, prob: object = ..., axis: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def trimmed_mean_ci( + data: object, limits: object = ..., inclusive: object = ..., alpha: object = ..., axis: object = ... +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def mjci(data: object, prob: object = ..., axis: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def mquantiles_cimj(data: object, prob: object = ..., alpha: object = ..., axis: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def median_cihs(data: object, alpha: object = ..., axis: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def compare_medians_ms(group_1: object, group_2: object, axis: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def idealfourths(data: object, axis: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def rsh(data: object, points: object = ...) -> object: ... diff --git a/scipy-stubs/stats/stats.pyi b/scipy-stubs/stats/stats.pyi index fd891a4f..af941667 100644 --- a/scipy-stubs/stats/stats.pyi +++ b/scipy-stubs/stats/stats.pyi @@ -1,9 +1,7 @@ # 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 . import mstats_basic -from ._mgc import * -from ._stats_py import * +from typing_extensions import deprecated + +from . import distributions as distributions, mstats_basic as mstats_basic __all__ = [ "alexandergovern", @@ -74,3 +72,229 @@ __all__ = [ "zmap", "zscore", ] + +# mgc +@deprecated("will be removed in SciPy v2.0.0") +def multiscale_graphcorr( + x: object, + y: object, + compute_distance: object = ..., + reps: object = ..., + workers: object = ..., + is_twosamp: object = ..., + random_state: object = ..., +) -> object: ... + +# _stats +@deprecated("will be removed in SciPy v2.0.0") +def gmean(a: object, axis: object = ..., dtype: object = ..., weights: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def hmean(a: object, axis: object = ..., dtype: object = ..., *, weights: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def pmean(a: object, p: object, *, axis: object = ..., dtype: object = ..., weights: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def mode(a: object, axis: object = ..., nan_policy: object = ..., keepdims: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def tmean(a: object, limits: object = ..., inclusive: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def tvar(a: object, limits: object = ..., inclusive: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def tmin( + a: object, + lowerlimit: object = ..., + axis: object = ..., + inclusive: object = ..., + nan_policy: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def tmax( + a: object, + upperlimit: object = ..., + axis: object = ..., + inclusive: object = ..., + nan_policy: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def tstd(a: object, limits: object = ..., inclusive: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def tsem(a: object, limits: object = ..., inclusive: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def moment(a: object, order: object = ..., axis: object = ..., nan_policy: object = ..., *, center: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def skew(a: object, axis: object = ..., bias: object = ..., nan_policy: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def kurtosis(a: object, axis: object = ..., fisher: object = ..., bias: object = ..., nan_policy: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def describe(a: object, axis: object = ..., ddof: object = ..., bias: object = ..., nan_policy: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def skewtest(a: object, axis: object = ..., nan_policy: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def kurtosistest(a: object, axis: object = ..., nan_policy: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def normaltest(a: object, axis: object = ..., nan_policy: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def jarque_bera(x: object, *, axis: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def scoreatpercentile( + a: object, per: object, limit: object = ..., interpolation_method: object = ..., axis: object = ... +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def percentileofscore(a: object, score: object, kind: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def cumfreq(a: object, numbins: object = ..., defaultreallimits: object = ..., weights: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def relfreq(a: object, numbins: object = ..., defaultreallimits: object = ..., weights: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def obrientransform(*samples: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def sem(a: object, axis: object = ..., ddof: object = ..., nan_policy: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def zscore(a: object, axis: object = ..., ddof: object = ..., nan_policy: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def gzscore(a: object, *, axis: object = ..., ddof: object = ..., nan_policy: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def zmap(scores: object, compare: object, axis: object = ..., ddof: object = ..., nan_policy: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def gstd(a: object, axis: object = ..., ddof: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def iqr( + x: object, + axis: object = ..., + rng: object = ..., + scale: object = ..., + nan_policy: object = ..., + interpolation: object = ..., + keepdims: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def median_abs_deviation( + x: object, axis: object = ..., center: object = ..., scale: object = ..., nan_policy: object = ... +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def sigmaclip(low: object = ..., high: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def trimboth(a: object, proportiontocut: object, axis: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def trim1(a: object, proportiontocut: object, tail: object = ..., axis: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def trim_mean(a: object, proportiontocut: object, axis: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def f_oneway(*samples: object, axis: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def alexandergovern(*samples: object, nan_policy: object = ..., axis: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def pearsonr(x: object, y: object, *, alternative: object = ..., method: object = ..., axis: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def fisher_exact(table: object, alternative: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def spearmanr( + a: object, + b: object = ..., + axis: object = ..., + nan_policy: object = ..., + alternative: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def pointbiserialr(x: object, y: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def kendalltau( + x: object, + y: object, + *, + nan_policy: object = ..., + method: object = ..., + variant: object = ..., + alternative: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def weightedtau(x: object, y: object, rank: object = ..., weigher: object = ..., additive: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def pack_TtestResult( + statistic: object, pvalue: object, df: object, alternative: object, standard_error: object, estimate: object +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def unpack_TtestResult(res: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ttest_1samp(a: object, popmean: object, axis: object = ..., nan_policy: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ttest_ind_from_stats( + mean1: object, + std1: object, + nobs1: object, + mean2: object, + std2: object, + nobs2: object, + equal_var: object = ..., + alternative: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ttest_ind( + a: object, + b: object, + axis: object = ..., + equal_var: object = ..., + nan_policy: object = ..., + permutations: object = ..., + random_state: object = ..., + alternative: object = ..., + trim: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ttest_rel(a: object, b: object, axis: object = ..., nan_policy: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def power_divergence( + f_obs: object, + f_exp: object = ..., + ddof: object = ..., + axis: object = ..., + lambda_: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def chisquare(f_obs: object, f_exp: object = ..., ddof: object = ..., axis: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ks_1samp(x: object, cdf: object, args: object = ..., alternative: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ks_2samp(data1: object, data2: object, alternative: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def kstest(rvs: object, cdf: object, args: object = ..., N: object = ..., alternative: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def tiecorrect(rankvals: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ranksums(x: object, y: object, alternative: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def kruskal(*samples: object, nan_policy: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def friedmanchisquare(*samples: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def brunnermunzel(x: object, y: object, alternative: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def combine_pvalues(pvalues: object, method: object = ..., weights: object = ..., *, axis: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def quantile_test_iv(x: object, q: object, p: object, alternative: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def quantile_test(x: object, *, q: object = ..., p: object = ..., alternative: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def wasserstein_distance_nd( + u_values: object, + v_values: object, + u_weights: object = ..., + v_weights: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def wasserstein_distance(u_values: object, v_values: object, u_weights: object = ..., v_weights: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def energy_distance(u_values: object, v_values: object, u_weights: object = ..., v_weights: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def find_repeats(arr: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def rankdata(a: object, method: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def expectile(a: object, alpha: object = ..., *, weights: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def linregress(x: object, y: object = ..., alternative: object = ...) -> object: ... + +# mstats_basic +@deprecated("will be removed in SciPy v2.0.0") +def theilslopes(y: object, x: object = ..., alpha: object = ..., method: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def siegelslopes(y: object, x: object = ..., method: object = ...) -> object: ... From be8a8fd7b7268695125619946ee0b3c45ccb9e65 Mon Sep 17 00:00:00 2001 From: Pavadol Yamsiri Date: Mon, 7 Oct 2024 22:01:15 +1100 Subject: [PATCH 16/22] `interpolate`: Add deprecated dummy functions/classes --- scipy-stubs/interpolate/dfitpack.pyi | 30 +++++- scipy-stubs/interpolate/fitpack.pyi | 95 ++++++++++++++++- scipy-stubs/interpolate/fitpack2.pyi | 128 ++++++++++++++++++++++- scipy-stubs/interpolate/interpolate.pyi | 131 +++++++++++++++++++++++- scipy-stubs/interpolate/ndgriddata.pyi | 51 ++++++++- scipy-stubs/interpolate/polyint.pyi | 25 ++++- scipy-stubs/interpolate/rbf.pyi | 11 +- 7 files changed, 448 insertions(+), 23 deletions(-) diff --git a/scipy-stubs/interpolate/dfitpack.pyi b/scipy-stubs/interpolate/dfitpack.pyi index 33b7264b..6cfb8b09 100644 --- a/scipy-stubs/interpolate/dfitpack.pyi +++ b/scipy-stubs/interpolate/dfitpack.pyi @@ -1,7 +1,5 @@ # 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 python Fortran file which doesn't currently have a stub. +from typing import Final __all__ = [ "bispeu", @@ -30,3 +28,29 @@ __all__ = [ "surfit_smth", "types", ] + +bispeu: Final[object] +bispev: Final[object] +curfit: Final[object] +dblint: Final[object] +fpchec: Final[object] +fpcurf0: Final[object] +fpcurf1: Final[object] +fpcurfm1: Final[object] +parcur: Final[object] +parder: Final[object] +pardeu: Final[object] +pardtc: Final[object] +percur: Final[object] +regrid_smth: Final[object] +regrid_smth_spher: Final[object] +spalde: Final[object] +spherfit_lsq: Final[object] +spherfit_smth: Final[object] +splder: Final[object] +splev: Final[object] +splint: Final[object] +sproot: Final[object] +surfit_lsq: Final[object] +surfit_smth: Final[object] +types: Final[object] diff --git a/scipy-stubs/interpolate/fitpack.pyi b/scipy-stubs/interpolate/fitpack.pyi index 0be33bdd..4ce16aee 100644 --- a/scipy-stubs/interpolate/fitpack.pyi +++ b/scipy-stubs/interpolate/fitpack.pyi @@ -1,7 +1,5 @@ # 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 ._fitpack_py import * +from typing_extensions import deprecated __all__ = [ "BSpline", @@ -17,3 +15,94 @@ __all__ = [ "splrep", "sproot", ] + +@deprecated("will be removed in SciPy v2.0.0") +def splprep( + x: object, + w: object = ..., + u: object = ..., + ub: object = ..., + ue: object = ..., + k: object = ..., + task: object = ..., + s: object = ..., + t: object = ..., + full_output: object = ..., + nest: object = ..., + per: object = ..., + quiet: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def splrep( + x: object, + y: object, + w: object = ..., + xb: object = ..., + xe: object = ..., + k: object = ..., + task: object = ..., + s: object = ..., + t: object = ..., + full_output: object = ..., + per: object = ..., + quiet: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def splev(x: object, tck: object, der: object = ..., ext: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def splint(a: object, b: object, tck: object, full_output: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def sproot(tck: object, mest: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def spalde(x: object, tck: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def insert(x: object, tck: object, m: object = ..., per: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def splder(tck: object, n: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def splantider(tck: object, n: object = ...) -> object: ... + +# bsplines +@deprecated("will be removed in SciPy v2.0.0") +class BSpline: + def __init__(self, t: object, c: object, k: object, extrapolate: object = ..., axis: object = ...) -> None: ... + @classmethod + def construct_fast(cls, t: object, c: object, k: object, extrapolate: object = ..., axis: object = ...) -> object: ... + @property + def tck(self) -> object: ... + @classmethod + def basis_element(cls, t: object, extrapolate: object = ...) -> object: ... + @classmethod + def design_matrix(cls, x: object, t: object, k: object, extrapolate: object = ...) -> object: ... + def __call__(self, x: object, nu: object = ..., extrapolate: object = ...) -> object: ... + def derivative(self, nu: object = ...) -> object: ... + def antiderivative(self, nu: object = ...) -> object: ... + def integrate(self, a: object, b: object, extrapolate: object = ...) -> object: ... + @classmethod + def from_power_basis(cls, pp: object, bc_type: object = ...) -> object: ... + def insert_knot(self, x: object, m: object = ...) -> object: ... + +# fitpack_impl +@deprecated("will be removed in SciPy v2.0.0") +def bisplrep( + x: object, + y: object, + z: object, + w: object = ..., + xb: object = ..., + xe: object = ..., + yb: object = ..., + ye: object = ..., + kx: object = ..., + ky: object = ..., + task: object = ..., + s: object = ..., + eps: object = ..., + tx: object = ..., + ty: object = ..., + full_output: object = ..., + nxest: object = ..., + nyest: object = ..., + quiet: object = ..., +) -> object: ... +def bisplev(x: object, y: object, tck: object, dx: object = ..., dy: object = ...) -> object: ... diff --git a/scipy-stubs/interpolate/fitpack2.pyi b/scipy-stubs/interpolate/fitpack2.pyi index 438efb78..2a320bd4 100644 --- a/scipy-stubs/interpolate/fitpack2.pyi +++ b/scipy-stubs/interpolate/fitpack2.pyi @@ -1,7 +1,5 @@ # 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 ._fitpack2 import * +from typing_extensions import deprecated __all__ = [ "BivariateSpline", @@ -15,3 +13,127 @@ __all__ = [ "SmoothSphereBivariateSpline", "UnivariateSpline", ] + +@deprecated("will be removed in SciPy v2.0.0") +class UnivariateSpline: + def __init__( + self, + x: object, + y: object, + w: object = ..., + bbox: object = ..., + k: object = ..., + s: object = ..., + ext: object = ..., + check_finite: object = ..., + ) -> None: ... + @staticmethod + def validate_input( + x: object, y: object, w: object, bbox: object, k: object, s: object, ext: object, check_finite: object + ) -> object: ... + def set_smoothing_factor(self, s: object) -> None: ... + def __call__(self, x: object, nu: object = ..., ext: object = ...) -> object: ... + def get_knots(self) -> object: ... + def get_coeffs(self) -> object: ... + def get_residual(self) -> object: ... + def integral(self, a: object, b: object) -> object: ... + def derivatives(self, x: object) -> object: ... + def roots(self) -> object: ... + def derivative(self, n: object = ...) -> object: ... + def antiderivative(self, n: object = ...) -> object: ... + +@deprecated("will be removed in SciPy v2.0.0") +class InterpolatedUnivariateSpline: + def __init__( + self, + x: object, + y: object, + w: object = ..., + bbox: object = ..., + k: object = ..., + ext: object = ..., + check_finite: object = ..., + ) -> None: ... + +@deprecated("will be removed in SciPy v2.0.0") +class LSQUnivariateSpline: + def __init__( + self, + x: object, + y: object, + t: object, + w: object = ..., + bbox: object = ..., + k: object = ..., + ext: object = ..., + check_finite: object = ..., + ) -> None: ... + +@deprecated("will be removed in SciPy v2.0.0") +class BivariateSpline: + def ev(self, xi: object, yi: object, dx: object = ..., dy: object = ...) -> object: ... + def integral(self, xa: object, xb: object, ya: object, yb: object) -> object: ... + +@deprecated("will be removed in SciPy v2.0.0") +class SmoothBivariateSpline: + def __init__( + self, + x: object, + y: object, + z: object, + w: object = ..., + bbox: object = ..., + kx: object = ..., + ky: object = ..., + s: object = ..., + eps: object = ..., + ) -> None: ... + +@deprecated("will be removed in SciPy v2.0.0") +class LSQBivariateSpline: + def __init__( + self, + x: object, + y: object, + z: object, + tx: object, + ty: object, + w: object = ..., + bbox: object = ..., + kx: object = ..., + ky: object = ..., + eps: object = ..., + ) -> None: ... + +@deprecated("will be removed in SciPy v2.0.0") +class RectBivariateSpline: + def __init__( + self, x: object, y: object, z: object, bbox: object = ..., kx: object = ..., ky: object = ..., s: object = ... + ) -> None: ... + +@deprecated("will be removed in SciPy v2.0.0") +class SmoothSphereBivariateSpline: + def __init__(self, theta: object, phi: object, r: object, w: object = ..., s: object = ..., eps: object = ...) -> None: ... + def __call__(self, theta: object, phi: object, dtheta: object = ..., dphi: object = ..., grid: object = ...) -> object: ... + +@deprecated("will be removed in SciPy v2.0.0") +class LSQSphereBivariateSpline: + def __init__( + self, theta: object, phi: object, r: object, tt: object, tp: object, w: object = ..., eps: object = ... + ) -> None: ... + def __call__(self, theta: object, phi: object, dtheta: object = ..., dphi: object = ..., grid: object = ...) -> object: ... + +@deprecated("will be removed in SciPy v2.0.0") +class RectSphereBivariateSpline: + def __init__( + self, + u: object, + v: object, + r: object, + s: object = ..., + pole_continuity: object = ..., + pole_values: object = ..., + pole_exact: object = ..., + pole_flat: object = ..., + ) -> None: ... + def __call__(self, theta: object, phi: object, dtheta: object = ..., dphi: object = ..., grid: object = ...) -> object: ... diff --git a/scipy-stubs/interpolate/interpolate.pyi b/scipy-stubs/interpolate/interpolate.pyi index 9e306fd8..70a2f101 100644 --- a/scipy-stubs/interpolate/interpolate.pyi +++ b/scipy-stubs/interpolate/interpolate.pyi @@ -1,9 +1,5 @@ # 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 ._fitpack2 import * -from ._interpolate import * -from ._rgi import * +from typing_extensions import deprecated __all__ = [ "BPoly", @@ -18,3 +14,128 @@ __all__ = [ "lagrange", "make_interp_spline", ] + +# _fitpack2 +@deprecated("will be removed in SciPy v2.0.0") +class RectBivariateSpline: + def __init__( + self, x: object, y: object, z: object, /, *, bbox: object = ..., kx: object = ..., ky: object = ..., s: object = ... + ) -> None: ... + +# _rgi +@deprecated("will be removed in SciPy v2.0.0") +class RegularGridInterpolator: + def __init__( + self, + points: object, + values: object, + method: object = ..., + bounds_error: object = ..., + fill_value: object = ..., + *, + solver: object = ..., + solver_args: object = ..., + ) -> None: ... + def __call__(self, xi: object, method: object = ..., *, nu: object = ...) -> object: ... + +@deprecated("will be removed in SciPy v2.0.0") +def interpn( + points: object, + values: object, + xi: object, + method: object = ..., + bounds_error: object = ..., + fill_value: object = ..., +) -> object: ... + +# _interpolate +@deprecated("will be removed in SciPy v2.0.0") +class BPoly: + def derivative(self, nu: object = ...) -> object: ... + def antiderivative(self, nu: object = ...) -> object: ... + def integrate(self, a: object, b: object, extrapolate: object = ...) -> object: ... + def extend(self, c: object, x: object) -> object: ... + @classmethod + def from_power_basis(cls, pp: object, extrapolate: object = ...) -> object: ... + @classmethod + def from_derivatives(cls, xi: object, yi: object, orders: object = ..., extrapolate: object = ...) -> object: ... + +@deprecated("will be removed in SciPy v2.0.0") +class NdPPoly: + def __init__(self, c: object, x: object, extrapolate: object = ...) -> None: ... + @classmethod + def construct_fast(cls, c: object, x: object, extrapolate: object = ...) -> object: ... + def __call__(self, x: object, nu: object = ..., extrapolate: object = ...) -> object: ... + def derivative(self, nu: object) -> object: ... + def antiderivative(self, nu: object) -> object: ... + def integrate_1d(self, a: object, b: object, axis: object, extrapolate: object = ...) -> object: ... + def integrate(self, ranges: object, extrapolate: object = ...) -> object: ... + +@deprecated("will be removed in SciPy v2.0.0") +class PPoly: + def derivative(self, nu: object = ...) -> object: ... + def antiderivative(self, nu: object = ...) -> object: ... + def integrate(self, a: object, b: object, extrapolate: object = ...) -> object: ... + def solve(self, y: object = ..., discontinuity: object = ..., extrapolate: object = ...) -> object: ... + def roots(self, discontinuity: object = ..., extrapolate: object = ...) -> object: ... + @classmethod + def from_spline(cls, tck: object, extrapolate: object = ...) -> object: ... + @classmethod + def from_bernstein_basis(cls, bp: object, extrapolate: object = ...) -> object: ... + +@deprecated("will be removed in SciPy v2.0.0") +class BSpline: + def __init__(self, t: object, c: object, k: object, extrapolate: object = ..., axis: object = ...) -> None: ... + @classmethod + def construct_fast(cls, t: object, c: object, k: object, extrapolate: object = ..., axis: object = ...) -> object: ... + @property + def tck(self) -> object: ... + @classmethod + def basis_element(cls, t: object, extrapolate: object = ...) -> object: ... + @classmethod + def design_matrix(cls, x: object, t: object, k: object, extrapolate: object = ...) -> object: ... + def __call__(self, x: object, nu: object = ..., extrapolate: object = ...) -> object: ... + def derivative(self, nu: object = ...) -> object: ... + def antiderivative(self, nu: object = ...) -> object: ... + def integrate(self, a: object, b: object, extrapolate: object = ...) -> object: ... + @classmethod + def from_power_basis(cls, pp: object, bc_type: object = ...) -> object: ... + def insert_knot(self, x: object, m: object = ...) -> object: ... + +@deprecated("will be removed in SciPy v2.0.0") +class interp1d: + def __init__( + self, + x: object, + y: object, + kind: object = ..., + axis: object = ..., + copy: object = ..., + bounds_error: object = ..., + fill_value: object = ..., + assume_sorted: object = ..., + ) -> None: ... + @property + def fill_value(self) -> object: ... + @fill_value.setter + def fill_value(self, fill_value: object) -> None: ... + +@deprecated("will be removed in SciPy v2.0.0") +class interp2d: + def __init__( + self, + x: object, + y: object, + z: object, + kind: object = ..., + copy: object = ..., + bounds_error: object = ..., + fill_value: object = ..., + ) -> None: ... + +@deprecated("will be removed in SciPy v2.0.0") +def lagrange(x: object, w: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def make_interp_spline( + x: object, y: object, k: object = ..., t: object = ..., bc_type: object = ..., axis: object = ..., check_finite: object = ... +) -> object: ... diff --git a/scipy-stubs/interpolate/ndgriddata.pyi b/scipy-stubs/interpolate/ndgriddata.pyi index 5a40c6cf..df69edd7 100644 --- a/scipy-stubs/interpolate/ndgriddata.pyi +++ b/scipy-stubs/interpolate/ndgriddata.pyi @@ -1,6 +1,51 @@ # 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 ._ndgriddata import * +from typing_extensions import deprecated __all__ = ["CloughTocher2DInterpolator", "LinearNDInterpolator", "NearestNDInterpolator", "griddata"] + +@deprecated("will be removed in SciPy v2.0.0") +class NearestNDInterpolator: + def __init__( + self, + /, + x: object, + y: object, + rescale: object = ..., + tree_options: object = ..., + ) -> None: ... + def __call__(self, /, *args: object, **query_options: object) -> object: ... + +@deprecated("will be removed in SciPy v2.0.0") +def griddata( + points: object, + values: object, + xi: object, + method: object = ..., + fill_value: float = ..., + rescale: object = ..., +) -> object: ... + +# interpnd +@deprecated("will be removed in SciPy v2.0.0") +class LinearNDInterpolator: + def __init__( + self, + /, + points: object, + values: object, + fill_value: object = ..., + rescale: object = ..., + ) -> None: ... + +@deprecated("will be removed in SciPy v2.0.0") +class CloughTocher2DInterpolator: + def __init__( + self, + /, + points: object, + values: object, + fill_value: object = ..., + tol: object = ..., + maxiter: object = ..., + rescale: object = ..., + ) -> None: ... diff --git a/scipy-stubs/interpolate/polyint.pyi b/scipy-stubs/interpolate/polyint.pyi index deb0425f..40f34fa6 100644 --- a/scipy-stubs/interpolate/polyint.pyi +++ b/scipy-stubs/interpolate/polyint.pyi @@ -1,7 +1,5 @@ # 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 ._polyint import * +from typing_extensions import deprecated __all__ = [ "BarycentricInterpolator", @@ -10,3 +8,24 @@ __all__ = [ "barycentric_interpolate", "krogh_interpolate", ] + +@deprecated("will be removed in SciPy v2.0.0") +class KroghInterpolator: + def __init__(self: object, xi: object, yi: object, axis: object = ...) -> None: ... + +@deprecated("will be removed in SciPy v2.0.0") +class BarycentricInterpolator: + def __init__( + self: object, xi: object, yi: object = ..., axis: object = ..., *, wi: object = ..., random_state: object = ... + ) -> None: ... + def __call__(self: object, x: object) -> object: ... + def set_yi(self: object, yi: object, axis: object = ...) -> None: ... + def add_xi(self: object, xi: object, yi: object = ...) -> None: ... + def derivative(self: object, x: object, der: object = ...) -> object: ... + +@deprecated("will be removed in SciPy v2.0.0") +def krogh_interpolate(xi: object, yi: object, x: object, der: object = ..., axis: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def approximate_taylor_polynomial(f: object, x: object, degree: object, scale: object, order: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def barycentric_interpolate(xi: object, yi: object, x: object, axis: object = ..., *, der: object = ...) -> object: ... diff --git a/scipy-stubs/interpolate/rbf.pyi b/scipy-stubs/interpolate/rbf.pyi index fbf225ba..af3a9b83 100644 --- a/scipy-stubs/interpolate/rbf.pyi +++ b/scipy-stubs/interpolate/rbf.pyi @@ -1,6 +1,11 @@ # 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 ._rbf import * +from typing_extensions import deprecated __all__ = ["Rbf"] + +@deprecated("will be removed in SciPy v2.0.0") +class Rbf: + @property + def A(self) -> object: ... + def __init__(self, *args: object, **kwargs: object) -> None: ... + def __call__(self, *args: object) -> object: ... From ef98ebd52fc1510557aabdcde51a707c88d798c8 Mon Sep 17 00:00:00 2001 From: Pavadol Yamsiri Date: Mon, 7 Oct 2024 23:33:14 +1100 Subject: [PATCH 17/22] `signal`: Add dummy deprecated functions/classes --- scipy-stubs/signal/bsplines.pyi | 34 ++++- scipy-stubs/signal/filter_design.pyi | 144 +++++++++++++++++++- scipy-stubs/signal/fir_filter_design.pyi | 66 ++++++++- scipy-stubs/signal/lti_conversion.pyi | 37 ++++- scipy-stubs/signal/ltisys.pyi | 165 ++++++++++++++++++++++- scipy-stubs/signal/signaltools.pyi | 147 ++++++++++++++++++-- scipy-stubs/signal/spectral.pyi | 110 ++++++++++++++- scipy-stubs/signal/spline.pyi | 19 ++- scipy-stubs/signal/waveforms.pyi | 27 +++- scipy-stubs/signal/wavelets.pyi | 23 +++- scipy-stubs/signal/windows/windows.pyi | 55 +++++++- 11 files changed, 782 insertions(+), 45 deletions(-) diff --git a/scipy-stubs/signal/bsplines.pyi b/scipy-stubs/signal/bsplines.pyi index 8af3880b..657413df 100644 --- a/scipy-stubs/signal/bsplines.pyi +++ b/scipy-stubs/signal/bsplines.pyi @@ -1,6 +1,32 @@ # 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 ._spline_filters import * +from typing_extensions import deprecated -__all__ = ["cspline1d", "cspline1d_eval", "cspline2d", "gauss_spline", "qspline1d", "qspline1d_eval", "sepfir2d", "spline_filter"] +__all__ = [ + "cspline1d", + "cspline1d_eval", + "cspline2d", + "gauss_spline", + "qspline1d", + "qspline1d_eval", + "sepfir2d", + "spline_filter", +] + +@deprecated("will be removed in SciPy v2.0.0") +def cspline1d(signal: object, lamb: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def cspline1d_eval(cj: object, newx: object, dx: object = ..., x0: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def cspline2d(signal: object, lamb: object = ..., precision: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def gauss_spline(x: object, n: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def qspline1d(signal: object, lamb: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def qspline1d_eval(cj: object, newx: object, dx: object = ..., x0: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def spline_filter(Iin: object, lmbda: object = ...) -> object: ... + +# _spline +@deprecated("will be removed in SciPy v2.0.0") +def sepfir2d(input: object, hrow: object, hcol: object) -> object: ... diff --git a/scipy-stubs/signal/filter_design.pyi b/scipy-stubs/signal/filter_design.pyi index a12f7860..8822a640 100644 --- a/scipy-stubs/signal/filter_design.pyi +++ b/scipy-stubs/signal/filter_design.pyi @@ -1,7 +1,5 @@ # 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 ._filter_design import * +from typing_extensions import deprecated __all__ = [ "BadCoefficients", @@ -51,3 +49,143 @@ __all__ = [ "zpk2sos", "zpk2tf", ] + +@deprecated("will be removed in SciPy v2.0.0") +class BadCoefficients: ... + +@deprecated("will be removed in SciPy v2.0.0") +def findfreqs(num: object, den: object, N: object, kind: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def freqs(b: object, a: object, worN: object = ..., plot: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def freqs_zpk(z: object, p: object, k: object, worN: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def freqz( + b: object, + a: object = ..., + worN: object = ..., + whole: object = ..., + plot: object = ..., + fs: object = ..., + include_nyquist: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def freqz_zpk(z: object, p: object, k: object, worN: object = ..., whole: object = ..., fs: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def group_delay(system: object, w: object = ..., whole: object = ..., fs: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def sosfreqz(sos: object, worN: object = ..., whole: object = ..., fs: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def tf2zpk(b: object, a: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def zpk2tf(z: object, p: object, k: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def tf2sos(b: object, a: object, pairing: object = ..., *, analog: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def sos2tf(sos: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def sos2zpk(sos: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def zpk2sos(z: object, p: object, k: object, pairing: object = ..., *, analog: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def normalize(b: object, a: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def lp2lp(b: object, a: object, wo: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def lp2hp(b: object, a: object, wo: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def lp2bp(b: object, a: object, wo: object = ..., bw: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def lp2bs(b: object, a: object, wo: object = ..., bw: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def bilinear(b: object, a: object, fs: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def iirdesign( + wp: object, + ws: object, + gpass: object, + gstop: object, + analog: object = ..., + ftype: object = ..., + output: object = ..., + fs: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def iirfilter( + N: object, + Wn: object, + rp: object = ..., + rs: object = ..., + btype: object = ..., + analog: object = ..., + ftype: object = ..., + output: object = ..., + fs: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def bilinear_zpk(z: object, p: object, k: object, fs: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def lp2lp_zpk(z: object, p: object, k: object, wo: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def lp2hp_zpk(z: object, p: object, k: object, wo: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def lp2bp_zpk(z: object, p: object, k: object, wo: object = ..., bw: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def lp2bs_zpk(z: object, p: object, k: object, wo: object = ..., bw: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def butter( + N: object, Wn: object, btype: object = ..., analog: object = ..., output: object = ..., fs: object = ... +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def cheby1( + N: object, rp: object, Wn: object, btype: object = ..., analog: object = ..., output: object = ..., fs: object = ... +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def cheby2( + N: object, rs: object, Wn: object, btype: object = ..., analog: object = ..., output: object = ..., fs: object = ... +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ellip( + N: object, + rp: object, + rs: object, + Wn: object, + btype: object = ..., + analog: object = ..., + output: object = ..., + fs: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def bessel( + N: object, Wn: object, btype: object = ..., analog: object = ..., output: object = ..., norm: object = ..., fs: object = ... +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def band_stop_obj( + wp: object, ind: object, passb: object, stopb: object, gpass: object, gstop: object, type: object +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def buttord(wp: object, ws: object, gpass: object, gstop: object, analog: object = ..., fs: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def cheb1ord(wp: object, ws: object, gpass: object, gstop: object, analog: object = ..., fs: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def cheb2ord(wp: object, ws: object, gpass: object, gstop: object, analog: object = ..., fs: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ellipord(wp: object, ws: object, gpass: object, gstop: object, analog: object = ..., fs: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def buttap(N: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def cheb1ap(N: object, rp: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def cheb2ap(N: object, rs: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ellipap(N: object, rp: object, rs: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def besselap(N: object, norm: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def iirnotch(w0: object, Q: object, fs: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def iirpeak(w0: object, Q: object, fs: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def iircomb(w0: object, Q: object, ftype: object = ..., fs: object = ..., *, pass_zero: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def gammatone(freq: object, ftype: object, order: object = ..., numtaps: object = ..., fs: object = ...) -> object: ... diff --git a/scipy-stubs/signal/fir_filter_design.pyi b/scipy-stubs/signal/fir_filter_design.pyi index c17a1bc3..7c06fa5a 100644 --- a/scipy-stubs/signal/fir_filter_design.pyi +++ b/scipy-stubs/signal/fir_filter_design.pyi @@ -1,6 +1,64 @@ # 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 ._fir_filter_design import * +from typing_extensions import deprecated -__all__ = ["firls", "firwin", "firwin2", "kaiser_atten", "kaiser_beta", "kaiserord", "minimum_phase", "remez"] +__all__ = [ + "firls", + "firwin", + "firwin2", + "kaiser_atten", + "kaiser_beta", + "kaiserord", + "minimum_phase", + "remez", +] + +@deprecated("will be removed in SciPy v2.0.0") +def firwin( + numtaps: object, + cutoff: object, + *, + width: object = ..., + window: object = ..., + pass_zero: object = ..., + scale: object = ..., + fs: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def firwin2( + numtaps: object, + freq: object, + gain: object, + *, + nfreqs: object = ..., + window: object = ..., + antisymmetric: object = ..., + fs: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def firls(numtaps: object, bands: object, desired: object, *, weight: object = ..., fs: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def kaiser_beta(a: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def kaiser_atten(numtaps: object, width: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def kaiserord(ripple: object, width: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def minimum_phase( + h: object, + method: object = ..., + n_fft: object = ..., + *, + half: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def remez( + numtaps: object, + bands: object, + desired: object, + *, + weight: object = ..., + type: object = ..., + maxiter: object = ..., + grid_density: object = ..., + fs: object = ..., +) -> object: ... diff --git a/scipy-stubs/signal/lti_conversion.pyi b/scipy-stubs/signal/lti_conversion.pyi index a8fbbb73..5c6e8b68 100644 --- a/scipy-stubs/signal/lti_conversion.pyi +++ b/scipy-stubs/signal/lti_conversion.pyi @@ -1,6 +1,35 @@ # 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 ._lti_conversion import * +from typing_extensions import deprecated -__all__ = ["abcd_normalize", "cont2discrete", "normalize", "ss2tf", "ss2zpk", "tf2ss", "tf2zpk", "zpk2ss", "zpk2tf"] +__all__ = [ + "abcd_normalize", + "cont2discrete", + "normalize", + "ss2tf", + "ss2zpk", + "tf2ss", + "tf2zpk", + "zpk2ss", + "zpk2tf", +] + +@deprecated("will be removed in SciPy v2.0.0") +def tf2ss(num: object, den: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def abcd_normalize(A: object = ..., B: object = ..., C: object = ..., D: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ss2tf(A: object, B: object, C: object, D: object, input: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def zpk2ss(z: object, p: object, k: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ss2zpk(A: object, B: object, C: object, D: object, input: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def cont2discrete(system: object, dt: object, method: object = ..., alpha: object = ...) -> object: ... + +# filter_design +@deprecated("will be removed in SciPy v2.0.0") +def normalize(b: object, a: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def tf2zpk(b: object, a: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def zpk2tf(z: object, p: object, k: object) -> object: ... diff --git a/scipy-stubs/signal/ltisys.pyi b/scipy-stubs/signal/ltisys.pyi index db7b3cc0..ec1d50bf 100644 --- a/scipy-stubs/signal/ltisys.pyi +++ b/scipy-stubs/signal/ltisys.pyi @@ -1,9 +1,5 @@ # 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 ._filter_design import * -from ._lti_conversion import * -from ._ltisys import * +from typing_extensions import Self, deprecated __all__ = [ "StateSpace", @@ -36,3 +32,162 @@ __all__ = [ "zpk2ss", "zpk2tf", ] + +# filter_design +@deprecated("will be removed in SciPy v2.0.0") +def freqs(b: object, a: object, worN: object = ..., plot: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def freqs_zpk(z: object, p: object, k: object, worN: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def freqz( + b: object, + a: object = ..., + worN: object = ..., + whole: object = ..., + plot: object = ..., + fs: object = ..., + include_nyquist: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def freqz_zpk(z: object, p: object, k: object, worN: object = ..., whole: object = ..., fs: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def normalize(b: object, a: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def tf2zpk(b: object, a: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def zpk2tf(z: object, p: object, k: object) -> object: ... + +# lti_conversion +@deprecated("will be removed in SciPy v2.0.0") +def abcd_normalize(A: object = ..., B: object = ..., C: object = ..., D: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def cont2discrete(system: object, dt: object, method: object = ..., alpha: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def tf2ss(num: object, den: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ss2tf(A: object, B: object, C: object, D: object, input: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def ss2zpk(A: object, B: object, C: object, D: object, input: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def zpk2ss(z: object, p: object, k: object) -> object: ... + +# ltisys +@deprecated("will be removed in SciPy v2.0.0") +class StateSpace: + __array_priority__: object + __array_ufunc__: object + def __new__(cls, *system: object, **kwargs: object) -> Self: ... + def __init__(self, *system: object, **kwargs: object) -> None: ... + def __mul__(self, other: object) -> object: ... + def __rmul__(self, other: object) -> object: ... + def __neg__(self) -> object: ... + def __add__(self, other: object) -> object: ... + def __sub__(self, other: object) -> object: ... + def __radd__(self, other: object) -> object: ... + def __rsub__(self, other: object) -> object: ... + def __truediv__(self, other: object) -> object: ... + @property + def A(self) -> object: ... + @A.setter + def A(self, A: object) -> None: ... + @property + def B(self) -> object: ... + @B.setter + def B(self, B: object) -> None: ... + @property + def C(self) -> object: ... + @C.setter + def C(self, C: object) -> None: ... + @property + def D(self) -> object: ... + @D.setter + def D(self, D: object) -> None: ... + def to_tf(self, **kwargs: object) -> object: ... + def to_zpk(self, **kwargs: object) -> object: ... + def to_ss(self) -> object: ... + +@deprecated("will be removed in SciPy v2.0.0") +class TransferFunction: + def __new__(cls, *system: object, **kwargs: object) -> Self: ... + def __init__(self, *system: object, **kwargs: object) -> None: ... + @property + def num(self) -> object: ... + @num.setter + def num(self, num: object) -> None: ... + @property + def den(self) -> object: ... + @den.setter + def den(self, den: object) -> None: ... + def to_tf(self) -> object: ... + def to_zpk(self) -> object: ... + def to_ss(self) -> object: ... + +@deprecated("will be removed in SciPy v2.0.0") +class ZerosPolesGain: + def __new__(cls, *system: object, **kwargs: object) -> Self: ... + def __init__(self, *system: object, **kwargs: object) -> None: ... + @property + def zeros(self) -> object: ... + @zeros.setter + def zeros(self, zeros: object) -> None: ... + @property + def poles(self) -> object: ... + @poles.setter + def poles(self, poles: object) -> None: ... + @property + def gain(self) -> object: ... + @gain.setter + def gain(self, gain: object) -> None: ... + def to_tf(self) -> object: ... + def to_zpk(self) -> object: ... + def to_ss(self) -> object: ... + +@deprecated("will be removed in SciPy v2.0.0") +class lti: + def __new__(cls, *system: object) -> Self: ... + def __init__(self, *system: object) -> None: ... + def impulse(self, X0: object = ..., T: object = ..., N: object = ...) -> object: ... + def step(self, X0: object = ..., T: object = ..., N: object = ...) -> object: ... + def output(self, U: object, T: object, X0: object = ...) -> object: ... + def bode(self, w: object = ..., n: object = ...) -> object: ... + def freqresp(self, w: object = ..., n: object = ...) -> object: ... + def to_discrete(self, dt: object, method: object = ..., alpha: object = ...) -> object: ... + +@deprecated("will be removed in SciPy v2.0.0") +class dlti: + def __new__(cls, *system: object, **kwargs: object) -> Self: ... + def __init__(self, *system: object, **kwargs: object) -> None: ... + @property + def dt(self) -> object: ... + @dt.setter + def dt(self, dt: object) -> None: ... + def impulse(self, x0: object = ..., t: object = ..., n: object = ...) -> object: ... + def step(self, x0: object = ..., t: object = ..., n: object = ...) -> object: ... + def output(self, u: object, t: object, x0: object = ...) -> object: ... + def bode(self, w: object = ..., n: object = ...) -> object: ... + def freqresp(self, w: object = ..., n: object = ..., whole: object = ...) -> object: ... + +@deprecated("will be removed in SciPy v2.0.0") +def lsim(system: object, U: object, T: object, X0: object = ..., interp: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def impulse(system: object, X0: object = ..., T: object = ..., N: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def step(system: object, X0: object = ..., T: object = ..., N: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def bode(system: object, w: object = ..., n: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def freqresp(system: object, w: object = ..., n: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def place_poles( + A: object, B: object, poles: object, method: object = ..., rtol: object = ..., maxiter: object = ... +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def dlsim(system: object, u: object, t: object = ..., x0: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def dimpulse(system: object, x0: object = ..., t: object = ..., n: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def dstep(system: object, x0: object = ..., t: object = ..., n: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def dfreqresp(system: object, w: object = ..., n: object = ..., whole: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def dbode(system: object, w: object = ..., n: object = ...) -> object: ... diff --git a/scipy-stubs/signal/signaltools.pyi b/scipy-stubs/signal/signaltools.pyi index a652bd9b..e8228c82 100644 --- a/scipy-stubs/signal/signaltools.pyi +++ b/scipy-stubs/signal/signaltools.pyi @@ -1,12 +1,5 @@ # 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 ._filter_design import * -from ._fir_filter_design import * -from ._ltisys import * -from ._signaltools import * -from ._upfirdn import * -from .windows import * +from typing_extensions import Self, deprecated __all__ = [ "cheby1", @@ -48,3 +41,141 @@ __all__ = [ "vectorstrength", "wiener", ] + +# filter_design +@deprecated("will be removed in SciPy v2.0.0") +def cheby1( + N: object, rp: object, Wn: object, btype: object = ..., analog: object = ..., output: object = ..., fs: object = ... +) -> object: ... + +# fir_filter_design +@deprecated("will be removed in SciPy v2.0.0") +def firwin( + numtaps: object, + cutoff: object, + *, + width: object = ..., + window: object = ..., + pass_zero: object = ..., + scale: object = ..., + fs: object = ..., +) -> object: ... + +# ltisys +@deprecated("will be removed in SciPy v2.0.0") +class dlti: + def __new__(cls, *system: object, **kwargs: object) -> Self: ... + def __init__(self, *system: object, **kwargs: object) -> None: ... + @property + def dt(self) -> object: ... + @dt.setter + def dt(self, dt: object) -> None: ... + def impulse(self, x0: object = ..., t: object = ..., n: object = ...) -> object: ... + def step(self, x0: object = ..., t: object = ..., n: object = ...) -> object: ... + def output(self, u: object, t: object, x0: object = ...) -> object: ... + def bode(self, w: object = ..., n: object = ...) -> object: ... + def freqresp(self, w: object = ..., n: object = ..., whole: object = ...) -> object: ... + +# upfirdn +def upfirdn( + h: object, + x: object, + up: object = ..., + down: object = ..., + axis: object = ..., + mode: object = ..., + cval: object = ..., +) -> object: ... + +# window +@deprecated("will be removed in SciPy v2.0.0") +def get_window(window: object, Nx: object, fftbins: object = ...) -> object: ... + +# signaltools +@deprecated("will be removed in SciPy v2.0.0") +def correlate(in1: object, in2: object, mode: object = ..., method: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def correlation_lags(in1_len: object, in2_len: object, mode: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def fftconvolve(in1: object, in2: object, mode: object = ..., axes: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def oaconvolve(in1: object, in2: object, mode: object = ..., axes: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def choose_conv_method(in1: object, in2: object, mode: object = ..., measure: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def convolve(in1: object, in2: object, mode: object = ..., method: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def order_filter(a: object, domain: object, rank: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def medfilt(volume: object, kernel_size: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def wiener(im: object, mysize: object = ..., noise: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def convolve2d(in1: object, in2: object, mode: object = ..., boundary: object = ..., fillvalue: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def correlate2d(in1: object, in2: object, mode: object = ..., boundary: object = ..., fillvalue: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def medfilt2d(input: object, kernel_size: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def lfilter(b: object, a: object, x: object, axis: object = ..., zi: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def lfiltic(b: object, a: object, y: object, x: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def deconvolve(signal: object, divisor: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def hilbert(x: object, N: object = ..., axis: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def hilbert2(x: object, N: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def unique_roots(p: object, tol: object = ..., rtype: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def invres(r: object, p: object, k: object, tol: object = ..., rtype: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def residue(b: object, a: object, tol: object = ..., rtype: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def residuez(b: object, a: object, tol: object = ..., rtype: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def invresz(r: object, p: object, k: object, tol: object = ..., rtype: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def resample( + x: object, num: object, t: object = ..., axis: object = ..., window: object = ..., domain: object = ... +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def resample_poly( + x: object, up: object, down: object, axis: object = ..., window: object = ..., padtype: object = ..., cval: object = ... +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def vectorstrength(events: object, period: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def detrend( + data: object, + axis: object = ..., + type: object = ..., + bp: object = ..., + overwrite_data: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def lfilter_zi(b: object, a: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def sosfilt_zi(sos: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def filtfilt( + b: object, + a: object, + x: object, + axis: object = ..., + padtype: object = ..., + padlen: object = ..., + method: object = ..., + irlen: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def sosfilt(sos: object, x: object, axis: object = ..., zi: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def sosfiltfilt(sos: object, x: object, axis: object = ..., padtype: object = ..., padlen: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def decimate( + x: object, q: object, n: object = ..., ftype: object = ..., axis: object = ..., zero_phase: object = ... +) -> object: ... +@deprecated("will be removed in SciPy v1.15.0") +def cmplx_sort(p: object) -> object: ... diff --git a/scipy-stubs/signal/spectral.pyi b/scipy-stubs/signal/spectral.pyi index 0392762a..c333e7cb 100644 --- a/scipy-stubs/signal/spectral.pyi +++ b/scipy-stubs/signal/spectral.pyi @@ -1,7 +1,5 @@ # 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 ._spectral_py import * +from typing_extensions import deprecated __all__ = [ "check_COLA", @@ -16,3 +14,109 @@ __all__ = [ "stft", "welch", ] + +@deprecated("will be removed in SciPy v2.0.0") +def check_COLA(window: object, nperseg: object, noverlap: object, tol: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def check_NOLA(window: object, nperseg: object, noverlap: object, tol: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def coherence( + x: object, + y: object, + fs: object = ..., + window: object = ..., + nperseg: object = ..., + noverlap: object = ..., + nfft: object = ..., + detrend: object = ..., + axis: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def csd( + x: object, + y: object, + fs: object = ..., + window: object = ..., + nperseg: object = ..., + noverlap: object = ..., + nfft: object = ..., + detrend: object = ..., + return_onesided: object = ..., + scaling: object = ..., + axis: object = ..., + average: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def istft( + Zxx: object, + fs: object = ..., + window: object = ..., + nperseg: object = ..., + noverlap: object = ..., + nfft: object = ..., + input_onesided: object = ..., + boundary: object = ..., + time_axis: object = ..., + freq_axis: object = ..., + scaling: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def lombscargle(x: object, y: object, freqs: object, precenter: object = ..., normalize: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def periodogram( + x: object, + fs: object = ..., + window: object = ..., + nfft: object = ..., + detrend: object = ..., + return_onesided: object = ..., + scaling: object = ..., + axis: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def welch( + x: object, + fs: object = ..., + window: object = ..., + nperseg: object = ..., + noverlap: object = ..., + nfft: object = ..., + detrend: object = ..., + return_onesided: object = ..., + scaling: object = ..., + axis: object = ..., + average: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def stft( + x: object, + fs: object = ..., + window: object = ..., + nperseg: object = ..., + noverlap: object = ..., + nfft: object = ..., + detrend: object = ..., + return_onesided: object = ..., + boundary: object = ..., + padded: object = ..., + axis: object = ..., + scaling: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def spectrogram( + x: object, + fs: object = ..., + window: object = ..., + nperseg: object = ..., + noverlap: object = ..., + nfft: object = ..., + detrend: object = ..., + return_onesided: object = ..., + scaling: object = ..., + axis: object = ..., + mode: object = ..., +) -> object: ... + +# windows +@deprecated("will be removed in SciPy v2.0.0") +def get_window(window: object, Nx: object, fftbins: object = ...) -> object: ... diff --git a/scipy-stubs/signal/spline.pyi b/scipy-stubs/signal/spline.pyi index a35dce78..9efd1170 100644 --- a/scipy-stubs/signal/spline.pyi +++ b/scipy-stubs/signal/spline.pyi @@ -1,7 +1,18 @@ # 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 ._spline import * -from ._spline_filters import * +from typing_extensions import deprecated __all__ = ["cspline2d", "qspline2d", "sepfir2d", "symiirorder1", "symiirorder2"] + +# _spline_filters +@deprecated("will be removed in SciPy v2.0.0") +def qspline2d(signal: object, lamb: object = ..., precision: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def cspline2d(signal: object, lamb: object = ..., precision: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def symiirorder1(signal: object, c0: object, z1: object, precision: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def symiirorder2(input: object, r: object, omega: object, precision: object = ...) -> object: ... + +# _spline +@deprecated("will be removed in SciPy v2.0.0") +def sepfir2d(input: object, hrow: object, hcol: object) -> object: ... diff --git a/scipy-stubs/signal/waveforms.pyi b/scipy-stubs/signal/waveforms.pyi index 9a56a464..fcd421af 100644 --- a/scipy-stubs/signal/waveforms.pyi +++ b/scipy-stubs/signal/waveforms.pyi @@ -1,6 +1,27 @@ # 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 ._waveforms import * +from typing_extensions import deprecated __all__ = ["chirp", "gausspulse", "sawtooth", "square", "sweep_poly", "unit_impulse"] + +@deprecated("will be removed in SciPy v2.0.0") +def sawtooth(t: object, width: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def square(t: object, duty: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def gausspulse( + t: object, + fc: object = ..., + bw: object = ..., + bwr: object = ..., + tpr: object = ..., + retquad: object = ..., + retenv: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def chirp( + t: object, f0: object, t1: object, f1: object, method: object = ..., phi: object = ..., vertex_zero: object = ... +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def sweep_poly(t: object, poly: object, phi: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def unit_impulse(shape: object, idx: object = ..., dtype: object = ...) -> object: ... diff --git a/scipy-stubs/signal/wavelets.pyi b/scipy-stubs/signal/wavelets.pyi index fc4aeac8..91d1216f 100644 --- a/scipy-stubs/signal/wavelets.pyi +++ b/scipy-stubs/signal/wavelets.pyi @@ -1,6 +1,21 @@ -# 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 ._wavelets import * +# This module is not meant for public use and will be removed in SciPy v1.15.0. +from typing_extensions import deprecated __all__ = ["cascade", "convolve", "cwt", "daub", "morlet", "morlet2", "qmf", "ricker"] + +@deprecated("will be removed in SciPy v1.15.0") +def convolve(in1: object, in2: object, mode: object = ..., method: object = ...) -> object: ... +@deprecated("will be removed in SciPy v1.15.0") +def cwt(data: object, wavelet: object, widths: object, dtype: object = ..., **kwargs: object) -> object: ... +@deprecated("will be removed in SciPy v1.15.0") +def cascade(hk: object, J: object = ...) -> object: ... +@deprecated("will be removed in SciPy v1.15.0") +def morlet(M: object, w: object = ..., s: object = ..., complete: object = ...) -> object: ... +@deprecated("will be removed in SciPy v1.15.0") +def daub(p: object) -> object: ... +@deprecated("will be removed in SciPy v1.15.0") +def morlet2(M: object, s: object, w: object = ...) -> object: ... +@deprecated("will be removed in SciPy v1.15.0") +def qmf(hk: object) -> object: ... +@deprecated("will be removed in SciPy v1.15.0") +def ricker(points: object, a: object) -> object: ... diff --git a/scipy-stubs/signal/windows/windows.pyi b/scipy-stubs/signal/windows/windows.pyi index 0c0cf105..bd48fd98 100644 --- a/scipy-stubs/signal/windows/windows.pyi +++ b/scipy-stubs/signal/windows/windows.pyi @@ -1,7 +1,5 @@ # 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 ._windows import * +from typing_extensions import deprecated __all__ = [ "barthann", @@ -29,3 +27,54 @@ __all__ = [ "triang", "tukey", ] + +@deprecated("will be removed in SciPy v2.0.0") +def general_cosine(M: object, a: object, sym: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def boxcar(M: object, sym: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def triang(M: object, sym: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def parzen(M: object, sym: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def bohman(M: object, sym: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def blackman(M: object, sym: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def nuttall(M: object, sym: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def blackmanharris(M: object, sym: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def flattop(M: object, sym: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def bartlett(M: object, sym: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def hann(M: object, sym: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def tukey(M: object, alpha: object = ..., sym: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def barthann(M: object, sym: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def general_hamming(M: object, alpha: object, sym: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def hamming(M: object, sym: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def kaiser(M: object, beta: object, sym: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def gaussian(M: object, std: object, sym: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def general_gaussian(M: object, p: object, sig: object, sym: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def chebwin(M: object, at: object, sym: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def cosine(M: object, sym: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def exponential(M: object, center: object = ..., tau: object = ..., sym: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def taylor(M: object, nbar: object = ..., sll: object = ..., norm: object = ..., sym: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def dpss( + M: object, NW: object, Kmax: object = ..., sym: object = ..., norm: object = ..., return_ratios: object = ... +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def get_window(window: object, Nx: object, fftbins: object = ...) -> object: ... From 911867e45e9c02384b6fa4b26754331640cdb5c5 Mon Sep 17 00:00:00 2001 From: Pavadol Yamsiri Date: Tue, 8 Oct 2024 00:55:38 +1100 Subject: [PATCH 18/22] `sparse`: Add dummy deprecated functions/classes --- scipy-stubs/sparse/base.pyi | 62 ++++++++++++++---- scipy-stubs/sparse/bsr.pyi | 63 ++++++++++++++++-- scipy-stubs/sparse/compressed.pyi | 60 +++++++++++++++-- scipy-stubs/sparse/construct.pyi | 105 ++++++++++++++++++++++++++---- scipy-stubs/sparse/coo.pyi | 67 +++++++++++++++++-- scipy-stubs/sparse/csc.pyi | 45 +++++++++++-- scipy-stubs/sparse/csr.pyi | 40 ++++++++++-- scipy-stubs/sparse/data.pyi | 15 +++-- scipy-stubs/sparse/dia.pyi | 49 +++++++++++--- scipy-stubs/sparse/dok.pyi | 88 ++++++++++++++++++++++--- scipy-stubs/sparse/extract.pyi | 14 +++- scipy-stubs/sparse/lil.pyi | 23 ++++++- 12 files changed, 558 insertions(+), 73 deletions(-) diff --git a/scipy-stubs/sparse/base.pyi b/scipy-stubs/sparse/base.pyi index 6c137972..51ba7b74 100644 --- a/scipy-stubs/sparse/base.pyi +++ b/scipy-stubs/sparse/base.pyi @@ -1,15 +1,6 @@ # 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 * +from typing import Final +from typing_extensions import deprecated __all__ = [ "MAXPRINT", @@ -27,3 +18,52 @@ __all__ = [ "spmatrix", "validateaxis", ] + +MAXPRINT: Final[int] + +@deprecated("will be removed in SciPy v2.0.0") +class SparseWarning: ... + +@deprecated("will be removed in SciPy v2.0.0") +class SparseFormatWarning: ... + +@deprecated("will be removed in SciPy v2.0.0") +class SparseEfficiencyWarning: ... + +@deprecated("will be removed in SciPy v2.0.0") +class spmatrix: + @property + def shape(self) -> tuple[int, ...]: ... + def __mul__(self, other: object, /) -> object: ... + def __rmul__(self, other: object, /) -> object: ... + def __pow__(self, power: object, /) -> object: ... + def set_shape(self, shape: object) -> None: ... + def get_shape(self) -> tuple[int, ...]: ... + def asfptype(self) -> object: ... + def getmaxprint(self) -> object: ... + def getformat(self) -> object: ... + def getnnz(self, axis: object | None = None) -> object: ... + def getH(self) -> object: ... + def getcol(self, j: int) -> object: ... + def getrow(self, i: int) -> object: ... + +@deprecated("will be removed in SciPy v2.0.0") +def issparse(x: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def isspmatrix(x: object) -> object: ... + +# sputils +@deprecated("will be removed in SciPy v2.0.0") +def check_shape(args: object, current_shape: object = ..., *, allow_1d: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def check_reshape_kwargs(kwargs: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def validateaxis(axis: object) -> None: ... +@deprecated("will be removed in SciPy v2.0.0") +def isdense(x: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def isscalarlike(x: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def get_sum_dtype(dtype: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def asmatrix(data: object, dtype: object = ...) -> object: ... diff --git a/scipy-stubs/sparse/bsr.pyi b/scipy-stubs/sparse/bsr.pyi index eec888d2..8c485542 100644 --- a/scipy-stubs/sparse/bsr.pyi +++ b/scipy-stubs/sparse/bsr.pyi @@ -1,8 +1,5 @@ # 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 * +from typing_extensions import deprecated __all__ = [ "bsr_matmat", @@ -23,3 +20,61 @@ __all__ = [ "upcast", "warn", ] + +@deprecated("will be removed in SciPy v2.0.0") +class spmatrix: + @property + def shape(self) -> tuple[int, ...]: ... + def __mul__(self, other: object, /) -> object: ... + def __rmul__(self, other: object, /) -> object: ... + def __pow__(self, power: object, /) -> object: ... + def set_shape(self, shape: object) -> None: ... + def get_shape(self) -> tuple[int, ...]: ... + def asfptype(self) -> object: ... + def getmaxprint(self) -> object: ... + def getformat(self) -> object: ... + def getnnz(self, axis: object | None = None) -> object: ... + def getH(self) -> object: ... + def getcol(self, j: int) -> object: ... + def getrow(self, i: int) -> object: ... + +@deprecated("will be removed in SciPy v2.0.0") +class bsr_matrix: ... + +@deprecated("will be removed in SciPy v2.0.0") +def bsr_matmat(*args: object, **kwargs: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def bsr_matvec(*args: object, **kwargs: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def bsr_matvecs(*args: object, **kwargs: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def bsr_sort_indices(*args: object, **kwargs: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def bsr_tocsr(*args: object, **kwargs: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def bsr_transpose(*args: object, **kwargs: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def csr_matmat_maxnnz(*args: object, **kwargs: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def isspmatrix_bsr(x: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def warn( + message: object, + category: object = ..., + stacklevel: object = ..., + source: object = ..., +) -> None: ... + +# sputils +@deprecated("will be removed in SciPy v2.0.0") +def upcast(*args: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def to_native(A: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def getdtype(dtype: object, a: object = ..., default: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def getdata(obj: object, dtype: object = ..., copy: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def isshape(x: object, nonneg: object = ..., *, allow_1d: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def check_shape(args: object, current_shape: object = ..., *, allow_1d: object = ...) -> object: ... diff --git a/scipy-stubs/sparse/compressed.pyi b/scipy-stubs/sparse/compressed.pyi index d8528b07..accd3e86 100644 --- a/scipy-stubs/sparse/compressed.pyi +++ b/scipy-stubs/sparse/compressed.pyi @@ -1,10 +1,7 @@ # 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 * +import operator +from warnings import warn +from typing_extensions import deprecated __all__ = [ "IndexMixin", @@ -32,3 +29,54 @@ __all__ = [ "upcast_char", "warn", ] + +@deprecated("will be removed in SciPy v2.0.0") +class SparseEfficiencyWarning: ... + +@deprecated("will be removed in SciPy v2.0.0") +class IndexMixin: + def __getitem__(self, key: object, /) -> object: ... + def __setitem__(self, key: object, x: object, /) -> None: ... + +@deprecated("will be removed in SciPy v2.0.0") +def csr_column_index1(*args: object, **kwargs: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def csr_column_index2(*args: object, **kwargs: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def csr_row_index(*args: object, **kwargs: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def csr_row_slice(*args: object, **kwargs: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def csr_sample_offsets(*args: object, **kwargs: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def csr_sample_values(*args: object, **kwargs: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def csr_todense(*args: object, **kwargs: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def get_csr_submatrix(*args: object, **kwargs: object) -> object: ... + +# sputils +@deprecated("will be removed in SciPy v2.0.0") +def upcast(*args: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def upcast_char(*args: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def to_native(A: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def getdtype(dtype: object, a: object = ..., default: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def isshape(x: object, nonneg: object = ..., *, allow_1d: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def check_shape(args: object, current_shape: object = ..., *, allow_1d: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def get_sum_dtype(dtype: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def downcast_intp_index(arr: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def isscalarlike(x: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def isintlike(x: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def isdense(x: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def is_pydata_spmatrix(m: object) -> object: ... diff --git a/scipy-stubs/sparse/construct.pyi b/scipy-stubs/sparse/construct.pyi index eb3199e0..568ab767 100644 --- a/scipy-stubs/sparse/construct.pyi +++ b/scipy-stubs/sparse/construct.pyi @@ -1,16 +1,6 @@ # 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 +import numbers +from typing_extensions import deprecated __all__ = [ "block_diag", @@ -31,6 +21,7 @@ __all__ = [ "issparse", "kron", "kronsum", + "numbers", "rand", "random", "rng_integers", @@ -38,3 +29,93 @@ __all__ = [ "upcast", "vstack", ] + +@deprecated("will be removed in SciPy v2.0.0") +class coo_matrix: ... + +@deprecated("will be removed in SciPy v2.0.0") +class csc_matrix: ... + +@deprecated("will be removed in SciPy v2.0.0") +class csr_matrix: ... + +@deprecated("will be removed in SciPy v2.0.0") +class dia_matrix: ... + +@deprecated("will be removed in SciPy v2.0.0") +class bsr_matrix: ... + +@deprecated("will be removed in SciPy v2.0.0") +def csr_hstack(*args: object, **kwargs: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def issparse(x: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def check_random_state(seed: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def rng_integers( + gen: object, + low: object, + high: object = ..., + size: object = ..., + dtype: object = ..., + endpoint: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def vstack(blocks: object, format: object = ..., dtype: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def spdiags( + data: object, + diags: object, + m: object = ..., + n: object = ..., + format: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def random( + m: object, + n: object, + density: object = ..., + format: object = ..., + dtype: object = ..., + random_state: object = ..., + data_rvs: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def rand( + m: object, + n: object, + density: object = ..., + format: object = ..., + dtype: object = ..., + random_state: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def kron(A: object, B: object, format: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def kronsum(A: object, B: object, format: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def identity(n: object, dtype: object = ..., format: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def block_diag(mats: object, format: object = ..., dtype: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def hstack(blocks: object, format: object = ..., dtype: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def eye(m: object, n: object = ..., k: object = ..., dtype: object = ..., format: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def diags( + diagonals: object, + offsets: object = ..., + shape: object = ..., + format: object = ..., + dtype: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def bmat(blocks: object, format: object = ..., dtype: object = ...) -> object: ... + +# sputils +@deprecated("will be removed in SciPy v2.0.0") +def get_index_dtype(arrays: object = ..., maxval: object = ..., check_contents: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def isscalarlike(x: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def upcast(*args: object) -> object: ... diff --git a/scipy-stubs/sparse/coo.pyi b/scipy-stubs/sparse/coo.pyi index 93fd8ff8..265a16e1 100644 --- a/scipy-stubs/sparse/coo.pyi +++ b/scipy-stubs/sparse/coo.pyi @@ -1,8 +1,7 @@ # 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 * +import operator +from typing import type_check_only +from typing_extensions import deprecated __all__ = [ "SparseEfficiencyWarning", @@ -24,3 +23,63 @@ __all__ = [ "upcast_char", "warn", ] + +@deprecated("will be removed in SciPy v2.0.0") +class SparseEfficiencyWarning: ... + +@deprecated("will be removed in SciPy v2.0.0") +class spmatrix: + @property + def shape(self) -> tuple[int, ...]: ... + def __mul__(self, other: object, /) -> object: ... + def __rmul__(self, other: object, /) -> object: ... + def __pow__(self, power: object, /) -> object: ... + def set_shape(self, shape: object) -> None: ... + def get_shape(self) -> tuple[int, ...]: ... + def asfptype(self) -> object: ... + def getmaxprint(self) -> object: ... + def getformat(self) -> object: ... + def getnnz(self, axis: object | None = None) -> object: ... + def getH(self) -> object: ... + def getcol(self, j: int) -> object: ... + def getrow(self, i: int) -> object: ... + +@deprecated("will be removed in SciPy v2.0.0") +class coo_matrix: ... + +@deprecated("will be removed in SciPy v2.0.0") +def isspmatrix_coo(x: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def coo_matvec(*args: object, **kwargs: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def coo_tocsr(*args: object, **kwargs: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def coo_todense(*args: object, **kwargs: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def warn( + message: object, + category: object = ..., + stacklevel: object = ..., + source: object = ..., +) -> None: ... + +# sputils +@type_check_only +@deprecated("will be removed in SciPy v2.0.0") +def upcast(*args: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def upcast_char(*args: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def to_native(A: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def getdtype(dtype: object, a: object = ..., default: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def getdata(obj: object, dtype: object = ..., copy: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def isshape(x: object, nonneg: object = ..., *, allow_1d: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def check_shape(args: object, current_shape: object = ..., *, allow_1d: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def check_reshape_kwargs(kwargs: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def downcast_intp_index(arr: object) -> object: ... diff --git a/scipy-stubs/sparse/csc.pyi b/scipy-stubs/sparse/csc.pyi index c2d983c6..837126e7 100644 --- a/scipy-stubs/sparse/csc.pyi +++ b/scipy-stubs/sparse/csc.pyi @@ -1,7 +1,42 @@ # 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 * +from typing_extensions import deprecated -__all__ = ["csc_matrix", "csc_tocsr", "expandptr", "isspmatrix_csc", "spmatrix", "upcast"] +__all__ = [ + "csc_matrix", + "csc_tocsr", + "expandptr", + "isspmatrix_csc", + "spmatrix", + "upcast", +] + +@deprecated("will be removed in SciPy v2.0.0") +class spmatrix: + @property + def shape(self) -> tuple[int, ...]: ... + def __mul__(self, other: object, /) -> object: ... + def __rmul__(self, other: object, /) -> object: ... + def __pow__(self, power: object, /) -> object: ... + def set_shape(self, shape: object) -> None: ... + def get_shape(self) -> tuple[int, ...]: ... + def asfptype(self) -> object: ... + def getmaxprint(self) -> object: ... + def getformat(self) -> object: ... + def getnnz(self, axis: object | None = None) -> object: ... + def getH(self) -> object: ... + def getcol(self, j: int) -> object: ... + def getrow(self, i: int) -> object: ... + +@deprecated("will be removed in SciPy v2.0.0") +class csc_matrix: ... + +@deprecated("will be removed in SciPy v2.0.0") +def isspmatrix_csc(x: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def csc_tocsr(*args: object, **kwargs: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def expandptr(*args: object, **kwargs: object) -> object: ... + +# sputils +@deprecated("will be removed in SciPy v2.0.0") +def upcast(*args: object) -> object: ... diff --git a/scipy-stubs/sparse/csr.pyi b/scipy-stubs/sparse/csr.pyi index e67beb46..0a6322a8 100644 --- a/scipy-stubs/sparse/csr.pyi +++ b/scipy-stubs/sparse/csr.pyi @@ -1,8 +1,5 @@ # 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 * +from typing_extensions import deprecated __all__ = [ "csr_count_blocks", @@ -14,3 +11,38 @@ __all__ = [ "spmatrix", "upcast", ] + +@deprecated("will be removed in SciPy v2.0.0") +class spmatrix: + @property + def shape(self) -> tuple[int, ...]: ... + def __mul__(self, other: object, /) -> object: ... + def __rmul__(self, other: object, /) -> object: ... + def __pow__(self, power: object, /) -> object: ... + def set_shape(self, shape: object) -> None: ... + def get_shape(self) -> tuple[int, ...]: ... + def asfptype(self) -> object: ... + def getmaxprint(self) -> object: ... + def getformat(self) -> object: ... + def getnnz(self, axis: object | None = None) -> object: ... + def getH(self) -> object: ... + def getcol(self, j: int) -> object: ... + def getrow(self, i: int) -> object: ... + +@deprecated("will be removed in SciPy v2.0.0") +class csr_matrix: ... + +@deprecated("will be removed in SciPy v2.0.0") +def isspmatrix_csr(x: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def csr_count_blocks(*args: object, **kwargs: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def csr_tobsr(*args: object, **kwargs: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def csr_tocsc(*args: object, **kwargs: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def get_csr_submatrix(*args: object, **kwargs: object) -> object: ... + +# sputils +@deprecated("will be removed in SciPy v2.0.0") +def upcast(*args: object) -> object: ... diff --git a/scipy-stubs/sparse/data.pyi b/scipy-stubs/sparse/data.pyi index a9dd621e..977e1a60 100644 --- a/scipy-stubs/sparse/data.pyi +++ b/scipy-stubs/sparse/data.pyi @@ -1,7 +1,14 @@ # 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 * +from typing import Final +from typing_extensions import deprecated __all__ = ["isscalarlike", "name", "npfunc", "validateaxis"] + +name: Final[str] +npfunc: object + +# sputils +@deprecated("will be removed in SciPy v2.0.0") +def validateaxis(axis: object) -> None: ... +@deprecated("will be removed in SciPy v2.0.0") +def isscalarlike(x: object) -> object: ... diff --git a/scipy-stubs/sparse/dia.pyi b/scipy-stubs/sparse/dia.pyi index a429fe44..7d74fea9 100644 --- a/scipy-stubs/sparse/dia.pyi +++ b/scipy-stubs/sparse/dia.pyi @@ -1,13 +1,5 @@ # 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 * +from typing_extensions import deprecated __all__ = [ "check_shape", @@ -21,3 +13,42 @@ __all__ = [ "upcast_char", "validateaxis", ] + +@deprecated("will be removed in SciPy v2.0.0") +class spmatrix: + @property + def shape(self) -> tuple[int, ...]: ... + def __mul__(self, other: object, /) -> object: ... + def __rmul__(self, other: object, /) -> object: ... + def __pow__(self, power: object, /) -> object: ... + def set_shape(self, shape: object) -> None: ... + def get_shape(self) -> tuple[int, ...]: ... + def asfptype(self) -> object: ... + def getmaxprint(self) -> object: ... + def getformat(self) -> object: ... + def getnnz(self, axis: object | None = None) -> object: ... + def getH(self) -> object: ... + def getcol(self, j: int) -> object: ... + def getrow(self, i: int) -> object: ... + +@deprecated("will be removed in SciPy v2.0.0") +class dia_matrix: ... + +@deprecated("will be removed in SciPy v2.0.0") +def dia_matvec(*args: object, **kwargs: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def isspmatrix_dia(x: object) -> object: ... + +# sputils +@deprecated("will be removed in SciPy v2.0.0") +def upcast_char(*args: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def getdtype(dtype: object, a: object = ..., default: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def isshape(x: object, nonneg: object = ..., *, allow_1d: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def check_shape(args: object, current_shape: object = ..., *, allow_1d: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def get_sum_dtype(dtype: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def validateaxis(axis: object) -> None: ... diff --git a/scipy-stubs/sparse/dok.pyi b/scipy-stubs/sparse/dok.pyi index 318de431..b75ee70d 100644 --- a/scipy-stubs/sparse/dok.pyi +++ b/scipy-stubs/sparse/dok.pyi @@ -1,24 +1,96 @@ # 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 ._dok import * -from ._index import IndexMixin -from ._matrix import spmatrix -from ._sputils import check_shape, getdtype, isdense, isintlike, isscalarlike, isshape, upcast, upcast_scalar +import itertools +from typing import type_check_only +from typing_extensions import Self, deprecated __all__ = [ "IndexMixin", "check_shape", "dok_matrix", + "getdata", "getdtype", "isdense", "isintlike", "isscalarlike", "isshape", "isspmatrix_dok", + "itertools", "spmatrix", + "to_native", "upcast", "upcast_scalar", ] + +@deprecated("will be removed in SciPy v2.0.0") +class spmatrix: + @property + def shape(self) -> tuple[int, ...]: ... + def __mul__(self, other: object, /) -> object: ... + def __rmul__(self, other: object, /) -> object: ... + def __pow__(self, power: object, /) -> object: ... + def set_shape(self, shape: object) -> None: ... + def get_shape(self) -> tuple[int, ...]: ... + def asfptype(self) -> object: ... + def getmaxprint(self) -> object: ... + def getformat(self) -> object: ... + def getnnz(self, axis: object = ...) -> object: ... + def getH(self) -> object: ... + def getcol(self, j: int) -> object: ... + def getrow(self, i: int) -> object: ... + +@deprecated("will be removed in SciPy v2.0.0") +class dok_matrix: + def __init__( + self, + arg1: object, + shape: object = ..., + dtype: object = ..., + copy: object = ..., + ) -> None: ... + def update(self, val: object) -> None: ... + def setdefault(self, key: object, default: object = ..., /) -> object: ... + def __delitem__(self, key: object, /) -> None: ... + def __or__(self, other: object, /) -> object: ... + def __ror__(self, other: object, /) -> object: ... + def __ior__(self, other: object, /) -> Self: ... + def __iter__(self) -> object: ... + def __reversed__(self) -> object: ... + def get(self, key: object, default: object = ...) -> object: ... + def conjtransp(self) -> object: ... + @classmethod + def fromkeys(cls, iterable: object, value: object = ..., /) -> Self: ... + @property + def shape(self) -> object: ... + def get_shape(self) -> object: ... + def set_shape(self, shape: object) -> None: ... + +@deprecated("will be removed in SciPy v2.0.0") +class IndexMixin: + def __getitem__(self, key: object, /) -> object: ... + def __setitem__(self, key: object, x: object, /) -> None: ... + +# sputils +@deprecated("will be removed in SciPy v2.0.0") +def upcast(*args: object) -> object: ... +@type_check_only +@deprecated("will be removed in SciPy v2.0.0") +def to_native(A: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def getdtype(dtype: object, a: object = ..., default: object = ...) -> object: ... +@type_check_only +@deprecated("will be removed in SciPy v2.0.0") +def getdata(obj: object, dtype: object = ..., copy: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def isshape(x: object, nonneg: object = ..., *, allow_1d: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def check_shape(args: object, current_shape: object = ..., *, allow_1d: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def isdense(x: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def isintlike(x: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def isscalarlike(x: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def upcast_scalar(dtype: object, scalar: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def isspmatrix_dok(x: object) -> object: ... diff --git a/scipy-stubs/sparse/extract.pyi b/scipy-stubs/sparse/extract.pyi index b47790a9..011f194c 100644 --- a/scipy-stubs/sparse/extract.pyi +++ b/scipy-stubs/sparse/extract.pyi @@ -1,6 +1,14 @@ # 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 * +from typing_extensions import deprecated __all__ = ["coo_matrix", "find", "tril", "triu"] + +@deprecated("will be removed in SciPy v2.0.0") +class coo_matrix: ... + +@deprecated("will be removed in SciPy v2.0.0") +def find(A: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def tril(A: object, k: object = ..., format: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def triu(A: object, k: object = ..., format: object = ...) -> object: ... diff --git a/scipy-stubs/sparse/lil.pyi b/scipy-stubs/sparse/lil.pyi index 03322321..c6453d67 100644 --- a/scipy-stubs/sparse/lil.pyi +++ b/scipy-stubs/sparse/lil.pyi @@ -1,6 +1,23 @@ # 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 * +from typing_extensions import deprecated __all__ = ["isspmatrix_lil", "lil_array", "lil_matrix"] + +@deprecated("will be removed in SciPy v2.0.0") +class lil_array: + def __init__( + self, + arg1: object, + shape: object = ..., + dtype: object = ..., + copy: object = ..., + ) -> None: ... + def getrowview(self, i: object) -> object: ... + def getrow(self, i: object) -> object: ... + def resize(self, *shape: int) -> None: ... + +@deprecated("will be removed in SciPy v2.0.0") +class lil_matrix: ... + +@deprecated("will be removed in SciPy v2.0.0") +def isspmatrix_lil(x: object) -> object: ... From 6eb2c41f3aebfceb20f997753bae048c2d232ec0 Mon Sep 17 00:00:00 2001 From: Pavadol Yamsiri Date: Tue, 8 Oct 2024 01:20:10 +1100 Subject: [PATCH 19/22] `sparse.linalg`: Add dummy deprecated functions/classes --- scipy-stubs/sparse/linalg/dsolve.pyi | 72 +++++++++- scipy-stubs/sparse/linalg/eigen.pyi | 79 +++++++++- scipy-stubs/sparse/linalg/interface.pyi | 44 +++++- scipy-stubs/sparse/linalg/isolve.pyi | 184 +++++++++++++++++++++++- scipy-stubs/sparse/linalg/matfuncs.pyi | 50 ++++++- 5 files changed, 409 insertions(+), 20 deletions(-) diff --git a/scipy-stubs/sparse/linalg/dsolve.pyi b/scipy-stubs/sparse/linalg/dsolve.pyi index b9266e0d..fac8c561 100644 --- a/scipy-stubs/sparse/linalg/dsolve.pyi +++ b/scipy-stubs/sparse/linalg/dsolve.pyi @@ -1,6 +1,70 @@ # 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 * +from types import ModuleType +from typing import final +from typing_extensions import deprecated -__all__ = ["MatrixRankWarning", "SuperLU", "factorized", "spilu", "splu", "spsolve", "spsolve_triangular", "use_solver"] +__all__ = [ + "MatrixRankWarning", + "SuperLU", + "factorized", + "spilu", + "splu", + "spsolve", + "spsolve_triangular", + "test", + "use_solver", +] + +test: ModuleType + +@deprecated("will be removed in SciPy v2.0.0") +class MatrixRankWarning: ... + +@final +@deprecated("will be removed in SciPy v2.0.0") +class SuperLU: + L: object + U: object + nnz: object + perm_r: object + perm_c: object + shape: object + + def solve(self, /, rhs: object) -> None: ... + +@deprecated("will be removed in SciPy v2.0.0") +def use_solver(**kwargs: object) -> None: ... +@deprecated("will be removed in SciPy v2.0.0") +def spsolve(A: object, b: object, permc_spec: object = ..., use_umfpack: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def splu( + A: object, + permc_spec: object = ..., + diag_pivot_thresh: object = ..., + relax: object = ..., + panel_size: object = ..., + options: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def spilu( + A: object, + drop_tol: object = ..., + fill_factor: object = ..., + drop_rule: object = ..., + permc_spec: object = ..., + diag_pivot_thresh: object = ..., + relax: object = ..., + panel_size: object = ..., + options: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def factorized(A: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def spsolve_triangular( + A: object, + b: object, + lower: object = ..., + overwrite_A: object = ..., + overwrite_b: object = ..., + unit_diagonal: object = ..., +) -> object: ... diff --git a/scipy-stubs/sparse/linalg/eigen.pyi b/scipy-stubs/sparse/linalg/eigen.pyi index 01aea71f..3b00b5b8 100644 --- a/scipy-stubs/sparse/linalg/eigen.pyi +++ b/scipy-stubs/sparse/linalg/eigen.pyi @@ -1,6 +1,77 @@ # 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 * +from types import ModuleType +from typing_extensions import deprecated -__all__ = ["ArpackError", "ArpackError", "ArpackNoConvergence", "eigs", "eigsh", "lobpcg", "svds"] +__all__ = ["ArpackError", "ArpackNoConvergence", "eigs", "eigsh", "lobpcg", "svds", "test"] + +test: ModuleType + +@deprecated("will be removed in SciPy v2.0.0") +class ArpackError: + def __init__(self, info: object, infodict: object = ...) -> None: ... + +@deprecated("will be removed in SciPy v2.0.0") +class ArpackNoConvergence: + def __init__(self, msg: object, eigenvalues: object, eigenvectors: object) -> None: ... + +@deprecated("will be removed in SciPy v2.0.0") +def eigs( + A: object, + k: object = ..., + M: object = ..., + sigma: object = ..., + which: object = ..., + v0: object = ..., + ncv: object = ..., + maxiter: object = ..., + tol: object = ..., + return_eigenvectors: object = ..., + Minv: object = ..., + OPinv: object = ..., + OPpart: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def eigsh( + A: object, + k: object = ..., + M: object = ..., + sigma: object = ..., + which: object = ..., + v0: object = ..., + ncv: object = ..., + maxiter: object = ..., + tol: object = ..., + return_eigenvectors: object = ..., + Minv: object = ..., + OPinv: object = ..., + mode: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def lobpcg( + A: object, + X: object, + B: object = ..., + M: object = ..., + Y: object = ..., + tol: object = ..., + maxiter: object = ..., + largest: object = ..., + verbosityLevel: object = ..., + retLambdaHistory: object = ..., + retResidualNormsHistory: object = ..., + restartControl: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def svds( + A: object, + k: object = ..., + ncv: object = ..., + tol: object = ..., + which: object = ..., + v0: object = ..., + maxiter: object = ..., + return_singular_vectors: object = ..., + solver: object = ..., + random_state: object = ..., + options: object = ..., +) -> object: ... diff --git a/scipy-stubs/sparse/linalg/interface.pyi b/scipy-stubs/sparse/linalg/interface.pyi index 8bde4336..1d46aec6 100644 --- a/scipy-stubs/sparse/linalg/interface.pyi +++ b/scipy-stubs/sparse/linalg/interface.pyi @@ -1,6 +1,44 @@ # 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 * +from typing_extensions import Self, deprecated __all__ = ["LinearOperator", "aslinearoperator"] + +@deprecated("will be removed in SciPy v2.0.0") +class LinearOperator: + __array_ufunc__: object + ndim: object + + def __new__(cls, dtype: object, shape: object) -> Self: ... + def __init__(self, /, dtype: object, shape: object) -> None: ... + def matvec(self, /, x: object) -> object: ... + def rmatvec(self, /, x: object) -> object: ... + def matmat(self, /, X: object) -> object: ... + def rmatmat(self, /, X: object) -> object: ... + def __call__(self, /, x: object) -> object: ... + def __mul__(self, x: object, /) -> object: ... + def __truediv__(self, other: object, /) -> object: ... + def dot(self, /, x: object) -> object: ... + def __matmul__( + self, + other: object, + /, + ) -> object: ... + def __rmatmul__( + self, + other: object, + /, + ) -> object: ... + def __rmul__(self, x: object) -> object: ... + def __pow__(self, p: object) -> object: ... + def __add__(self, x: object, /) -> object: ... + def __neg__(self, /) -> object: ... + def __sub__(self, x: object, /) -> object: ... + def adjoint(self, /) -> object: ... + @property + def H(self, /) -> object: ... + def transpose(self, /) -> object: ... + @property + def T(self) -> object: ... + +@deprecated("will be removed in SciPy v2.0.0") +def aslinearoperator(A: object) -> object: ... diff --git a/scipy-stubs/sparse/linalg/isolve.pyi b/scipy-stubs/sparse/linalg/isolve.pyi index 124ce0e1..073341e9 100644 --- a/scipy-stubs/sparse/linalg/isolve.pyi +++ b/scipy-stubs/sparse/linalg/isolve.pyi @@ -1,6 +1,182 @@ # 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 * +from types import ModuleType +from typing_extensions import deprecated -__all__ = ["bicg", "bicgstab", "cg", "cgs", "gcrotmk", "gmres", "lgmres", "lsmr", "lsqr", "minres", "qmr", "tfqmr"] +__all__ = [ + "bicg", + "bicgstab", + "cg", + "cgs", + "gcrotmk", + "gmres", + "lgmres", + "lsmr", + "lsqr", + "minres", + "qmr", + "test", + "tfqmr", +] + +test: ModuleType + +@deprecated("will be removed in SciPy v2.0.0") +def cgs( + A: object, + b: object, + x0: object = ..., + *, + rtol: object = ..., + atol: object = ..., + maxiter: object = ..., + M: object = ..., + callback: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def gmres( + A: object, + b: object, + x0: object = ..., + *, + rtol: object = ..., + atol: object = ..., + restart: object = ..., + maxiter: object = ..., + M: object = ..., + callback: object = ..., + callback_type: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def qmr( + A: object, + b: object, + x0: object = ..., + *, + rtol: object = ..., + atol: object = ..., + maxiter: object = ..., + M1: object = ..., + M2: object = ..., + callback: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def bicg( + A: object, + b: object, + x0: object = ..., + *, + rtol: object = ..., + atol: object = ..., + maxiter: object = ..., + M: object = ..., + callback: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def bicgstab( + A: object, + b: object, + x0: object = ..., + *, + rtol: object = ..., + atol: object = ..., + maxiter: object = ..., + M: object = ..., + callback: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def cg( + A: object, + b: object, + x0: object = ..., + *, + rtol: object = ..., + atol: object = ..., + maxiter: object = ..., + M: object = ..., + callback: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def tfqmr( + A: object, + b: object, + x0: object = ..., + *, + rtol: object = ..., + atol: object = ..., + maxiter: object = ..., + M: object = ..., + callback: object = ..., + show: object = ..., +) -> object: ... +def minres( + A: object, + b: object, + x0: object = ..., + *, + rtol: object = ..., + shift: object = ..., + maxiter: object = ..., + M: object = ..., + callback: object = ..., + show: object = ..., + check: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def lsqr( + A: object, + b: object, + damp: object = ..., + atol: object = ..., + btol: object = ..., + conlim: object = ..., + iter_lim: object = ..., + show: object = ..., + calc_var: object = ..., + x0: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def gcrotmk( + A: object, + b: object, + x0: object = ..., + *, + rtol: object = ..., + atol: object = ..., + maxiter: object = ..., + M: object = ..., + callback: object = ..., + m: object = ..., + k: object = ..., + CU: object = ..., + discard_C: object = ..., + truncate: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def lgmres( + A: object, + b: object, + x0: object = ..., + *, + rtol: object = ..., + atol: object = ..., + maxiter: object = ..., + M: object = ..., + callback: object = ..., + inner_m: object = ..., + outer_k: object = ..., + outer_v: object = ..., + store_outer_Av: object = ..., + prepend_outer_v: object = ..., +) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def lsmr( + A: object, + b: object, + damp: object = ..., + atol: object = ..., + btol: object = ..., + conlim: object = ..., + maxiter: object = ..., + show: object = ..., + x0: object = ..., +) -> object: ... diff --git a/scipy-stubs/sparse/linalg/matfuncs.pyi b/scipy-stubs/sparse/linalg/matfuncs.pyi index 33ee122d..ca42447e 100644 --- a/scipy-stubs/sparse/linalg/matfuncs.pyi +++ b/scipy-stubs/sparse/linalg/matfuncs.pyi @@ -1,8 +1,48 @@ # 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 * +from typing_extensions import Self, deprecated __all__ = ["LinearOperator", "expm", "inv", "spsolve"] + +@deprecated("will be removed in SciPy v2.0.0") +class LinearOperator: + __array_ufunc__: object + ndim: object + + def __new__(cls, dtype: object, shape: object) -> Self: ... + def __init__(self, /, dtype: object, shape: object) -> None: ... + def matvec(self, /, x: object) -> object: ... + def rmatvec(self, /, x: object) -> object: ... + def matmat(self, /, X: object) -> object: ... + def rmatmat(self, /, X: object) -> object: ... + def __call__(self, /, x: object) -> object: ... + def __mul__(self, x: object, /) -> object: ... + def __truediv__(self, other: object, /) -> object: ... + def dot(self, /, x: object) -> object: ... + def __matmul__( + self, + other: object, + /, + ) -> object: ... + def __rmatmul__( + self, + other: object, + /, + ) -> object: ... + def __rmul__(self, x: object) -> object: ... + def __pow__(self, p: object) -> object: ... + def __add__(self, x: object, /) -> object: ... + def __neg__(self, /) -> object: ... + def __sub__(self, x: object, /) -> object: ... + def adjoint(self, /) -> object: ... + @property + def H(self, /) -> object: ... + def transpose(self, /) -> object: ... + @property + def T(self) -> object: ... + +@deprecated("will be removed in SciPy v2.0.0") +def spsolve(A: object, b: object, permc_spec: object = ..., use_umfpack: object = ...) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def expm(A: object) -> object: ... +@deprecated("will be removed in SciPy v2.0.0") +def inv(A: object) -> object: ... From 55e9f3bb196cfd745c8ae98f808c6c3b200a96d3 Mon Sep 17 00:00:00 2001 From: Pavadol Yamsiri Date: Tue, 8 Oct 2024 01:21:06 +1100 Subject: [PATCH 20/22] MAINT: Use `poe format` to format text --- scipy-stubs/integrate/_quad_vec.pyi | 1 + scipy-stubs/integrate/_quadrature.pyi | 1 - .../_trustregion_constr/minimize_trustregion_constr.pyi | 1 - scipy-stubs/optimize/_trustregion_constr/qp_subproblem.pyi | 1 - scipy-stubs/stats/_discrete_distns.pyi | 3 +++ 5 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scipy-stubs/integrate/_quad_vec.pyi b/scipy-stubs/integrate/_quad_vec.pyi index e0ab45b4..c7148c3a 100644 --- a/scipy-stubs/integrate/_quad_vec.pyi +++ b/scipy-stubs/integrate/_quad_vec.pyi @@ -109,6 +109,7 @@ def quad_vec( *, args: tuple[Unpack[_Ts]], ) -> tuple[_NDT_f, float]: ... + # false positive (basedmypy==1.6.0 / mypy==1.11.1) @overload def quad_vec( # type: ignore[overload-overlap] diff --git a/scipy-stubs/integrate/_quadrature.pyi b/scipy-stubs/integrate/_quadrature.pyi index b69905b2..fff7ba2e 100644 --- a/scipy-stubs/integrate/_quadrature.pyi +++ b/scipy-stubs/integrate/_quadrature.pyi @@ -143,7 +143,6 @@ def fixed_quad( args: tuple[()] = (), n: op.CanIndex = 5, ) -> _NDT_f: ... - def qmc_quad( func: Callable[[onpt.Array[tuple[int, int], np.float64]], npt.NDArray[np.floating[Any]]], a: Sequence[spt.AnyReal] | onpt.AnyFloatingArray, diff --git a/scipy-stubs/optimize/_trustregion_constr/minimize_trustregion_constr.pyi b/scipy-stubs/optimize/_trustregion_constr/minimize_trustregion_constr.pyi index d09dc4c9..f01bddc5 100644 --- a/scipy-stubs/optimize/_trustregion_constr/minimize_trustregion_constr.pyi +++ b/scipy-stubs/optimize/_trustregion_constr/minimize_trustregion_constr.pyi @@ -40,7 +40,6 @@ def update_state_ip( barrier_parameter: Untyped, barrier_tolerance: Untyped, ) -> Untyped: ... - def _minimize_trustregion_constr( fun: UntypedCallable, x0: Untyped, diff --git a/scipy-stubs/optimize/_trustregion_constr/qp_subproblem.pyi b/scipy-stubs/optimize/_trustregion_constr/qp_subproblem.pyi index b3675113..31367c80 100644 --- a/scipy-stubs/optimize/_trustregion_constr/qp_subproblem.pyi +++ b/scipy-stubs/optimize/_trustregion_constr/qp_subproblem.pyi @@ -94,7 +94,6 @@ def box_sphere_intersections( *, extra_info: Literal[True, 1], ) -> tuple[_ScalarF8, _ScalarF8, _ScalarB1, _SphereInfoDict, _SphereInfoDict]: ... - def inside_box_boundaries( x: onpt.Array[_ShapeT, _ScalarFloat_co], lb: onpt.Array[_ShapeT, _ScalarFloat_co], diff --git a/scipy-stubs/stats/_discrete_distns.pyi b/scipy-stubs/stats/_discrete_distns.pyi index 20faa8cd..91b6f9f5 100644 --- a/scipy-stubs/stats/_discrete_distns.pyi +++ b/scipy-stubs/stats/_discrete_distns.pyi @@ -43,12 +43,15 @@ class zipfian_gen(rv_discrete): ... class dlaplace_gen(rv_discrete): ... class skellam_gen(rv_discrete): ... class yulesimon_gen(rv_discrete): ... + class _nchypergeom_gen(rv_discrete): rvs_name: ClassVar = None dist: ClassVar = None + class nchypergeom_fisher_gen(_nchypergeom_gen): rvs_name: ClassVar = "rvs_fisher" dist: ClassVar[type] = ... # scipy.stats._biasedurn._PyFishersNCHypergeometric + class nchypergeom_wallenius_gen(_nchypergeom_gen): rvs_name: ClassVar = "rvs_wallenius" dist: ClassVar[type] = ... # scipy.stats._biasedurn._PyWalleniusNCHypergeometric From cdb7dd89262241db7f186698ecb528075ebf246d Mon Sep 17 00:00:00 2001 From: Pavadol Yamsiri Date: Tue, 8 Oct 2024 01:29:33 +1100 Subject: [PATCH 21/22] `io.netcdf`: Use explicit `@override` --- scipy-stubs/io/netcdf.pyi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scipy-stubs/io/netcdf.pyi b/scipy-stubs/io/netcdf.pyi index 6fb0def5..9459a2ac 100644 --- a/scipy-stubs/io/netcdf.pyi +++ b/scipy-stubs/io/netcdf.pyi @@ -1,5 +1,5 @@ # This module is not meant for public use and will be removed in SciPy v2.0.0. -from typing_extensions import deprecated +from typing_extensions import deprecated, override __all__ = ["netcdf_file", "netcdf_variable"] @@ -16,6 +16,7 @@ class netcdf_file: def __del__(self) -> None: ... def __enter__(self) -> object: ... def __exit__(self, type: object, value: object, traceback: object) -> None: ... + @override def __setattr__(self, attr: object, value: object) -> None: ... @deprecated("will be removed in SciPy v2.0.0") @@ -39,5 +40,6 @@ class netcdf_variable: def itemsize(self) -> object: ... def typecode(self) -> object: ... def __getitem__(self, index: object) -> object: ... + @override def __setattr__(self, attr: object, value: object) -> None: ... def __setitem__(self, index: object, data: object) -> None: ... From 1757d1971d54b34a034396ddfb7c5e20f1b83457 Mon Sep 17 00:00:00 2001 From: Pavadol Yamsiri Date: Tue, 8 Oct 2024 01:31:22 +1100 Subject: [PATCH 22/22] `io.matlab`: Remove redundant `cls` type annotation --- scipy-stubs/io/matlab/mio5.pyi | 4 ++-- scipy-stubs/io/matlab/mio5_params.pyi | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scipy-stubs/io/matlab/mio5.pyi b/scipy-stubs/io/matlab/mio5.pyi index e8328bde..4059dc02 100644 --- a/scipy-stubs/io/matlab/mio5.pyi +++ b/scipy-stubs/io/matlab/mio5.pyi @@ -14,11 +14,11 @@ class MatReadWarning: ... @deprecated("will be removed in SciPy v2.0.0") class MatlabFunction: - def __new__(cls: type[Self], input_array: object) -> Self: ... + def __new__(cls, input_array: object) -> Self: ... @deprecated("will be removed in SciPy v2.0.0") class MatlabObject: - def __new__(cls: type[Self], input_array: object, classname: object = ...) -> Self: ... + def __new__(cls, input_array: object, classname: object = ...) -> Self: ... def __array_finalize__(self, obj: Self) -> None: ... @deprecated("will be removed in SciPy v2.0.0") diff --git a/scipy-stubs/io/matlab/mio5_params.pyi b/scipy-stubs/io/matlab/mio5_params.pyi index 34d5e7f2..e4321204 100644 --- a/scipy-stubs/io/matlab/mio5_params.pyi +++ b/scipy-stubs/io/matlab/mio5_params.pyi @@ -5,16 +5,16 @@ __all__ = ["MatlabFunction", "MatlabObject", "MatlabOpaque", "mat_struct"] @deprecated("will be removed in SciPy v2.0.0") class MatlabFunction: - def __new__(cls: type[Self], input_array: object) -> Self: ... + def __new__(cls, input_array: object) -> Self: ... @deprecated("will be removed in SciPy v2.0.0") class MatlabObject: - def __new__(cls: type[Self], input_array: object, classname: object = ...) -> Self: ... + def __new__(cls, input_array: object, classname: object = ...) -> Self: ... def __array_finalize__(self, obj: Self) -> None: ... @deprecated("will be removed in SciPy v2.0.0") class MatlabOpaque: - def __new__(cls: type[Self], input_array: object) -> Self: ... + def __new__(cls, input_array: object) -> Self: ... @deprecated("will be removed in SciPy v2.0.0") class mat_struct: ...