├── .editorconfig ├── .github ├── CODE_OF_CONDUCT.md ├── dependabot.yml ├── release.yml └── workflows │ ├── ci.yml │ └── publish-pypi.yml ├── .gitignore ├── .markdownlint.yaml ├── .mdformat.toml ├── .mypyignore ├── .vscode ├── extensions.json └── settings.json ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── SECURITY.md ├── pyproject.toml ├── scipy-stubs ├── __config__.pyi ├── __init__.pyi ├── _distributor_init.pyi ├── _lib │ ├── __init__.pyi │ ├── _bunch.pyi │ ├── _ccallback.pyi │ ├── _disjoint_set.pyi │ ├── _docscrape.pyi │ ├── _elementwise_iterative_method.pyi │ ├── _gcutils.pyi │ ├── _pep440.pyi │ ├── _sparse.pyi │ ├── _testutils.pyi │ ├── _threadsafety.pyi │ ├── _tmpdirs.pyi │ ├── _uarray │ │ ├── __init__.pyi │ │ └── _backend.pyi │ ├── _util.pyi │ ├── decorator.pyi │ ├── deprecation.pyi │ ├── doccer.pyi │ ├── messagestream.pyi │ └── uarray.pyi ├── _typing.pyi ├── cluster │ ├── __init__.pyi │ ├── hierarchy.pyi │ └── vq.pyi ├── constants │ ├── __init__.pyi │ ├── _codata.pyi │ ├── _constants.pyi │ ├── codata.pyi │ └── constants.pyi ├── datasets │ ├── __init__.pyi │ ├── _download_all.pyi │ ├── _fetchers.pyi │ ├── _registry.pyi │ ├── _typing.pyi │ └── _utils.pyi ├── differentiate │ ├── __init__.pyi │ └── _differentiate.pyi ├── fft │ ├── __init__.pyi │ ├── _backend.pyi │ ├── _basic.pyi │ ├── _basic_backend.pyi │ ├── _debug_backends.pyi │ ├── _fftlog.pyi │ ├── _fftlog_backend.pyi │ ├── _helper.pyi │ ├── _realtransforms.pyi │ └── _realtransforms_backend.pyi ├── fftpack │ ├── __init__.pyi │ ├── _basic.pyi │ ├── _helper.pyi │ ├── _pseudo_diffs.pyi │ ├── _realtransforms.pyi │ ├── basic.pyi │ ├── convolve.pyi │ ├── helper.pyi │ ├── pseudo_diffs.pyi │ └── realtransforms.pyi ├── integrate │ ├── __init__.pyi │ ├── _bvp.pyi │ ├── _cubature.pyi │ ├── _ivp │ │ ├── __init__.pyi │ │ ├── base.pyi │ │ ├── bdf.pyi │ │ ├── common.pyi │ │ ├── dop853_coefficients.pyi │ │ ├── ivp.pyi │ │ ├── lsoda.pyi │ │ ├── radau.pyi │ │ └── rk.pyi │ ├── _lebedev.pyi │ ├── _ode.pyi │ ├── _odepack_py.pyi │ ├── _quad_vec.pyi │ ├── _quadpack_py.pyi │ ├── _quadrature.pyi │ ├── _tanhsinh.pyi │ ├── _typing.pyi │ ├── dop.pyi │ ├── lsoda.pyi │ ├── odepack.pyi │ ├── quadpack.pyi │ └── vode.pyi ├── interpolate │ ├── __init__.pyi │ ├── _bary_rational.pyi │ ├── _bsplines.pyi │ ├── _cubic.pyi │ ├── _dfitpack.pyi │ ├── _fitpack2.pyi │ ├── _fitpack_impl.pyi │ ├── _fitpack_py.pyi │ ├── _fitpack_repro.pyi │ ├── _interpnd.pyi │ ├── _interpolate.pyi │ ├── _ndbspline.pyi │ ├── _ndgriddata.pyi │ ├── _pade.pyi │ ├── _polyint.pyi │ ├── _rbf.pyi │ ├── _rbfinterp.pyi │ ├── _rbfinterp_pythran.pyi │ ├── _rgi.pyi │ ├── dfitpack.pyi │ ├── fitpack.pyi │ ├── fitpack2.pyi │ ├── interpnd.pyi │ ├── interpolate.pyi │ ├── ndgriddata.pyi │ ├── polyint.pyi │ └── rbf.pyi ├── io │ ├── __init__.pyi │ ├── _fast_matrix_market │ │ └── __init__.pyi │ ├── _fortran.pyi │ ├── _harwell_boeing │ │ ├── __init__.pyi │ │ ├── _fortran_format_parser.pyi │ │ └── hb.pyi │ ├── _idl.pyi │ ├── _mmio.pyi │ ├── _netcdf.pyi │ ├── arff │ │ ├── __init__.pyi │ │ ├── _arffread.pyi │ │ └── arffread.pyi │ ├── harwell_boeing.pyi │ ├── idl.pyi │ ├── matlab │ │ ├── __init__.pyi │ │ ├── _byteordercodes.pyi │ │ ├── _mio.pyi │ │ ├── _mio4.pyi │ │ ├── _mio5.pyi │ │ ├── _mio5_params.pyi │ │ ├── _miobase.pyi │ │ ├── byteordercodes.pyi │ │ ├── mio.pyi │ │ ├── mio4.pyi │ │ ├── mio5.pyi │ │ ├── mio5_params.pyi │ │ ├── mio5_utils.pyi │ │ ├── mio_utils.pyi │ │ ├── miobase.pyi │ │ └── streams.pyi │ ├── mmio.pyi │ ├── netcdf.pyi │ └── wavfile.pyi ├── linalg │ ├── __init__.pyi │ ├── _basic.pyi │ ├── _cythonized_array_utils.pyi │ ├── _decomp.pyi │ ├── _decomp_cholesky.pyi │ ├── _decomp_cossin.pyi │ ├── _decomp_interpolative.pyi │ ├── _decomp_ldl.pyi │ ├── _decomp_lu.pyi │ ├── _decomp_lu_cython.pyi │ ├── _decomp_polar.pyi │ ├── _decomp_qr.pyi │ ├── _decomp_qz.pyi │ ├── _decomp_schur.pyi │ ├── _decomp_svd.pyi │ ├── _decomp_update.pyi │ ├── _expm_frechet.pyi │ ├── _fblas.pyi │ ├── _flapack.pyi │ ├── _matfuncs.pyi │ ├── _matfuncs_expm.pyi │ ├── _matfuncs_inv_ssq.pyi │ ├── _matfuncs_sqrtm.pyi │ ├── _matfuncs_sqrtm_triu.pyi │ ├── _misc.pyi │ ├── _procrustes.pyi │ ├── _sketches.pyi │ ├── _solve_toeplitz.pyi │ ├── _solvers.pyi │ ├── _special_matrices.pyi │ ├── basic.pyi │ ├── blas.pyi │ ├── cython_blas.pyi │ ├── cython_lapack.pyi │ ├── decomp.pyi │ ├── decomp_cholesky.pyi │ ├── decomp_lu.pyi │ ├── decomp_qr.pyi │ ├── decomp_schur.pyi │ ├── decomp_svd.pyi │ ├── interpolative.pyi │ ├── lapack.pyi │ ├── matfuncs.pyi │ ├── misc.pyi │ └── special_matrices.pyi ├── misc │ ├── __init__.pyi │ ├── common.pyi │ └── doccer.pyi ├── ndimage │ ├── __init__.pyi │ ├── _filters.pyi │ ├── _fourier.pyi │ ├── _interpolation.pyi │ ├── _measurements.pyi │ ├── _morphology.pyi │ ├── filters.pyi │ ├── fourier.pyi │ ├── interpolation.pyi │ ├── measurements.pyi │ └── morphology.pyi ├── odr │ ├── __init__.pyi │ ├── _add_newdocs.pyi │ ├── _models.pyi │ ├── _odrpack.pyi │ ├── models.pyi │ └── odrpack.pyi ├── optimize │ ├── __init__.pyi │ ├── _basinhopping.pyi │ ├── _bracket.pyi │ ├── _chandrupatla.pyi │ ├── _cobyla_py.pyi │ ├── _cobyqa_py.pyi │ ├── _constraints.pyi │ ├── _dcsrch.pyi │ ├── _differentiable_functions.pyi │ ├── _differentialevolution.pyi │ ├── _direct_py.pyi │ ├── _dual_annealing.pyi │ ├── _elementwise.pyi │ ├── _group_columns.pyi │ ├── _hessian_update_strategy.pyi │ ├── _isotonic.pyi │ ├── _lbfgsb_py.pyi │ ├── _linesearch.pyi │ ├── _linprog.pyi │ ├── _linprog_doc.pyi │ ├── _linprog_highs.pyi │ ├── _linprog_ip.pyi │ ├── _linprog_rs.pyi │ ├── _linprog_simplex.pyi │ ├── _linprog_util.pyi │ ├── _lsap.pyi │ ├── _lsq │ │ ├── __init__.pyi │ │ ├── bvls.pyi │ │ ├── common.pyi │ │ ├── dogbox.pyi │ │ ├── givens_elimination.pyi │ │ ├── least_squares.pyi │ │ ├── lsq_linear.pyi │ │ ├── trf.pyi │ │ └── trf_linear.pyi │ ├── _milp.pyi │ ├── _minimize.pyi │ ├── _minpack_py.pyi │ ├── _nnls.pyi │ ├── _nonlin.pyi │ ├── _numdiff.pyi │ ├── _optimize.pyi │ ├── _qap.pyi │ ├── _root.pyi │ ├── _root_scalar.pyi │ ├── _shgo.pyi │ ├── _shgo_lib │ │ ├── __init__.pyi │ │ ├── _complex.pyi │ │ └── _vertex.pyi │ ├── _slsqp_py.pyi │ ├── _slsqplib.pyi │ ├── _spectral.pyi │ ├── _tnc.pyi │ ├── _trlib │ │ ├── __init__.pyi │ │ └── _trlib.pyi │ ├── _trustregion.pyi │ ├── _trustregion_constr │ │ ├── __init__.pyi │ │ ├── canonical_constraint.pyi │ │ ├── equality_constrained_sqp.pyi │ │ ├── minimize_trustregion_constr.pyi │ │ ├── projections.pyi │ │ ├── qp_subproblem.pyi │ │ ├── report.pyi │ │ └── tr_interior_point.pyi │ ├── _trustregion_dogleg.pyi │ ├── _trustregion_exact.pyi │ ├── _trustregion_krylov.pyi │ ├── _trustregion_ncg.pyi │ ├── _typing.pyi │ ├── _zeros_py.pyi │ ├── cobyla.pyi │ ├── cython_optimize │ │ └── __init__.pyi │ ├── elementwise.pyi │ ├── lbfgsb.pyi │ ├── linesearch.pyi │ ├── minpack.pyi │ ├── minpack2.pyi │ ├── moduleTNC.pyi │ ├── nonlin.pyi │ ├── optimize.pyi │ ├── slsqp.pyi │ ├── tnc.pyi │ └── zeros.pyi ├── signal │ ├── __init__.pyi │ ├── _arraytools.pyi │ ├── _czt.pyi │ ├── _filter_design.pyi │ ├── _fir_filter_design.pyi │ ├── _lti_conversion.pyi │ ├── _ltisys.pyi │ ├── _max_len_seq.pyi │ ├── _max_len_seq_inner.pyi │ ├── _peak_finding.pyi │ ├── _peak_finding_utils.pyi │ ├── _savitzky_golay.pyi │ ├── _short_time_fft.pyi │ ├── _signaltools.pyi │ ├── _spectral_py.pyi │ ├── _spline.pyi │ ├── _spline_filters.pyi │ ├── _upfirdn.pyi │ ├── _waveforms.pyi │ ├── _wavelets.pyi │ ├── bsplines.pyi │ ├── filter_design.pyi │ ├── fir_filter_design.pyi │ ├── lti_conversion.pyi │ ├── ltisys.pyi │ ├── signaltools.pyi │ ├── spectral.pyi │ ├── spline.pyi │ ├── waveforms.pyi │ ├── wavelets.pyi │ └── windows │ │ ├── __init__.pyi │ │ ├── _windows.pyi │ │ └── windows.pyi ├── sparse │ ├── __init__.pyi │ ├── _base.pyi │ ├── _bsr.pyi │ ├── _compressed.pyi │ ├── _construct.pyi │ ├── _coo.pyi │ ├── _csc.pyi │ ├── _csr.pyi │ ├── _data.pyi │ ├── _dia.pyi │ ├── _dok.pyi │ ├── _extract.pyi │ ├── _index.pyi │ ├── _lil.pyi │ ├── _matrix.pyi │ ├── _matrix_io.pyi │ ├── _spfuncs.pyi │ ├── _sputils.pyi │ ├── _typing.pyi │ ├── base.pyi │ ├── bsr.pyi │ ├── compressed.pyi │ ├── construct.pyi │ ├── coo.pyi │ ├── csc.pyi │ ├── csgraph │ │ ├── __init__.pyi │ │ ├── _flow.pyi │ │ ├── _laplacian.pyi │ │ ├── _matching.pyi │ │ ├── _min_spanning_tree.pyi │ │ ├── _reordering.pyi │ │ ├── _shortest_path.pyi │ │ ├── _tools.pyi │ │ ├── _traversal.pyi │ │ └── _validation.pyi │ ├── csr.pyi │ ├── data.pyi │ ├── dia.pyi │ ├── dok.pyi │ ├── extract.pyi │ ├── lil.pyi │ ├── linalg │ │ ├── __init__.pyi │ │ ├── _dsolve │ │ │ ├── __init__.pyi │ │ │ ├── _superlu.pyi │ │ │ └── linsolve.pyi │ │ ├── _eigen │ │ │ ├── __init__.pyi │ │ │ ├── _svds.pyi │ │ │ ├── arpack │ │ │ │ ├── __init__.pyi │ │ │ │ └── arpack.pyi │ │ │ └── lobpcg │ │ │ │ ├── __init__.pyi │ │ │ │ └── lobpcg.pyi │ │ ├── _expm_multiply.pyi │ │ ├── _interface.pyi │ │ ├── _isolve │ │ │ ├── __init__.pyi │ │ │ ├── _gcrotmk.pyi │ │ │ ├── iterative.pyi │ │ │ ├── lgmres.pyi │ │ │ ├── lsmr.pyi │ │ │ ├── lsqr.pyi │ │ │ ├── minres.pyi │ │ │ ├── tfqmr.pyi │ │ │ └── utils.pyi │ │ ├── _matfuncs.pyi │ │ ├── _norm.pyi │ │ ├── _onenormest.pyi │ │ ├── _special_sparse_arrays.pyi │ │ ├── dsolve.pyi │ │ ├── eigen.pyi │ │ ├── interface.pyi │ │ ├── isolve.pyi │ │ └── matfuncs.pyi │ ├── sparsetools.pyi │ ├── spfuncs.pyi │ └── sputils.pyi ├── spatial │ ├── __init__.pyi │ ├── _ckdtree.pyi │ ├── _geometric_slerp.pyi │ ├── _kdtree.pyi │ ├── _plotutils.pyi │ ├── _procrustes.pyi │ ├── _qhull.pyi │ ├── _spherical_voronoi.pyi │ ├── _voronoi.pyi │ ├── ckdtree.pyi │ ├── distance.pyi │ ├── kdtree.pyi │ ├── qhull.pyi │ └── transform │ │ ├── __init__.pyi │ │ ├── _rigid_transform.pyi │ │ ├── _rotation.pyi │ │ ├── _rotation_spline.pyi │ │ └── rotation.pyi ├── special │ ├── __init__.pyi │ ├── _add_newdocs.pyi │ ├── _basic.pyi │ ├── _ellip_harm.pyi │ ├── _lambertw.pyi │ ├── _logsumexp.pyi │ ├── _multiufuncs.pyi │ ├── _orthogonal.pyi │ ├── _sf_error.pyi │ ├── _spfun_stats.pyi │ ├── _spherical_bessel.pyi │ ├── _support_alternative_backends.pyi │ ├── _ufuncs.pyi │ ├── add_newdocs.pyi │ ├── basic.pyi │ ├── cython_special.pyi │ ├── orthogonal.pyi │ ├── sf_error.pyi │ ├── specfun.pyi │ └── spfun_stats.pyi ├── stats │ ├── __init__.pyi │ ├── _axis_nan_policy.pyi │ ├── _biasedurn.pyi │ ├── _binned_statistic.pyi │ ├── _binomtest.pyi │ ├── _bws_test.pyi │ ├── _censored_data.pyi │ ├── _common.pyi │ ├── _continuous_distns.pyi │ ├── _correlation.pyi │ ├── _covariance.pyi │ ├── _crosstab.pyi │ ├── _discrete_distns.pyi │ ├── _distn_infrastructure.pyi │ ├── _distr_params.pyi │ ├── _distribution_infrastructure.pyi │ ├── _entropy.pyi │ ├── _fit.pyi │ ├── _hypotests.pyi │ ├── _kde.pyi │ ├── _ksstats.pyi │ ├── _levy_stable │ │ ├── __init__.pyi │ │ └── levyst.pyi │ ├── _mannwhitneyu.pyi │ ├── _mgc.pyi │ ├── _morestats.pyi │ ├── _mstats_basic.pyi │ ├── _mstats_extras.pyi │ ├── _multicomp.pyi │ ├── _multivariate.pyi │ ├── _new_distributions.pyi │ ├── _odds_ratio.pyi │ ├── _page_trend_test.pyi │ ├── _probability_distribution.pyi │ ├── _qmc.pyi │ ├── _qmc_cy.pyi │ ├── _qmvnt.pyi │ ├── _quantile.pyi │ ├── _rcont │ │ ├── __init__.pyi │ │ └── rcont.pyi │ ├── _relative_risk.pyi │ ├── _resampling.pyi │ ├── _result_classes.pyi │ ├── _sampling.pyi │ ├── _sensitivity_analysis.pyi │ ├── _sobol.pyi │ ├── _stats_mstats_common.pyi │ ├── _stats_py.pyi │ ├── _stats_pythran.pyi │ ├── _survival.pyi │ ├── _tukeylambda_stats.pyi │ ├── _typing.pyi │ ├── _unuran │ │ ├── __init__.pyi │ │ └── unuran_wrapper.pyi │ ├── _variation.pyi │ ├── _warnings_errors.pyi │ ├── _wilcoxon.pyi │ ├── biasedurn.pyi │ ├── contingency.pyi │ ├── distributions.pyi │ ├── kde.pyi │ ├── morestats.pyi │ ├── mstats.pyi │ ├── mstats_basic.pyi │ ├── mstats_extras.pyi │ ├── mvn.pyi │ ├── qmc.pyi │ ├── sampling.pyi │ └── stats.pyi └── version.pyi ├── scripts └── generate_matrix.py ├── tests ├── .ruff.toml ├── README.md ├── integrate │ └── test_quad.pyi ├── interpolate │ ├── _dfitpack.pyi │ ├── _rgi.pyi │ ├── bsplines.pyi │ └── dfitpack.pyi ├── linalg │ └── test_special_matrices.pyi ├── optimize │ ├── minimize.pyi │ └── minimize_scalar.pyi ├── signal │ ├── test_spectral.pyi │ ├── test_waveforms.pyi │ └── windows │ │ └── test_windows.pyi ├── special │ └── test_ufuncs.pyi └── stats │ ├── qmc │ └── test_scale.pyi │ ├── test_make_distribution.pyi │ ├── test_rv_frozen.pyi │ └── test_rv_sample.pyi ├── tox.toml └── uv.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | # https://editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | end_of_line = lf 8 | indent_size = 4 9 | indent_style = space 10 | insert_final_newline = true 11 | trim_trailing_whitespace = true 12 | 13 | [*.{json,jsonc,yml,yaml}] 14 | indent_size = 2 15 | -------------------------------------------------------------------------------- /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # SciPy Code of Conduct 2 | 3 | You can find our Code of Conduct at 4 | . 5 | 6 | We ask you to please adhere to this Code when participating in the SciPy 7 | project. 8 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: github-actions 4 | directory: / 5 | target-branch: master 6 | labels: 7 | - "meta: CI" 8 | schedule: 9 | interval: daily 10 | groups: 11 | actions: 12 | patterns: 13 | - "*" 14 | 15 | - package-ecosystem: pip 16 | directory: / 17 | target-branch: master 18 | labels: 19 | - "meta: deps" 20 | schedule: 21 | interval: daily 22 | groups: 23 | actions: 24 | patterns: 25 | - "*" 26 | -------------------------------------------------------------------------------- /.github/release.yml: -------------------------------------------------------------------------------- 1 | changelog: 2 | categories: 3 | - title: Improvements 4 | labels: 5 | - "stubs: improvement" 6 | - "stubs: incomplete" 7 | - "stubs: obsolete" 8 | - title: Fixes 9 | labels: 10 | - "stubs: fix" 11 | - "stubs: incorrect" 12 | - title: Documentation 13 | labels: 14 | - "meta: docs" 15 | - title: Dependencies 16 | labels: 17 | - "meta: deps" 18 | - title: Other Changes 19 | labels: 20 | - "*" 21 | -------------------------------------------------------------------------------- /.github/workflows/publish-pypi.yml: -------------------------------------------------------------------------------- 1 | name: Build a new release, and publish to PyPI 2 | 3 | on: 4 | workflow_dispatch: 5 | release: 6 | types: [created] 7 | 8 | env: 9 | UV_LOCKED: 1 10 | 11 | jobs: 12 | pypi-publish: 13 | name: Publish release to PyPI 14 | runs-on: ubuntu-latest 15 | timeout-minutes: 5 16 | environment: 17 | name: pypi 18 | url: https://pypi.org/p/scipy-stubs 19 | permissions: 20 | id-token: write 21 | steps: 22 | - uses: actions/checkout@v4 23 | 24 | - uses: astral-sh/setup-uv@v6 25 | with: 26 | python-version: "3.13" 27 | 28 | - name: uv build 29 | run: uv build 30 | 31 | - name: publish to PyPI 32 | uses: pypa/gh-action-pypi-publish@release/v1 33 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # Distribution / packaging 7 | build/ 8 | dist/ 9 | site/ 10 | 11 | # Cache 12 | .cache/ 13 | .mypy_cache/ 14 | .pytest_cache/ 15 | .ruff_cache/ 16 | .tox/ 17 | 18 | # Environments 19 | .env 20 | .venv/ 21 | venv/ 22 | 23 | # IntelliJ 24 | .idea/ 25 | .run/ 26 | -------------------------------------------------------------------------------- /.markdownlint.yaml: -------------------------------------------------------------------------------- 1 | default: true 2 | no-hard-tabs: true 3 | 4 | MD007: 5 | indent: 2 6 | MD013: 7 | line_length: 130 8 | MD031: 9 | list_items: false 10 | MD033: 11 | allowed_elements: 12 | - h1 13 | - p 14 | - br 15 | - a 16 | - i 17 | - code 18 | - sup 19 | - sub 20 | - img 21 | - table 22 | - tr 23 | - th 24 | - td 25 | - dl 26 | - dt 27 | - dd 28 | - details 29 | - summary 30 | -------------------------------------------------------------------------------- /.mdformat.toml: -------------------------------------------------------------------------------- 1 | end_of_line = "lf" 2 | # exclude = [".tox/**", ".venv/**", "**/*.m[!d]", "**/*.[!m]d"] 3 | # TODO: Uncomment once `--exclude` can be used on `python<3.13`, see 4 | # https://github.com/hukkin/mdformat/issues/489 5 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "charliermarsh.ruff", 4 | "detachhead.basedpyright", 5 | "ms-python.mypy-type-checker", 6 | "ms-python.python", 7 | "tamasfe.even-better-toml", 8 | "tekumara.typos-vscode" 9 | ], 10 | "unwantedRecommendations": ["ms-pyright.pyright", "ms-python.vscode-pylance"] 11 | } 12 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "[json][jsonc][yaml][yml]": { 3 | "editor.tabSize": 2 4 | }, 5 | "[markdown][python]": { 6 | "editor.rulers": [130] 7 | }, 8 | "[toml]": { 9 | "editor.rulers": [100], 10 | "editor.tabSize": 4 11 | }, 12 | "evenBetterToml.formatter.alignComments": true, 13 | "evenBetterToml.formatter.allowedBlankLines": 2, 14 | "evenBetterToml.formatter.arrayTrailingComma": true, 15 | "evenBetterToml.formatter.columnWidth": 100, 16 | "evenBetterToml.formatter.compactArrays": true, 17 | "evenBetterToml.formatter.compactInlineTables": true, 18 | "evenBetterToml.formatter.indentString": " ", 19 | "evenBetterToml.formatter.indentTables": true, 20 | "evenBetterToml.formatter.trailingNewline": true, 21 | "mypy-type-checker.path": [ 22 | "uv", 23 | "run", 24 | "--frozen", 25 | "--isolated", 26 | "--no-editable", 27 | "--refresh-package=scipy-stubs", 28 | "mypy" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2024, Joren Hammudoglu (jorenham). 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of the copyright holder nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | Only the latest release is supported. 6 | 7 | ## Reporting a Vulnerability 8 | 9 | To report a security vulnerability, please use the 10 | [Tidelift security contact](https://tidelift.com/security). 11 | Tidelift will coordinate the fix and disclosure. 12 | -------------------------------------------------------------------------------- /scipy-stubs/_distributor_init.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scipy/scipy-stubs/c8048cf7848b5fdbf88f5ebfa71d7450c20dd67d/scipy-stubs/_distributor_init.pyi -------------------------------------------------------------------------------- /scipy-stubs/_lib/__init__.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scipy/scipy-stubs/c8048cf7848b5fdbf88f5ebfa71d7450c20dd67d/scipy-stubs/_lib/__init__.pyi -------------------------------------------------------------------------------- /scipy-stubs/_lib/_bunch.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | 3 | def _validate_names(typename: str, field_names: list[str], extra_field_names: list[str]) -> None: ... 4 | def _make_tuple_bunch( 5 | typename: str, field_names: list[str], extra_field_names: list[str] | None = None, module: str | None = None 6 | ) -> type[tuple[Any, ...]]: ... 7 | -------------------------------------------------------------------------------- /scipy-stubs/_lib/_disjoint_set.pyi: -------------------------------------------------------------------------------- 1 | from collections.abc import Iterator 2 | from typing import Generic 3 | from typing_extensions import TypeVar 4 | 5 | import optype as op 6 | 7 | _T = TypeVar("_T", bound=op.CanHash, default=object) 8 | 9 | class DisjointSet(Generic[_T]): 10 | n_subsets: int 11 | 12 | def __init__(self, /, elements: _T | None = None) -> None: ... 13 | def __iter__(self, /) -> Iterator[_T]: ... 14 | def __len__(self, /) -> int: ... 15 | def __contains__(self, x: object, /) -> bool: ... 16 | def __getitem__(self, x: _T, /) -> int: ... 17 | def add(self, /, x: _T) -> None: ... 18 | def merge(self, /, x: _T, y: _T) -> bool: ... 19 | def connected(self, /, x: _T, y: _T) -> bool: ... 20 | def subset(self, /, x: _T) -> set[_T]: ... 21 | def subset_size(self, /, x: _T) -> int: ... 22 | def subsets(self, /) -> list[set[_T]]: ... 23 | -------------------------------------------------------------------------------- /scipy-stubs/_lib/_gcutils.pyi: -------------------------------------------------------------------------------- 1 | from collections.abc import Callable 2 | from contextlib import _GeneratorContextManager 3 | from typing import Final, ParamSpec, TypeVar 4 | 5 | __all__ = ["assert_deallocated", "gc_state", "set_gc_state"] 6 | 7 | ### 8 | 9 | _T = TypeVar("_T") 10 | _Tss = ParamSpec("_Tss") 11 | 12 | ### 13 | 14 | IS_PYPY: Final[bool] = ... 15 | 16 | class ReferenceError(AssertionError): ... 17 | 18 | def set_gc_state(state: bool) -> None: ... 19 | def gc_state(state: bool) -> _GeneratorContextManager[None]: ... 20 | def assert_deallocated(func: Callable[_Tss, _T], *args: _Tss.args, **kwargs: _Tss.kwargs) -> _GeneratorContextManager[_T]: ... 21 | -------------------------------------------------------------------------------- /scipy-stubs/_lib/_sparse.pyi: -------------------------------------------------------------------------------- 1 | from abc import ABC 2 | from typing_extensions import TypeIs 3 | 4 | __all__ = ["SparseABC", "issparse"] 5 | 6 | class SparseABC(ABC): ... 7 | 8 | def issparse(x: object) -> TypeIs[SparseABC]: ... 9 | -------------------------------------------------------------------------------- /scipy-stubs/_lib/_testutils.pyi: -------------------------------------------------------------------------------- 1 | from collections.abc import Callable, Iterable, Sequence 2 | from typing import ClassVar, Final, Literal 3 | 4 | import numpy as np 5 | import optype.numpy as onp 6 | 7 | __all__ = ["IS_MUSL", "PytestTester", "_TestPythranFunc", "check_free_memory"] 8 | 9 | IS_MUSL: Final[bool] 10 | IS_EDITABLE: Final[bool] 11 | 12 | class FPUModeChangeWarning(RuntimeWarning): ... 13 | 14 | class PytestTester: 15 | module_name: Final[str] 16 | def __init__(self, /, module_name: str) -> None: ... 17 | def __call__( 18 | self, 19 | /, 20 | label: Literal["fast", "full"] = "fast", 21 | verbose: int = 1, 22 | extra_argv: Iterable[str] | None = None, 23 | doctests: bool = False, 24 | coverage: bool = False, 25 | tests: Iterable[str] | None = None, 26 | parallel: int | None = None, 27 | ) -> bool: ... 28 | 29 | class _TestPythranFunc: 30 | ALL_INTEGER: ClassVar[list[np.int8 | np.int16 | np.int32 | np.int64 | np.intc | np.intp]] 31 | ALL_FLOAT: ClassVar[list[np.float32 | np.float64]] 32 | ALL_COMPLEX: ClassVar[list[np.complex64 | np.complex128]] 33 | arguments: dict[int, tuple[onp.Array, list[np.generic]]] 34 | partialfunc: Callable[..., object] | None 35 | expected: object | None 36 | def setup_method(self, /) -> None: ... 37 | def get_optional_args(self, /, func: Callable[..., object]) -> dict[str, object]: ... 38 | def get_max_dtype_list_length(self, /) -> int: ... 39 | def get_dtype(self, /, dtype_list: Sequence[np.generic], dtype_idx: int) -> np.generic: ... 40 | def test_all_dtypes(self, /) -> None: ... 41 | def test_views(self, /) -> None: ... 42 | def test_strided(self, /) -> None: ... 43 | 44 | def check_free_memory(free_mb: float) -> None: ... 45 | -------------------------------------------------------------------------------- /scipy-stubs/_lib/_threadsafety.pyi: -------------------------------------------------------------------------------- 1 | from collections.abc import Callable 2 | from typing_extensions import TypeVar 3 | 4 | from scipy._typing import EnterNoneMixin 5 | 6 | __all__ = ["ReentrancyError", "ReentrancyLock", "non_reentrant"] 7 | 8 | _FT = TypeVar("_FT", bound=Callable[..., object]) 9 | 10 | class ReentrancyError(RuntimeError): ... 11 | 12 | class ReentrancyLock(EnterNoneMixin): 13 | def __init__(self, /, err_msg: str) -> None: ... 14 | def decorate(self, /, func: _FT) -> _FT: ... 15 | 16 | def non_reentrant(err_msg: str | None = None) -> Callable[[_FT], _FT]: ... 17 | -------------------------------------------------------------------------------- /scipy-stubs/_lib/_tmpdirs.pyi: -------------------------------------------------------------------------------- 1 | from _typeshed import FileDescriptorOrPath 2 | from contextlib import _GeneratorContextManager 3 | 4 | def tempdir() -> _GeneratorContextManager[str]: ... 5 | def in_tempdir() -> _GeneratorContextManager[str]: ... 6 | def in_dir(dir: FileDescriptorOrPath | None = None) -> _GeneratorContextManager[str]: ... 7 | -------------------------------------------------------------------------------- /scipy-stubs/_lib/_uarray/__init__.pyi: -------------------------------------------------------------------------------- 1 | from typing import Final 2 | 3 | from ._backend import * 4 | 5 | __version__: Final[str] = ... 6 | -------------------------------------------------------------------------------- /scipy-stubs/_lib/decorator.pyi: -------------------------------------------------------------------------------- 1 | from collections.abc import Callable, Iterator 2 | from contextlib import _GeneratorContextManager 3 | from typing import Concatenate, Final, Generic, ParamSpec, overload 4 | from typing_extensions import TypeVar, deprecated 5 | 6 | _T = TypeVar("_T") 7 | _T_co = TypeVar("_T_co", covariant=True, default=object) 8 | _Tss = ParamSpec("_Tss") 9 | _FT = TypeVar("_FT", bound=Callable[..., object]) 10 | 11 | __version__: Final[str] = ... 12 | 13 | class ContextManager(_GeneratorContextManager[_T_co], Generic[_T_co]): 14 | def __init__(self, /, g: Callable[_Tss, Iterator[_T_co]], *a: _Tss.args, **k: _Tss.kwargs) -> None: ... 15 | 16 | def contextmanager(g: Callable[_Tss, Iterator[_T]], *a: _Tss.args, **k: _Tss.kwargs) -> Callable[[], ContextManager[_T]]: ... 17 | 18 | # 19 | def decorate(func: _FT, caller: Callable[Concatenate[_FT, _Tss], _T]) -> Callable[_Tss, _T]: ... 20 | @overload 21 | def decorator(caller: Callable[Concatenate[_FT, _Tss], _T], _func: None = None) -> Callable[[_FT], Callable[_Tss, _T]]: ... 22 | @overload 23 | @deprecated("this is obsolete behavior; you should use decorate instead") 24 | def decorator(caller: Callable[Concatenate[_FT, _Tss], _T], _func: _FT) -> Callable[_Tss, _T]: ... 25 | -------------------------------------------------------------------------------- /scipy-stubs/_lib/deprecation.pyi: -------------------------------------------------------------------------------- 1 | from collections.abc import Callable 2 | from types import ModuleType 3 | from typing import TypeVar 4 | 5 | __all__ = ["_deprecated"] 6 | 7 | _F = TypeVar("_F", bound=Callable[..., object]) 8 | 9 | class _DeprecationHelperStr: 10 | def __init__(self, /, content: str, message: str) -> None: ... 11 | 12 | def _deprecated(msg: str, stacklevel: int = 2) -> Callable[[_F], _F]: ... 13 | def deprecate_cython_api( 14 | module: ModuleType, routine_name: str, new_name: str | None = None, message: str | None = None 15 | ) -> None: ... 16 | -------------------------------------------------------------------------------- /scipy-stubs/_lib/doccer.pyi: -------------------------------------------------------------------------------- 1 | from collections.abc import Callable 2 | from typing_extensions import TypeVar 3 | 4 | import optype as op 5 | 6 | __all__ = [ 7 | "doc_replace", 8 | "docformat", 9 | "extend_notes_in_docstring", 10 | "filldoc", 11 | "indentcount_lines", 12 | "inherit_docstring_from", 13 | "replace_notes_in_docstring", 14 | "unindent_dict", 15 | "unindent_string", 16 | ] 17 | 18 | _F = TypeVar("_F", bound=Callable[..., object]) 19 | 20 | def docformat(docstring: str, docdict: dict[str, str] | None = None) -> str: ... 21 | def inherit_docstring_from(cls: type | object) -> Callable[[_F], _F]: ... 22 | def extend_notes_in_docstring(cls: type | object, notes: str) -> Callable[[_F], _F]: ... 23 | def replace_notes_in_docstring(cls: type | object, notes: str) -> Callable[[_F], _F]: ... 24 | def indentcount_lines(lines: op.CanIter[op.CanNext[str]]) -> int: ... 25 | def filldoc(docdict: dict[str, str], unindent_params: bool = True) -> Callable[[_F], _F]: ... 26 | def unindent_dict(docdict: dict[str, str]) -> dict[str, str]: ... 27 | def unindent_string(docstring: str) -> str: ... 28 | def doc_replace(obj: object, oldval: str, newval: str) -> Callable[[_F], _F]: ... 29 | -------------------------------------------------------------------------------- /scipy-stubs/_lib/messagestream.pyi: -------------------------------------------------------------------------------- 1 | from typing import final 2 | 3 | @final 4 | class MessageStream: 5 | def get(self, /) -> bytes: ... 6 | def clear(self, /) -> None: ... 7 | def close(self, /) -> None: ... 8 | 9 | def __setstate_cython__(self: object, pyx_state: object, /) -> None: ... 10 | def __reduce_cython__(self: object) -> None: ... 11 | -------------------------------------------------------------------------------- /scipy-stubs/_lib/uarray.pyi: -------------------------------------------------------------------------------- 1 | from ._uarray import * 2 | -------------------------------------------------------------------------------- /scipy-stubs/cluster/__init__.pyi: -------------------------------------------------------------------------------- 1 | from . import hierarchy, vq 2 | 3 | __all__ = ["hierarchy", "vq"] 4 | -------------------------------------------------------------------------------- /scipy-stubs/constants/codata.pyi: -------------------------------------------------------------------------------- 1 | # This file is not meant for public use and will be removed in SciPy v2.0.0. 2 | from typing_extensions import deprecated 3 | 4 | # Constants can't be tagged with `deprecated` so no point to stub these out again. 5 | from ._codata import c, k, physical_constants 6 | 7 | __all__ = ["ConstantWarning", "c", "find", "k", "physical_constants", "precision", "unit", "value"] 8 | 9 | @deprecated("will be removed in SciPy v2.0.0") 10 | class ConstantWarning(DeprecationWarning): ... 11 | 12 | @deprecated("will be removed in SciPy v2.0.0") 13 | def find(sub: str | None = ..., disp: bool = ...) -> object: ... 14 | @deprecated("will be removed in SciPy v2.0.0") 15 | def precision(key: str) -> float: ... 16 | @deprecated("will be removed in SciPy v2.0.0") 17 | def unit(key: str) -> object: ... 18 | @deprecated("will be removed in SciPy v2.0.0") 19 | def value(key: str) -> float: ... 20 | -------------------------------------------------------------------------------- /scipy-stubs/datasets/__init__.pyi: -------------------------------------------------------------------------------- 1 | from ._download_all import download_all 2 | from ._fetchers import ascent, electrocardiogram, face 3 | from ._utils import clear_cache 4 | 5 | __all__ = ["ascent", "clear_cache", "download_all", "electrocardiogram", "face"] 6 | -------------------------------------------------------------------------------- /scipy-stubs/datasets/_download_all.pyi: -------------------------------------------------------------------------------- 1 | from os import PathLike 2 | 3 | def download_all(path: str | PathLike[str] | None = None) -> None: ... 4 | def main() -> None: ... # undocumented 5 | -------------------------------------------------------------------------------- /scipy-stubs/datasets/_fetchers.pyi: -------------------------------------------------------------------------------- 1 | from typing import Final, Literal as L, LiteralString, overload 2 | 3 | from ._typing import AscentDataset, CanFetch, ECGDataset, Face2Dataset, Face3Dataset 4 | 5 | ### 6 | 7 | data_fetcher: Final[CanFetch | None] = ... # undocumented 8 | 9 | def fetch_data( 10 | dataset_name: L["ascent.dat", "ecg.dat", "face.dat"], data_fetcher: CanFetch | None = None 11 | ) -> LiteralString: ... # undocumented 12 | 13 | # 14 | def ascent() -> AscentDataset: ... 15 | def electrocardiogram() -> ECGDataset: ... 16 | @overload 17 | def face(gray: L[True, 1]) -> Face2Dataset: ... 18 | @overload 19 | def face(gray: L[False, 0] = False) -> Face3Dataset: ... 20 | -------------------------------------------------------------------------------- /scipy-stubs/datasets/_registry.pyi: -------------------------------------------------------------------------------- 1 | from typing import Final, Literal as L, LiteralString, TypedDict, type_check_only 2 | 3 | @type_check_only 4 | class _MethodRegistry(TypedDict): 5 | ascent: list[L["ascent.dat"]] 6 | electrocardiogram: list[L["ecg.dat"]] 7 | face: list[L["face.dat"]] 8 | 9 | _DataRegistry = TypedDict("_DataRegistry", {"ascent.dat": LiteralString, "ecg.dat": LiteralString, "face.dat": LiteralString}) 10 | 11 | registry: Final[_DataRegistry] = ... 12 | registry_urls: Final[_DataRegistry] = ... 13 | method_files_map: Final[_MethodRegistry] = ... 14 | -------------------------------------------------------------------------------- /scipy-stubs/datasets/_typing.pyi: -------------------------------------------------------------------------------- 1 | from collections.abc import Callable 2 | from typing import Literal as L, LiteralString, Protocol, TypeAlias, overload, type_check_only 3 | 4 | import numpy as np 5 | import optype.numpy as onp 6 | 7 | __all__ = "AscentDataset", "CanFetch", "Dataset", "ECGDataset", "Face2Dataset", "Face3Dataset", "Fetcher" 8 | 9 | @type_check_only 10 | class CanFetch(Protocol): 11 | def fetch(self, dataset_name: LiteralString, /) -> LiteralString: ... 12 | 13 | AscentDataset: TypeAlias = onp.Array2D[np.uint8] 14 | ECGDataset: TypeAlias = onp.Array1D[np.float64] 15 | Face2Dataset: TypeAlias = onp.Array2D[np.uint8] 16 | Face3Dataset: TypeAlias = onp.Array3D[np.uint8] 17 | _FaceDataset: TypeAlias = Face2Dataset | Face3Dataset 18 | Dataset: TypeAlias = AscentDataset | ECGDataset | _FaceDataset 19 | 20 | _AscentFetcher: TypeAlias = Callable[[], AscentDataset] 21 | _ECGFetcher: TypeAlias = Callable[[], ECGDataset] 22 | 23 | @type_check_only 24 | class _FaceFetcher(Protocol): 25 | @overload 26 | def __call__(self, /, gray: L[True, 1]) -> Face2Dataset: ... 27 | @overload 28 | def __call__(self, /, gray: L[False, 0] = False) -> Face3Dataset: ... 29 | 30 | Fetcher: TypeAlias = _AscentFetcher | _ECGFetcher | _FaceFetcher 31 | -------------------------------------------------------------------------------- /scipy-stubs/datasets/_utils.pyi: -------------------------------------------------------------------------------- 1 | from ._typing import Fetcher 2 | 3 | # NOTE: the implementation explcitily checks for `list` and `tuple` types 4 | def clear_cache(datasets: Fetcher | list[Fetcher] | tuple[Fetcher, ...] | None = None) -> None: ... 5 | -------------------------------------------------------------------------------- /scipy-stubs/differentiate/__init__.pyi: -------------------------------------------------------------------------------- 1 | from ._differentiate import derivative, hessian, jacobian 2 | 3 | __all__ = ["derivative", "hessian", "jacobian"] 4 | -------------------------------------------------------------------------------- /scipy-stubs/fft/__init__.pyi: -------------------------------------------------------------------------------- 1 | from contextlib import _GeneratorContextManager 2 | 3 | from ._backend import register_backend, set_backend, set_global_backend, skip_backend 4 | from ._basic import ( 5 | fft, 6 | fft2, 7 | fftn, 8 | hfft, 9 | hfft2, 10 | hfftn, 11 | ifft, 12 | ifft2, 13 | ifftn, 14 | ihfft, 15 | ihfft2, 16 | ihfftn, 17 | irfft, 18 | irfft2, 19 | irfftn, 20 | rfft, 21 | rfft2, 22 | rfftn, 23 | ) 24 | from ._fftlog import fht, fhtoffset, ifht 25 | from ._helper import fftfreq, fftshift, ifftshift, next_fast_len, prev_fast_len, rfftfreq 26 | from ._realtransforms import dct, dctn, dst, dstn, idct, idctn, idst, idstn 27 | 28 | __all__ = [ 29 | "dct", 30 | "dctn", 31 | "dst", 32 | "dstn", 33 | "fft", 34 | "fft2", 35 | "fftfreq", 36 | "fftn", 37 | "fftshift", 38 | "fht", 39 | "fhtoffset", 40 | "get_workers", 41 | "hfft", 42 | "hfft2", 43 | "hfftn", 44 | "idct", 45 | "idctn", 46 | "idst", 47 | "idstn", 48 | "ifft", 49 | "ifft2", 50 | "ifftn", 51 | "ifftshift", 52 | "ifht", 53 | "ihfft", 54 | "ihfft2", 55 | "ihfftn", 56 | "irfft", 57 | "irfft2", 58 | "irfftn", 59 | "next_fast_len", 60 | "prev_fast_len", 61 | "register_backend", 62 | "rfft", 63 | "rfft2", 64 | "rfftfreq", 65 | "rfftn", 66 | "set_backend", 67 | "set_global_backend", 68 | "set_workers", 69 | "skip_backend", 70 | ] 71 | 72 | # originally defined in `scipy.fft._pocketfft.helper` 73 | def set_workers(workers: int) -> _GeneratorContextManager[None]: ... 74 | def get_workers() -> int: ... 75 | -------------------------------------------------------------------------------- /scipy-stubs/fft/_backend.pyi: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping, Sequence 2 | from typing import Any, ClassVar, LiteralString, Protocol, final, type_check_only 3 | from typing_extensions import TypeVar 4 | 5 | import optype as op 6 | 7 | _RT_co = TypeVar("_RT_co", covariant=True, default=Any) 8 | 9 | @type_check_only 10 | class _BaseBackend(Protocol[_RT_co]): 11 | __ua_domain__: ClassVar[LiteralString] = "numpy.scipy.fft" 12 | @staticmethod 13 | def __ua_function__(method: str, args: Sequence[object], kwargs: Mapping[str, object]) -> _RT_co: ... 14 | 15 | ### 16 | 17 | @final 18 | class _ScipyBackend(_BaseBackend): ... 19 | 20 | def set_global_backend(backend: _BaseBackend, coerce: bool = False, only: bool = False, try_last: bool = False) -> None: ... 21 | def register_backend(backend: _BaseBackend) -> None: ... 22 | def set_backend(backend: _BaseBackend, coerce: bool = False, only: bool = False) -> op.CanWith[None]: ... 23 | def skip_backend(backend: _BaseBackend) -> op.CanWith[None]: ... 24 | -------------------------------------------------------------------------------- /scipy-stubs/fft/_basic_backend.pyi: -------------------------------------------------------------------------------- 1 | from typing import Final 2 | 3 | from ._basic import ( 4 | fft as fft, 5 | fft2 as fft2, 6 | fftn as fftn, 7 | hfft as hfft, 8 | hfft2 as hfft2, 9 | hfftn as hfftn, 10 | ifft as ifft, 11 | ifft2 as ifft2, 12 | ifftn as ifftn, 13 | ihfft as ihfft, 14 | ihfft2 as ihfft2, 15 | ihfftn as ihfftn, 16 | irfft as irfft, 17 | irfft2 as irfft2, 18 | irfftn as irfftn, 19 | rfft as rfft, 20 | rfft2 as rfft2, 21 | rfftn as rfftn, 22 | ) 23 | 24 | complex_funcs: Final = {"fft", "ifft", "fftn", "ifftn", "hfft", "irfft", "irfftn"} 25 | -------------------------------------------------------------------------------- /scipy-stubs/fft/_debug_backends.pyi: -------------------------------------------------------------------------------- 1 | from typing import final 2 | 3 | from ._backend import _BaseBackend 4 | 5 | @final 6 | class NumPyBackend(_BaseBackend): ... 7 | 8 | @final 9 | class EchoBackend(_BaseBackend[None]): ... 10 | -------------------------------------------------------------------------------- /scipy-stubs/fft/_fftlog.pyi: -------------------------------------------------------------------------------- 1 | from typing import TypeAlias 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | __all__ = ["fht", "fhtoffset", "ifht"] 7 | 8 | _RealND: TypeAlias = onp.ArrayND[np.float32 | np.float64 | np.longdouble] 9 | 10 | def fht(a: onp.ToFloatND, dln: onp.ToFloat, mu: onp.ToFloat, offset: onp.ToFloat = 0.0, bias: onp.ToFloat = 0.0) -> _RealND: ... 11 | def ifht(A: onp.ToFloatND, dln: onp.ToFloat, mu: onp.ToFloat, offset: onp.ToFloat = 0.0, bias: onp.ToFloat = 0.0) -> _RealND: ... 12 | def fhtoffset(dln: onp.ToFloat, mu: onp.ToFloat, initial: onp.ToFloat = 0.0, bias: onp.ToFloat = 0.0) -> np.float64: ... 13 | -------------------------------------------------------------------------------- /scipy-stubs/fft/_fftlog_backend.pyi: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import optype as op 3 | import optype.numpy as onp 4 | 5 | from ._fftlog import fht, fhtoffset, ifht 6 | 7 | __all__ = ["fht", "fhtoffset", "ifht"] 8 | 9 | def fhtcoeff( 10 | n: onp.ToInt, 11 | dln: onp.ToFloat, 12 | mu: onp.ToFloat, 13 | offset: onp.ToFloat = 0.0, 14 | bias: onp.ToFloat = 0.0, 15 | inverse: op.CanBool = False, 16 | ) -> onp.ArrayND[np.complex128]: ... 17 | -------------------------------------------------------------------------------- /scipy-stubs/fft/_realtransforms_backend.pyi: -------------------------------------------------------------------------------- 1 | from typing import TypeAlias 2 | 3 | import numpy as np 4 | import optype as op 5 | import optype.numpy as onp 6 | 7 | from scipy._typing import AnyShape, DCTType, NormalizationMode 8 | 9 | from ._realtransforms import dct, dctn, dst, dstn, idct, idst 10 | 11 | __all__ = ["dct", "dctn", "dst", "dstn", "idct", "idctn", "idst", "idstn"] 12 | 13 | _RealND: TypeAlias = onp.ArrayND[np.float32 | np.float64 | np.longdouble] 14 | 15 | # NOTE: Unlike the ones in `scipy.fft._realtransforms`, `orthogonalize` is keyword-only here. 16 | def idctn( 17 | x: onp.ToComplexND, 18 | type: DCTType = 2, 19 | s: onp.ToInt | onp.ToIntND | None = None, 20 | axes: AnyShape | None = None, 21 | norm: NormalizationMode | None = None, 22 | overwrite_x: op.CanBool = False, 23 | workers: onp.ToInt | None = None, 24 | *, 25 | orthogonalize: op.CanBool | None = None, 26 | ) -> _RealND: ... 27 | def idstn( 28 | x: onp.ToComplexND, 29 | type: DCTType = 2, 30 | s: onp.ToInt | onp.ToIntND | None = None, 31 | axes: AnyShape | None = None, 32 | norm: NormalizationMode | None = None, 33 | overwrite_x: op.CanBool = False, 34 | workers: onp.ToInt | None = None, 35 | *, 36 | orthogonalize: op.CanBool | None = None, 37 | ) -> _RealND: ... 38 | -------------------------------------------------------------------------------- /scipy-stubs/fftpack/__init__.pyi: -------------------------------------------------------------------------------- 1 | from . import basic as basic, helper as helper, pseudo_diffs as pseudo_diffs, realtransforms as realtransforms # deprecated 2 | from ._basic import * 3 | from ._helper import * 4 | from ._pseudo_diffs import * 5 | from ._realtransforms import * 6 | 7 | __all__ = [ 8 | "cc_diff", 9 | "cs_diff", 10 | "dct", 11 | "dctn", 12 | "diff", 13 | "dst", 14 | "dstn", 15 | "fft", 16 | "fft2", 17 | "fftfreq", 18 | "fftn", 19 | "fftshift", 20 | "hilbert", 21 | "idct", 22 | "idctn", 23 | "idst", 24 | "idstn", 25 | "ifft", 26 | "ifft2", 27 | "ifftn", 28 | "ifftshift", 29 | "ihilbert", 30 | "irfft", 31 | "itilbert", 32 | "next_fast_len", 33 | "rfft", 34 | "rfftfreq", 35 | "sc_diff", 36 | "shift", 37 | "ss_diff", 38 | "tilbert", 39 | ] 40 | -------------------------------------------------------------------------------- /scipy-stubs/fftpack/_helper.pyi: -------------------------------------------------------------------------------- 1 | # NOTE: this ignore is required for `numpy==1.23.5` compat 2 | # pyright: reportUnknownVariableType=false 3 | 4 | import numpy as np 5 | import optype.numpy as onp 6 | from numpy.fft import fftfreq, fftshift, ifftshift 7 | 8 | __all__ = ["fftfreq", "fftshift", "ifftshift", "next_fast_len", "rfftfreq"] 9 | 10 | def rfftfreq(n: onp.ToInt, d: onp.ToFloat = 1.0) -> onp.Array1D[np.float64]: ... 11 | def next_fast_len(target: onp.ToInt) -> int: ... 12 | -------------------------------------------------------------------------------- /scipy-stubs/fftpack/basic.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | from typing import Final 3 | from typing_extensions import deprecated 4 | 5 | __all__ = ["fft", "fft2", "fftn", "ifft", "ifft2", "ifftn", "irfft", "rfft"] 6 | 7 | __MESSAGE: Final = "will be removed in SciPy v2.0.0" 8 | 9 | @deprecated(__MESSAGE) 10 | def fft(x: object, n: object = ..., axis: object = ..., overwrite_x: object = ...) -> object: ... 11 | @deprecated(__MESSAGE) 12 | def ifft(x: object, n: object = ..., axis: object = ..., overwrite_x: object = ...) -> object: ... 13 | @deprecated(__MESSAGE) 14 | def rfft(x: object, n: object = ..., axis: object = ..., overwrite_x: object = ...) -> object: ... 15 | @deprecated(__MESSAGE) 16 | def irfft(x: object, n: object = ..., axis: object = ..., overwrite_x: object = ...) -> object: ... 17 | @deprecated(__MESSAGE) 18 | def fftn(x: object, shape: object = ..., axes: object = ..., overwrite_x: object = ...) -> object: ... 19 | @deprecated(__MESSAGE) 20 | def ifftn(x: object, shape: object = ..., axes: object = ..., overwrite_x: object = ...) -> object: ... 21 | @deprecated(__MESSAGE) 22 | def fft2(x: object, shape: object = ..., axes: object = ..., overwrite_x: object = ...) -> object: ... 23 | @deprecated(__MESSAGE) 24 | def ifft2(x: object, shape: object = ..., axes: object = ..., overwrite_x: object = ...) -> object: ... 25 | -------------------------------------------------------------------------------- /scipy-stubs/fftpack/convolve.pyi: -------------------------------------------------------------------------------- 1 | from collections.abc import Callable 2 | from typing import Concatenate, TypeAlias, overload 3 | 4 | import numpy as np 5 | import optype.numpy as onp 6 | 7 | from scipy._typing import AnyBool 8 | 9 | __all__ = ["convolve", "convolve_z", "destroy_convolve_cache", "init_convolution_kernel"] 10 | 11 | _Float1D: TypeAlias = onp.Array1D[np.float64] 12 | 13 | # NOTE: this doesn't do anything; nothing is cached 14 | def destroy_convolve_cache() -> None: ... 15 | 16 | # 17 | def convolve( 18 | inout: onp.ToFloat1D, omega: onp.ToFloat1D, swap_real_imag: AnyBool = False, overwrite_x: AnyBool = False 19 | ) -> _Float1D: ... 20 | 21 | # 22 | def convolve_z( 23 | inout: onp.ToFloat1D, omega_real: onp.ToFloat1D, omega_imag: onp.ToFloat1D, overwrite_x: AnyBool = False 24 | ) -> _Float1D: ... 25 | 26 | # 27 | @overload 28 | def init_convolution_kernel( 29 | n: onp.ToInt, 30 | kernel_func: Callable[[int], float], 31 | d: onp.ToInt = 0, 32 | zero_nyquist: onp.ToInt | None = None, 33 | kernel_func_extra_args: tuple[()] = (), 34 | ) -> _Float1D: ... 35 | @overload 36 | def init_convolution_kernel( 37 | n: onp.ToInt, 38 | kernel_func: Callable[Concatenate[int, ...], float], 39 | d: onp.ToInt, 40 | zero_nyquist: onp.ToInt | None, 41 | kernel_func_extra_args: tuple[object, ...], 42 | ) -> _Float1D: ... 43 | @overload 44 | def init_convolution_kernel( 45 | n: onp.ToInt, 46 | kernel_func: Callable[Concatenate[int, ...], float], 47 | d: onp.ToInt = 0, 48 | zero_nyquist: onp.ToInt | None = None, 49 | *, 50 | kernel_func_extra_args: tuple[object, ...], 51 | ) -> _Float1D: ... 52 | -------------------------------------------------------------------------------- /scipy-stubs/fftpack/helper.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | from typing import Final 3 | from typing_extensions import deprecated 4 | 5 | __all__ = ["fftfreq", "fftshift", "ifftshift", "next_fast_len", "rfftfreq"] 6 | 7 | __MESSAGE: Final = "will be removed in SciPy v2.0.0" 8 | 9 | @deprecated(__MESSAGE) 10 | def fftfreq(n: object, d: object = ..., device: object = ...) -> object: ... 11 | @deprecated(__MESSAGE) 12 | def fftshift(x: object, axes: object = ...) -> object: ... 13 | @deprecated(__MESSAGE) 14 | def ifftshift(x: object, axes: object = ...) -> object: ... 15 | @deprecated(__MESSAGE) 16 | def next_fast_len(target: object) -> object: ... 17 | @deprecated(__MESSAGE) 18 | def rfftfreq(n: object, d: object = ...) -> object: ... 19 | -------------------------------------------------------------------------------- /scipy-stubs/fftpack/pseudo_diffs.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | from typing import Final 3 | from typing_extensions import deprecated 4 | 5 | from . import convolve as convolve 6 | 7 | __all__ = ["cc_diff", "convolve", "cs_diff", "diff", "hilbert", "ihilbert", "itilbert", "sc_diff", "shift", "ss_diff", "tilbert"] 8 | 9 | __MESSAGE: Final = "will be removed in SciPy v2.0.0" 10 | 11 | @deprecated(__MESSAGE) 12 | def diff(x: object, order: object = 1, period: object = ..., _cache: object = ...) -> object: ... 13 | @deprecated(__MESSAGE) 14 | def tilbert(x: object, h: object, period: object = ..., _cache: object = ...) -> object: ... 15 | @deprecated(__MESSAGE) 16 | def itilbert(x: object, h: object, period: object = ..., _cache: object = ...) -> object: ... 17 | @deprecated(__MESSAGE) 18 | def hilbert(x: object, _cache: object = ...) -> object: ... 19 | @deprecated(__MESSAGE) 20 | def ihilbert(x: object) -> object: ... 21 | @deprecated(__MESSAGE) 22 | def cs_diff(x: object, a: object, b: object, period: object = ..., _cache: object = ...) -> object: ... 23 | @deprecated(__MESSAGE) 24 | def sc_diff(x: object, a: object, b: object, period: object = ..., _cache: object = ...) -> object: ... 25 | @deprecated(__MESSAGE) 26 | def ss_diff(x: object, a: object, b: object, period: object = ..., _cache: object = ...) -> object: ... 27 | @deprecated(__MESSAGE) 28 | def cc_diff(x: object, a: object, b: object, period: object = ..., _cache: object = ...) -> object: ... 29 | @deprecated(__MESSAGE) 30 | def shift(x: object, a: object, period: object = ..., _cache: object = ...) -> object: ... 31 | -------------------------------------------------------------------------------- /scipy-stubs/integrate/__init__.pyi: -------------------------------------------------------------------------------- 1 | from . import dop, lsoda, odepack, quadpack, vode # deprecated namespaces 2 | from ._bvp import solve_bvp 3 | from ._cubature import cubature 4 | from ._ivp import BDF, DOP853, LSODA, RK23, RK45, DenseOutput, OdeSolution, OdeSolver, Radau, solve_ivp 5 | from ._lebedev import lebedev_rule 6 | from ._ode import complex_ode, ode 7 | from ._odepack_py import ODEintWarning, odeint 8 | from ._quad_vec import quad_vec 9 | from ._quadpack_py import IntegrationWarning, dblquad, nquad, quad, tplquad 10 | from ._quadrature import cumulative_simpson, cumulative_trapezoid, fixed_quad, newton_cotes, qmc_quad, romb, simpson, trapezoid 11 | from ._tanhsinh import nsum, tanhsinh 12 | 13 | __all__ = [ 14 | "BDF", 15 | "DOP853", 16 | "LSODA", 17 | "RK23", 18 | "RK45", 19 | "DenseOutput", 20 | "IntegrationWarning", 21 | "ODEintWarning", 22 | "OdeSolution", 23 | "OdeSolver", 24 | "Radau", 25 | "complex_ode", 26 | "cubature", 27 | "cumulative_simpson", 28 | "cumulative_trapezoid", 29 | "dblquad", 30 | "dop", 31 | "fixed_quad", 32 | "lebedev_rule", 33 | "lsoda", 34 | "newton_cotes", 35 | "nquad", 36 | "nsum", 37 | "ode", 38 | "odeint", 39 | "odepack", 40 | "qmc_quad", 41 | "quad", 42 | "quad_vec", 43 | "quadpack", 44 | "romb", 45 | "simpson", 46 | "solve_bvp", 47 | "solve_ivp", 48 | "tanhsinh", 49 | "tplquad", 50 | "trapezoid", 51 | "vode", 52 | ] 53 | -------------------------------------------------------------------------------- /scipy-stubs/integrate/_ivp/__init__.pyi: -------------------------------------------------------------------------------- 1 | from .base import DenseOutput as DenseOutput, OdeSolver as OdeSolver 2 | from .bdf import BDF as BDF 3 | from .common import OdeSolution as OdeSolution 4 | from .ivp import solve_ivp as solve_ivp 5 | from .lsoda import LSODA as LSODA 6 | from .radau import Radau as Radau 7 | from .rk import DOP853 as DOP853, RK23 as RK23, RK45 as RK45 8 | 9 | # NOTE: There is no `__all__` at runtime 10 | -------------------------------------------------------------------------------- /scipy-stubs/integrate/_ivp/dop853_coefficients.pyi: -------------------------------------------------------------------------------- 1 | from typing import Final 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | N_STAGES: Final = 12 7 | N_STAGES_EXTENDED: Final = 16 8 | INTERPOLATOR_POWER: Final = 7 9 | C: Final[onp.Array1D[np.float64]] 10 | A: Final[onp.Array2D[np.float64]] 11 | B: Final[onp.Array1D[np.float64]] 12 | E3: Final[onp.Array1D[np.float64]] 13 | E5: Final[onp.Array1D[np.float64]] 14 | D: Final[onp.Array2D[np.float64]] 15 | -------------------------------------------------------------------------------- /scipy-stubs/integrate/_ivp/lsoda.pyi: -------------------------------------------------------------------------------- 1 | from collections.abc import Callable 2 | from typing import Never 3 | 4 | import numpy as np 5 | import optype.numpy as onp 6 | 7 | from .base import DenseOutput, OdeSolver 8 | 9 | class LSODA(OdeSolver): 10 | def __init__( 11 | self, 12 | /, 13 | fun: Callable[[float, onp.Array1D[np.float64]], onp.Array1D[np.float64]], 14 | t0: float, 15 | y0: onp.Array1D[np.float64], 16 | t_bound: float, 17 | first_step: float | None = None, 18 | min_step: float = 0.0, 19 | max_step: float = ..., 20 | rtol: onp.ToFloat | onp.ToFloat1D = 0.001, 21 | atol: onp.ToFloat | onp.ToFloat1D = 1e-06, 22 | jac: Callable[[float, onp.Array1D[np.float64]], onp.Array2D[np.float64]] | None = None, 23 | lband: int | None = None, 24 | uband: int | None = None, 25 | vectorized: bool = False, 26 | **extraneous: Never, 27 | ) -> None: ... 28 | 29 | class LsodaDenseOutput(DenseOutput): 30 | h: float 31 | yh: onp.Array1D[np.float64] 32 | p: onp.Array1D[np.intp] 33 | 34 | def __init__(self, /, t_old: float, t: float, h: float, order: int, yh: onp.Array1D[np.float64]) -> None: ... 35 | -------------------------------------------------------------------------------- /scipy-stubs/integrate/_lebedev.pyi: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import optype.numpy as onp 3 | 4 | __all__ = ["lebedev_rule"] 5 | 6 | def lebedev_rule(n: int) -> tuple[onp.Array2D[np.float64], onp.Array1D[np.float64]]: ... 7 | -------------------------------------------------------------------------------- /scipy-stubs/integrate/dop.pyi: -------------------------------------------------------------------------------- 1 | # This file is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | __all__: list[str] = [] 4 | -------------------------------------------------------------------------------- /scipy-stubs/integrate/lsoda.pyi: -------------------------------------------------------------------------------- 1 | # This file is not meant for public use and will be removed in SciPy v2.0.0. 2 | __all__ = ["lsoda"] 3 | 4 | lsoda: object 5 | -------------------------------------------------------------------------------- /scipy-stubs/integrate/odepack.pyi: -------------------------------------------------------------------------------- 1 | # This file is not meant for public use and will be removed in SciPy v2.0.0. 2 | from typing_extensions import deprecated 3 | 4 | __all__ = ["ODEintWarning", "odeint"] 5 | 6 | @deprecated("will be removed in SciPy 2.0.0.") 7 | class ODEintWarning(Warning): ... 8 | 9 | @deprecated("will be removed in SciPy v2.0.0") 10 | def odeint( 11 | func: object, 12 | y0: object, 13 | t: object, 14 | args: object = ..., 15 | Dfun: object = ..., 16 | col_deriv: object = ..., 17 | full_output: object = ..., 18 | ml: object = ..., 19 | mu: object = ..., 20 | rtol: object = ..., 21 | atol: object = ..., 22 | tcrit: object = ..., 23 | h0: object = ..., 24 | hmax: object = ..., 25 | hmin: object = ..., 26 | ixpr: object = ..., 27 | mxstep: object = ..., 28 | mxhnil: object = ..., 29 | mxordn: object = ..., 30 | mxords: object = ..., 31 | printmessg: object = ..., 32 | tfirst: object = ..., 33 | ) -> object: ... 34 | -------------------------------------------------------------------------------- /scipy-stubs/integrate/quadpack.pyi: -------------------------------------------------------------------------------- 1 | # This file is not meant for public use and will be removed in SciPy v2.0.0. 2 | from typing_extensions import deprecated 3 | 4 | __all__ = ["IntegrationWarning", "dblquad", "nquad", "quad", "tplquad"] 5 | 6 | @deprecated("will be removed in SciPy v2.0.0") 7 | class IntegrationWarning(UserWarning): ... 8 | 9 | @deprecated("will be removed in SciPy v2.0.0") 10 | def dblquad( 11 | func: object, a: object, b: object, gfun: object, hfun: object, args: object = ..., epsabs: object = ..., epsrel: object = ... 12 | ) -> object: ... 13 | @deprecated("will be removed in SciPy v2.0.0") 14 | def nquad(func: object, ranges: object, args: object = ..., opts: object = ..., full_output: object = ...) -> object: ... 15 | @deprecated("will be removed in SciPy v2.0.0") 16 | def quad( 17 | func: object, 18 | a: object, 19 | b: object, 20 | args: object = ..., 21 | full_output: object = ..., 22 | epsabs: object = ..., 23 | epsrel: object = ..., 24 | limit: object = ..., 25 | points: object = ..., 26 | weight: object = ..., 27 | wvar: object = ..., 28 | wopts: object = ..., 29 | maxp1: object = ..., 30 | limlst: object = ..., 31 | complex_func: object = ..., 32 | ) -> object: ... 33 | @deprecated("will be removed in SciPy v2.0.0") 34 | def tplquad( 35 | func: object, 36 | a: object, 37 | b: object, 38 | gfun: object, 39 | hfun: object, 40 | qfun: object, 41 | rfun: object, 42 | args: object = ..., 43 | epsabs: object = ..., 44 | epsrel: object = ..., 45 | ) -> object: ... 46 | -------------------------------------------------------------------------------- /scipy-stubs/integrate/vode.pyi: -------------------------------------------------------------------------------- 1 | # This file is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | __all__: list[str] = [] 4 | -------------------------------------------------------------------------------- /scipy-stubs/interpolate/_pade.pyi: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import optype.numpy as onp 3 | 4 | __all__ = ["pade"] 5 | 6 | def pade(an: onp.ToComplex1D, m: onp.ToJustInt, n: onp.ToJustInt | None = None) -> tuple[np.poly1d, np.poly1d]: ... 7 | -------------------------------------------------------------------------------- /scipy-stubs/interpolate/_rbf.pyi: -------------------------------------------------------------------------------- 1 | from collections.abc import Callable 2 | from typing import Literal, TypeAlias 3 | 4 | import numpy as np 5 | import optype.numpy as onp 6 | 7 | __all__ = ["Rbf"] 8 | 9 | _Mode: TypeAlias = Literal["1-D", "N-D"] 10 | _Function: TypeAlias = ( 11 | Literal["multiquadric", "inverse", "gaussian", "linear", "cubic", "quintic", "thin_plate"] 12 | | Callable[[Rbf, float], onp.ToFloat] 13 | ) 14 | 15 | ### 16 | 17 | # legacy 18 | class Rbf: 19 | N: int 20 | di: onp.Array1D[np.float64] 21 | xi: onp.Array2D[np.float64] 22 | function: _Function 23 | epsilon: float 24 | smooth: float 25 | norm: str | Callable[..., onp.ToFloat2D] 26 | mode: _Mode 27 | nodes: onp.Array1D[np.float64] 28 | 29 | @property 30 | def A(self, /) -> onp.Array2D[np.float64]: ... # undocumented 31 | 32 | # 33 | def __init__( 34 | self, 35 | /, 36 | *args: onp.ToFloat1D, 37 | function: _Function = ..., 38 | epsilon: onp.ToFloat = ..., 39 | smooth: onp.ToFloat = ..., 40 | norm: str | Callable[..., onp.ToFloat2D] = ..., 41 | mode: _Mode = ..., 42 | ) -> None: ... 43 | def __call__(self, /, *args: onp.ToFloat | onp.ToFloatND) -> onp.ArrayND[np.float64]: ... 44 | -------------------------------------------------------------------------------- /scipy-stubs/interpolate/_rbfinterp_pythran.pyi: -------------------------------------------------------------------------------- 1 | __pythran__: tuple[str, str] 2 | -------------------------------------------------------------------------------- /scipy-stubs/interpolate/dfitpack.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | from typing import Any, Final, Protocol, type_check_only 4 | from typing_extensions import deprecated 5 | 6 | __all__ = ["spalde", "splder", "splev", "splint", "sproot"] 7 | 8 | ### 9 | 10 | @type_check_only 11 | class _DeprecatedFortranFunction(Protocol): 12 | __name__: str 13 | 14 | @deprecated( 15 | "The `scipy.interpolate.dfitpack` namespace is deprecated and will be removed in SciPy 2.0.0. " 16 | "Please use the `scipy.interpolate` namespace instead." 17 | ) 18 | def __call__(self, /, *args: object, **kwds: object) -> Any: ... # noqa: ANN401 19 | 20 | ### 21 | 22 | spalde: Final[_DeprecatedFortranFunction] = ... 23 | splder: Final[_DeprecatedFortranFunction] = ... 24 | splev: Final[_DeprecatedFortranFunction] = ... 25 | splint: Final[_DeprecatedFortranFunction] = ... 26 | sproot: Final[_DeprecatedFortranFunction] = ... 27 | -------------------------------------------------------------------------------- /scipy-stubs/interpolate/ndgriddata.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | from typing_extensions import deprecated 4 | 5 | from . import _interpnd, _ndgriddata 6 | 7 | __all__ = ["CloughTocher2DInterpolator", "LinearNDInterpolator", "NearestNDInterpolator", "griddata"] 8 | 9 | # interpnd 10 | 11 | @deprecated("will be removed in SciPy v2.0.0") 12 | class LinearNDInterpolator(_interpnd.LinearNDInterpolator): ... 13 | 14 | # _ndgriddata 15 | 16 | @deprecated("will be removed in SciPy v2.0.0") 17 | class CloughTocher2DInterpolator(_ndgriddata.CloughTocher2DInterpolator): ... 18 | 19 | @deprecated("will be removed in SciPy v2.0.0") 20 | class NearestNDInterpolator(_ndgriddata.NearestNDInterpolator): ... 21 | 22 | @deprecated("will be removed in SciPy v2.0.0") 23 | def griddata( 24 | points: object, values: object, xi: object, method: object = ..., fill_value: float = ..., rescale: object = ... 25 | ) -> object: ... 26 | -------------------------------------------------------------------------------- /scipy-stubs/interpolate/polyint.pyi: -------------------------------------------------------------------------------- 1 | # ruff: noqa: ANN401 2 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 3 | 4 | from typing import Any 5 | from typing_extensions import deprecated 6 | 7 | from . import _polyint 8 | 9 | __all__ = [ 10 | "BarycentricInterpolator", 11 | "KroghInterpolator", 12 | "approximate_taylor_polynomial", 13 | "barycentric_interpolate", 14 | "krogh_interpolate", 15 | ] 16 | 17 | @deprecated("will be removed in SciPy v2.0.0") 18 | class KroghInterpolator(_polyint.KroghInterpolator): ... 19 | 20 | @deprecated("will be removed in SciPy v2.0.0") 21 | class BarycentricInterpolator(_polyint.BarycentricInterpolator): ... 22 | 23 | @deprecated("will be removed in SciPy v2.0.0") 24 | def krogh_interpolate(xi: object, yi: object, x: object, der: object = ..., axis: object = ...) -> Any: ... 25 | @deprecated("will be removed in SciPy v2.0.0") 26 | def approximate_taylor_polynomial(f: object, x: object, degree: object, scale: object, order: object = ...) -> Any: ... 27 | @deprecated("will be removed in SciPy v2.0.0") 28 | def barycentric_interpolate(xi: object, yi: object, x: object, axis: int = 0, *, der: object = 0, rng: object = None) -> Any: ... 29 | -------------------------------------------------------------------------------- /scipy-stubs/interpolate/rbf.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | from typing_extensions import deprecated 3 | 4 | from . import _rbf 5 | 6 | __all__ = ["Rbf"] 7 | 8 | @deprecated("will be removed in SciPy v2.0.0") 9 | class Rbf(_rbf.Rbf): ... 10 | -------------------------------------------------------------------------------- /scipy-stubs/io/__init__.pyi: -------------------------------------------------------------------------------- 1 | from . import arff, harwell_boeing, idl, matlab, mmio, netcdf, wavfile 2 | from ._fast_matrix_market import mminfo, mmread, mmwrite 3 | from ._fortran import FortranEOFError, FortranFile, FortranFormattingError 4 | from ._harwell_boeing import hb_read, hb_write 5 | from ._idl import readsav 6 | from ._netcdf import netcdf_file, netcdf_variable 7 | from .matlab import loadmat, savemat, whosmat 8 | 9 | __all__ = [ 10 | "FortranEOFError", 11 | "FortranFile", 12 | "FortranFormattingError", 13 | "arff", 14 | "harwell_boeing", 15 | "hb_read", 16 | "hb_write", 17 | "idl", 18 | "loadmat", 19 | "matlab", 20 | "mminfo", 21 | "mmio", 22 | "mmread", 23 | "mmwrite", 24 | "netcdf", 25 | "netcdf_file", 26 | "netcdf_variable", 27 | "readsav", 28 | "savemat", 29 | "wavfile", 30 | "whosmat", 31 | ] 32 | -------------------------------------------------------------------------------- /scipy-stubs/io/_fortran.pyi: -------------------------------------------------------------------------------- 1 | from typing import TypedDict, final, overload, type_check_only 2 | from typing_extensions import Unpack 3 | 4 | import numpy as np 5 | import numpy.typing as npt 6 | import optype.numpy as onp 7 | import optype.numpy.compat as npc 8 | 9 | from scipy._typing import EnterSelfMixin, FileLike, FileModeRW 10 | 11 | __all__ = ["FortranEOFError", "FortranFile", "FortranFormattingError"] 12 | 13 | @final 14 | @type_check_only 15 | class _DTypeKwargs(TypedDict, total=False): 16 | dtype: npt.DTypeLike 17 | 18 | class FortranEOFError(TypeError, OSError): ... 19 | class FortranFormattingError(TypeError, OSError): ... 20 | 21 | class FortranFile(EnterSelfMixin): 22 | def __init__(self, /, filename: FileLike[bytes], mode: FileModeRW = "r", header_dtype: npt.DTypeLike = ...) -> None: ... 23 | def close(self, /) -> None: ... 24 | def write_record(self, /, *items: onp.ToArrayND) -> None: ... 25 | @overload 26 | def read_record(self, /, *dtypes: npt.DTypeLike) -> onp.Array1D[np.void]: ... 27 | @overload 28 | def read_record(self, /, *dtypes: npt.DTypeLike, **kwargs: Unpack[_DTypeKwargs]) -> onp.Array1D[np.void]: ... 29 | @overload 30 | def read_ints(self, /) -> onp.Array1D[np.int32]: ... 31 | @overload 32 | def read_ints(self, /, dtype: onp.AnyIntegerDType) -> onp.Array1D[npc.integer]: ... 33 | @overload 34 | def read_ints(self, /, dtype: npt.DTypeLike) -> onp.Array1D: ... 35 | @overload 36 | def read_reals(self, /) -> onp.Array1D[np.float64]: ... 37 | @overload 38 | def read_reals(self, /, dtype: onp.AnyFloatingDType) -> onp.Array1D[npc.floating]: ... 39 | @overload 40 | def read_reals(self, /, dtype: npt.DTypeLike) -> onp.Array1D: ... 41 | -------------------------------------------------------------------------------- /scipy-stubs/io/_harwell_boeing/__init__.pyi: -------------------------------------------------------------------------------- 1 | __all__ = ["hb_read", "hb_write"] 2 | 3 | from .hb import hb_read, hb_write 4 | -------------------------------------------------------------------------------- /scipy-stubs/io/_idl.pyi: -------------------------------------------------------------------------------- 1 | from os import PathLike 2 | from typing import Final, Generic 3 | from typing_extensions import TypeVar 4 | 5 | __all__ = ["readsav"] 6 | 7 | _VT = TypeVar("_VT", default=object) 8 | 9 | ### 10 | 11 | DTYPE_DICT: Final[dict[int, str]] = ... 12 | RECTYPE_DICT: Final[dict[int, str]] = ... 13 | STRUCT_DICT: Final[dict[str, dict[str, object]]] = ... 14 | 15 | class Pointer: 16 | index: int 17 | def __init__(self, /, index: int) -> None: ... 18 | 19 | class ObjectPointer(Pointer): ... 20 | 21 | class AttrDict(dict[str, _VT], Generic[_VT]): 22 | def __init__(self, /, init: dict[str, object] | None = None) -> None: ... 23 | def __call__(self, /, name: str) -> object: ... 24 | 25 | def readsav( 26 | file_name: str | bytes | PathLike[str] | PathLike[bytes], 27 | idict: dict[str, object] | None = None, 28 | python_dict: bool = False, 29 | uncompressed_file_name: str | None = None, 30 | verbose: bool = False, 31 | ) -> AttrDict[object] | dict[str, object]: ... 32 | -------------------------------------------------------------------------------- /scipy-stubs/io/arff/__init__.pyi: -------------------------------------------------------------------------------- 1 | from . import arffread 2 | from ._arffread import ArffError, MetaData, ParseArffError, loadarff 3 | 4 | __all__ = ["ArffError", "MetaData", "ParseArffError", "arffread", "loadarff"] 5 | -------------------------------------------------------------------------------- /scipy-stubs/io/arff/arffread.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | from typing import Final 4 | from typing_extensions import deprecated 5 | 6 | from ._arffread import MetaData as _MetaData 7 | 8 | __all__ = ["ArffError", "MetaData", "ParseArffError", "loadarff"] 9 | 10 | _msg: Final = "will be removed in SciPy v2.0.0" 11 | 12 | @deprecated(_msg) 13 | class ArffError(OSError): ... 14 | 15 | @deprecated(_msg) 16 | class ParseArffError(ArffError): ... # pyright: ignore[reportDeprecated] 17 | 18 | @deprecated(_msg) 19 | class MetaData(_MetaData): ... 20 | 21 | @deprecated(_msg) 22 | def loadarff(f: object) -> object: ... 23 | -------------------------------------------------------------------------------- /scipy-stubs/io/harwell_boeing.pyi: -------------------------------------------------------------------------------- 1 | # ruff: noqa: ANN401 2 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 3 | 4 | from typing import Any 5 | from typing_extensions import deprecated 6 | 7 | __all__ = ["hb_read", "hb_write"] 8 | 9 | @deprecated("will be removed in SciPy v2.0.0") 10 | def hb_read(path_or_open_file: object, *, spmatrix: bool = True) -> Any: ... 11 | @deprecated("will be removed in SciPy v2.0.0") 12 | def hb_write(path_or_open_file: object, m: object, hb_info: object = ...) -> Any: ... 13 | -------------------------------------------------------------------------------- /scipy-stubs/io/idl.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | from typing_extensions import deprecated 3 | 4 | __all__ = ["readsav"] 5 | 6 | @deprecated("will be removed in SciPy v2.0.0") 7 | def readsav( 8 | file_name: object, idict: object = ..., python_dict: object = ..., uncompressed_file_name: object = ..., verbose: object = ... 9 | ) -> object: ... 10 | -------------------------------------------------------------------------------- /scipy-stubs/io/matlab/__init__.pyi: -------------------------------------------------------------------------------- 1 | # Deprecated namespaces, to be removed in v2.0.0 2 | from . import ( 3 | byteordercodes as byteordercodes, 4 | mio as mio, 5 | mio4 as mio4, 6 | mio5 as mio5, 7 | mio5_params as mio5_params, 8 | mio5_utils as mio5_utils, 9 | mio_utils as mio_utils, 10 | miobase as miobase, 11 | streams as streams, 12 | ) 13 | from ._mio import loadmat, savemat, whosmat 14 | from ._mio5 import varmats_from_mat 15 | from ._mio5_params import MatlabFunction, MatlabObject, MatlabOpaque, mat_struct 16 | from ._miobase import MatReadError, MatReadWarning, MatWriteError, MatWriteWarning, matfile_version 17 | 18 | __all__ = [ 19 | "MatReadError", 20 | "MatReadWarning", 21 | "MatWriteError", 22 | "MatWriteWarning", 23 | "MatlabFunction", 24 | "MatlabObject", 25 | "MatlabOpaque", 26 | "loadmat", 27 | "mat_struct", 28 | "matfile_version", 29 | "savemat", 30 | "varmats_from_mat", 31 | "whosmat", 32 | ] 33 | -------------------------------------------------------------------------------- /scipy-stubs/io/matlab/_byteordercodes.pyi: -------------------------------------------------------------------------------- 1 | __all__ = ["aliases", "native_code", "swapped_code", "sys_is_le", "to_numpy_code"] 2 | 3 | from typing import Final, Literal 4 | 5 | sys_is_le: Final[bool] = ... 6 | native_code: Final[Literal["<", ">"]] = ... 7 | swapped_code: Final[Literal["<", ">"]] = ... 8 | aliases: dict[str, tuple[str, ...]] 9 | 10 | def to_numpy_code(code: str) -> Literal["<", ">", "="]: ... 11 | -------------------------------------------------------------------------------- /scipy-stubs/io/matlab/byteordercodes.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | __all__: list[str] = [] 4 | -------------------------------------------------------------------------------- /scipy-stubs/io/matlab/mio.pyi: -------------------------------------------------------------------------------- 1 | # ruff: noqa: ANN401 2 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 3 | 4 | from typing import Any 5 | from typing_extensions import deprecated 6 | 7 | __all__ = ["loadmat", "savemat", "whosmat"] 8 | 9 | @deprecated("will be removed in SciPy v2.0.0") 10 | def loadmat( 11 | file_name: object, mdict: object = ..., appendmat: object = ..., *, spmatrix: bool = True, **kwargs: object 12 | ) -> Any: ... 13 | @deprecated("will be removed in SciPy v2.0.0") 14 | def savemat( 15 | file_name: object, 16 | mdict: object, 17 | appendmat: object = ..., 18 | format: object = ..., 19 | long_field_names: object = ..., 20 | do_compression: object = ..., 21 | oned_as: object = ..., 22 | ) -> None: ... 23 | @deprecated("will be removed in SciPy v2.0.0") 24 | def whosmat(file_name: object, appendmat: object = ..., **kwargs: object) -> Any: ... 25 | -------------------------------------------------------------------------------- /scipy-stubs/io/matlab/mio4.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | __all__: list[str] = [] 4 | -------------------------------------------------------------------------------- /scipy-stubs/io/matlab/mio5.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | from typing import Self 4 | from typing_extensions import deprecated 5 | 6 | import numpy as np 7 | 8 | __all__ = ["MatReadError", "MatReadWarning", "MatWriteError", "MatlabFunction", "MatlabObject", "mat_struct", "varmats_from_mat"] 9 | 10 | @deprecated("will be removed in SciPy v2.0.0") 11 | class MatReadError(Exception): ... 12 | 13 | @deprecated("will be removed in SciPy v2.0.0") 14 | class MatWriteError(Exception): ... 15 | 16 | @deprecated("will be removed in SciPy v2.0.0") 17 | class MatReadWarning(UserWarning): ... 18 | 19 | @deprecated("will be removed in SciPy v2.0.0") 20 | class MatlabObject(np.ndarray[tuple[int, ...], np.dtype[np.generic]]): 21 | def __new__(cls, input_array: object, classname: object = ...) -> Self: ... 22 | 23 | @deprecated("will be removed in SciPy v2.0.0") 24 | class MatlabFunction(MatlabObject): # pyright: ignore[reportDeprecated] 25 | def __new__(cls, input_array: object) -> Self: ... 26 | 27 | @deprecated("will be removed in SciPy v2.0.0") 28 | class mat_struct: ... 29 | 30 | @deprecated("will be removed in SciPy v2.0.0") 31 | def varmats_from_mat(file_obj: object) -> object: ... 32 | -------------------------------------------------------------------------------- /scipy-stubs/io/matlab/mio5_params.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | from typing import Self 4 | from typing_extensions import deprecated 5 | 6 | __all__ = ["MatlabFunction", "MatlabObject", "MatlabOpaque", "mat_struct"] 7 | 8 | @deprecated("will be removed in SciPy v2.0.0") 9 | class MatlabFunction: 10 | def __new__(cls, input_array: object) -> Self: ... 11 | 12 | @deprecated("will be removed in SciPy v2.0.0") 13 | class MatlabObject: 14 | def __new__(cls, input_array: object, classname: object = ...) -> Self: ... 15 | def __array_finalize__(self, /, obj: Self) -> None: ... 16 | 17 | @deprecated("will be removed in SciPy v2.0.0") 18 | class MatlabOpaque: 19 | def __new__(cls, input_array: object) -> Self: ... 20 | 21 | @deprecated("will be removed in SciPy v2.0.0") 22 | class mat_struct: ... 23 | -------------------------------------------------------------------------------- /scipy-stubs/io/matlab/mio5_utils.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | __all__: list[str] = [] 4 | -------------------------------------------------------------------------------- /scipy-stubs/io/matlab/mio_utils.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | __all__: list[str] = [] 4 | -------------------------------------------------------------------------------- /scipy-stubs/io/matlab/miobase.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | from typing_extensions import deprecated 4 | 5 | __all__ = ["MatReadError", "MatReadWarning", "MatWriteError"] 6 | 7 | @deprecated("will be removed in SciPy v2.0.0") 8 | class MatReadError(Exception): ... 9 | 10 | @deprecated("will be removed in SciPy v2.0.0") 11 | class MatWriteError(Exception): ... 12 | 13 | @deprecated("will be removed in SciPy v2.0.0") 14 | class MatReadWarning(UserWarning): ... 15 | -------------------------------------------------------------------------------- /scipy-stubs/io/matlab/streams.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | __all__: list[str] = [] 4 | -------------------------------------------------------------------------------- /scipy-stubs/io/mmio.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | from typing_extensions import deprecated 3 | 4 | __all__ = ["mminfo", "mmread", "mmwrite"] 5 | 6 | @deprecated("will be removed in SciPy v2.0.0") 7 | def mminfo(source: object) -> object: ... 8 | @deprecated("will be removed in SciPy v2.0.0") 9 | def mmread(source: object, *, spmatrix: bool = True) -> object: ... 10 | @deprecated("will be removed in SciPy v2.0.0") 11 | def mmwrite( 12 | target: object, a: object, comment: object = ..., field: object = ..., precision: object = ..., symmetry: object = ... 13 | ) -> None: ... 14 | -------------------------------------------------------------------------------- /scipy-stubs/io/netcdf.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | from typing_extensions import deprecated 3 | 4 | from ._netcdf import netcdf_file as _netcdf_file, netcdf_variable as _netcdf_variable 5 | 6 | __all__ = ["netcdf_file", "netcdf_variable"] 7 | 8 | @deprecated("will be removed in SciPy v2.0.0") 9 | class netcdf_file(_netcdf_file): ... 10 | 11 | @deprecated("will be removed in SciPy v2.0.0") 12 | class netcdf_variable(_netcdf_variable): ... 13 | -------------------------------------------------------------------------------- /scipy-stubs/linalg/_cythonized_array_utils.pyi: -------------------------------------------------------------------------------- 1 | from typing import TypeAlias 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | __all__ = ["bandwidth", "ishermitian", "issymmetric"] 7 | 8 | # see `scipy/linalg/_cythonized_array_utils.pxd` 9 | _Numeric: TypeAlias = ( 10 | np.int8 11 | | np.int16 12 | | np.int32 13 | | np.int64 14 | | np.uint8 15 | | np.uint16 16 | | np.uint32 17 | | np.uint64 18 | | np.float32 19 | | np.float64 20 | | np.longdouble 21 | | np.complex64 22 | | np.complex128 23 | ) 24 | 25 | def bandwidth(a: onp.ArrayND[_Numeric]) -> tuple[int, int]: ... 26 | def issymmetric(a: onp.ArrayND[_Numeric], atol: float | None = None, rtol: float | None = None) -> bool: ... 27 | def ishermitian(a: onp.ArrayND[_Numeric], atol: float | None = None, rtol: float | None = None) -> bool: ... 28 | -------------------------------------------------------------------------------- /scipy-stubs/linalg/_decomp_lu_cython.pyi: -------------------------------------------------------------------------------- 1 | # NOTE: keep in sync with scipy/stubs/linalg/_decomp_lu_cython.pyi 2 | 3 | from typing import TypeVar 4 | 5 | import numpy as np 6 | import numpy.typing as npt 7 | 8 | # this mimicks the `ctypedef fused lapack_t` 9 | _LapackT = TypeVar("_LapackT", np.float32, np.float64, np.complex64, np.complex128) 10 | 11 | def lu_dispatcher(a: npt.NDArray[_LapackT], u: npt.NDArray[_LapackT], piv: npt.NDArray[np.integer], permute_l: bool) -> None: ... 12 | -------------------------------------------------------------------------------- /scipy-stubs/linalg/_decomp_polar.pyi: -------------------------------------------------------------------------------- 1 | from typing import Literal, TypeAlias, TypeVar, overload 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | import optype.numpy.compat as npc 6 | 7 | __all__ = ["polar"] 8 | 9 | _T = TypeVar("_T") 10 | _Tuple2: TypeAlias = tuple[_T, _T] 11 | _Side: TypeAlias = Literal["left", "right"] 12 | 13 | ### 14 | 15 | @overload 16 | def polar(a: onp.ToIntStrict2D | onp.ToJustFloat64Strict2D, side: _Side = "right") -> _Tuple2[onp.Array2D[np.float64]]: ... 17 | @overload 18 | def polar(a: onp.ToIntND | onp.ToJustFloat64_ND, side: _Side = "right") -> _Tuple2[onp.ArrayND[np.float64]]: ... 19 | @overload 20 | def polar(a: onp.ToFloatStrict2D, side: _Side = "right") -> _Tuple2[onp.Array2D[npc.floating]]: ... 21 | @overload 22 | def polar(a: onp.ToFloatND, side: _Side = "right") -> _Tuple2[onp.ArrayND[npc.floating]]: ... 23 | @overload 24 | def polar(a: onp.ToJustComplexStrict2D, side: _Side = "right") -> _Tuple2[onp.Array2D[npc.complexfloating]]: ... 25 | @overload 26 | def polar(a: onp.ToJustComplexND, side: _Side = "right") -> _Tuple2[onp.ArrayND[npc.complexfloating]]: ... 27 | @overload 28 | def polar(a: onp.ToComplexND, side: _Side = "right") -> _Tuple2[onp.ArrayND[npc.inexact]]: ... 29 | -------------------------------------------------------------------------------- /scipy-stubs/linalg/_expm_frechet.pyi: -------------------------------------------------------------------------------- 1 | from typing import Literal, TypeAlias, overload 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | from scipy._typing import Falsy, Truthy 7 | 8 | __all__ = ["expm_cond", "expm_frechet"] 9 | 10 | _Method: TypeAlias = Literal["SPS", "blockEnlarge"] 11 | _ArrayF64: TypeAlias = onp.ArrayND[np.float64] 12 | _ArrayC128: TypeAlias = onp.ArrayND[np.complex128] 13 | 14 | ### 15 | 16 | @overload 17 | def expm_frechet( 18 | A: onp.ToComplexND, E: onp.ToComplexND, method: _Method | None = None, compute_expm: Truthy = True, check_finite: bool = True 19 | ) -> tuple[_ArrayF64, _ArrayF64] | tuple[_ArrayF64 | _ArrayC128, _ArrayC128]: ... 20 | @overload 21 | def expm_frechet( 22 | A: onp.ToComplexND, E: onp.ToComplexND, method: _Method | None, compute_expm: Falsy, check_finite: bool = True 23 | ) -> tuple[_ArrayF64, _ArrayF64] | tuple[_ArrayF64 | _ArrayC128, _ArrayC128]: ... 24 | @overload 25 | def expm_frechet( 26 | A: onp.ToComplexND, E: onp.ToComplexND, method: _Method | None = None, *, compute_expm: Falsy, check_finite: bool = True 27 | ) -> tuple[_ArrayF64, _ArrayF64] | tuple[_ArrayF64 | _ArrayC128, _ArrayC128]: ... 28 | 29 | # 30 | @overload 31 | def expm_cond(A: onp.ToComplexStrict2D, check_finite: bool = True) -> np.float64: ... 32 | @overload 33 | def expm_cond(A: onp.ToComplexStrict3D, check_finite: bool = True) -> onp.Array1D[np.float64]: ... 34 | @overload 35 | def expm_cond(A: onp.ToComplexND, check_finite: bool = True) -> np.float64 | onp.ArrayND[np.float64]: ... 36 | -------------------------------------------------------------------------------- /scipy-stubs/linalg/_matfuncs_expm.pyi: -------------------------------------------------------------------------------- 1 | from typing import TypeAlias 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | _InexactND: TypeAlias = onp.ArrayND[np.float32 | np.float64 | np.complex64 | np.complex128] 7 | 8 | ### 9 | 10 | class error(Exception): ... # undocumented 11 | 12 | # `Am` must have a shape like `(5, n, n)`. 13 | def pick_pade_structure(Am: _InexactND) -> tuple[int, int]: ... 14 | def pade_UV_calc(Am: _InexactND, n: int) -> int: ... 15 | -------------------------------------------------------------------------------- /scipy-stubs/linalg/_matfuncs_inv_ssq.pyi: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | class LogmRankWarning(UserWarning): ... 4 | class LogmExactlySingularWarning(LogmRankWarning): ... 5 | class LogmNearlySingularWarning(LogmRankWarning): ... 6 | class LogmError(np.linalg.LinAlgError): ... 7 | class FractionalMatrixPowerError(np.linalg.LinAlgError): ... 8 | -------------------------------------------------------------------------------- /scipy-stubs/linalg/_matfuncs_sqrtm.pyi: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import optype.numpy as onp 3 | 4 | __all__: list[str] = [] 5 | 6 | class SqrtmError(np.linalg.LinAlgError): ... # undocumented 7 | 8 | def _sqrtm_triu(T: onp.ToComplex2D, blocksize: onp.ToJustInt = 64) -> onp.Array2D[np.float64 | np.complex128]: ... # undocumented 9 | -------------------------------------------------------------------------------- /scipy-stubs/linalg/_matfuncs_sqrtm_triu.pyi: -------------------------------------------------------------------------------- 1 | from collections.abc import Iterable 2 | from typing import overload 3 | 4 | import numpy as np 5 | import optype.numpy as onp 6 | 7 | @overload 8 | def within_block_loop( 9 | R: onp.ArrayND[np.float64], T: onp.ArrayND[np.float64], start_stop_pairs: Iterable[tuple[int, int]], nblocks: int | np.intp 10 | ) -> None: ... 11 | @overload 12 | def within_block_loop( 13 | R: onp.ArrayND[np.complex128], 14 | T: onp.ArrayND[np.complex128], 15 | start_stop_pairs: Iterable[tuple[int, int]], 16 | nblocks: int | np.intp, 17 | ) -> None: ... 18 | -------------------------------------------------------------------------------- /scipy-stubs/linalg/_sketches.pyi: -------------------------------------------------------------------------------- 1 | from typing import overload 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | from scipy._typing import ToRNG 7 | from scipy.sparse import csc_matrix 8 | 9 | __all__ = ["clarkson_woodruff_transform"] 10 | 11 | ### 12 | 13 | def cwt_matrix(n_rows: onp.ToInt, n_columns: onp.ToInt, rng: ToRNG = None) -> csc_matrix[np.int_]: ... 14 | 15 | # 16 | @overload 17 | def clarkson_woodruff_transform(input_matrix: onp.ToIntND, sketch_size: onp.ToInt, rng: ToRNG = None) -> onp.ArrayND[np.int_]: ... 18 | @overload 19 | def clarkson_woodruff_transform( 20 | input_matrix: onp.ToJustFloat64_ND, sketch_size: onp.ToInt, rng: ToRNG = None 21 | ) -> onp.ArrayND[np.float64]: ... 22 | @overload 23 | def clarkson_woodruff_transform( 24 | input_matrix: onp.ToJustFloatND, sketch_size: onp.ToInt, rng: ToRNG = None 25 | ) -> onp.ArrayND[np.float64 | np.longdouble]: ... 26 | @overload 27 | def clarkson_woodruff_transform( 28 | input_matrix: onp.ToJustComplex128_ND, sketch_size: onp.ToInt, rng: ToRNG = None 29 | ) -> onp.ArrayND[np.complex128]: ... 30 | @overload 31 | def clarkson_woodruff_transform( 32 | input_matrix: onp.ToJustComplexND, sketch_size: onp.ToInt, rng: ToRNG = None 33 | ) -> onp.ArrayND[np.complex128 | np.clongdouble]: ... 34 | -------------------------------------------------------------------------------- /scipy-stubs/linalg/_solve_toeplitz.pyi: -------------------------------------------------------------------------------- 1 | # see scipy/linalg/_solve_toeplitz.pyx 2 | 3 | from typing import TypeVar 4 | 5 | import numpy as np 6 | import optype.numpy as onp 7 | 8 | _dz = TypeVar("_dz", np.float64, np.complex128) # static-typing analogue of the `cdef fused dz: ...` 9 | 10 | def levinson( 11 | a: onp.ArrayND[_dz], # shape: (2n - 1,) 12 | b: onp.ArrayND[_dz], # shape: (n,) 13 | ) -> tuple[onp.Array1D[_dz], onp.Array1D[_dz]]: ... # undocumented 14 | -------------------------------------------------------------------------------- /scipy-stubs/linalg/decomp_cholesky.pyi: -------------------------------------------------------------------------------- 1 | # This file is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | from typing_extensions import deprecated 4 | 5 | import numpy as np 6 | 7 | __all__ = ["LinAlgError", "cho_factor", "cho_solve", "cho_solve_banded", "cholesky", "cholesky_banded", "get_lapack_funcs"] 8 | 9 | @deprecated("will be removed in SciPy v2.0.0") 10 | class LinAlgError(np.linalg.LinAlgError): ... 11 | 12 | @deprecated("will be removed in SciPy v2.0.0") 13 | def get_lapack_funcs(names: object, arrays: object = ..., dtype: object = ..., ilp64: object = ...) -> object: ... 14 | @deprecated("will be removed in SciPy v2.0.0") 15 | def cholesky(a: object, lower: object = ..., overwrite_a: object = ..., check_finite: object = ...) -> object: ... 16 | @deprecated("will be removed in SciPy v2.0.0") 17 | def cho_factor(a: object, lower: object = ..., overwrite_a: object = ..., check_finite: object = ...) -> object: ... 18 | @deprecated("will be removed in SciPy v2.0.0") 19 | def cho_solve(c_and_lower: object, b: object, overwrite_b: object = ..., check_finite: object = ...) -> object: ... 20 | @deprecated("will be removed in SciPy v2.0.0") 21 | def cholesky_banded(ab: object, overwrite_ab: object = ..., lower: object = ..., check_finite: object = ...) -> object: ... 22 | @deprecated("will be removed in SciPy v2.0.0") 23 | def cho_solve_banded(cb_and_lower: object, b: object, overwrite_b: object = ..., check_finite: object = ...) -> object: ... 24 | -------------------------------------------------------------------------------- /scipy-stubs/linalg/decomp_lu.pyi: -------------------------------------------------------------------------------- 1 | # This file is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | from typing_extensions import deprecated 4 | 5 | from ._misc import LinAlgWarning as _LinAlgWarning 6 | 7 | __all__ = ["LinAlgWarning", "get_lapack_funcs", "lu", "lu_factor", "lu_solve"] 8 | 9 | @deprecated("will be removed in SciPy v2.0.0") 10 | class LinAlgWarning(_LinAlgWarning): ... 11 | 12 | @deprecated("will be removed in SciPy v2.0.0") 13 | def get_lapack_funcs(names: object, arrays: object = ..., dtype: object = ..., ilp64: object = ...) -> object: ... 14 | @deprecated("will be removed in SciPy v2.0.0") 15 | def lu( 16 | a: object, permute_l: object = ..., overwrite_a: object = ..., check_finite: object = ..., p_indices: object = ... 17 | ) -> object: ... 18 | @deprecated("will be removed in SciPy v2.0.0") 19 | def lu_factor(a: object, overwrite_a: object = ..., check_finite: object = ...) -> object: ... 20 | @deprecated("will be removed in SciPy v2.0.0") 21 | def lu_solve( 22 | lu_and_piv: object, b: object, trans: object = ..., overwrite_b: object = ..., check_finite: object = ... 23 | ) -> object: ... 24 | -------------------------------------------------------------------------------- /scipy-stubs/linalg/decomp_qr.pyi: -------------------------------------------------------------------------------- 1 | # This file is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | from typing_extensions import deprecated 4 | 5 | __all__ = ["get_lapack_funcs", "qr", "qr_multiply", "rq"] 6 | 7 | @deprecated("will be removed in SciPy v2.0.0") 8 | def get_lapack_funcs(names: object, arrays: object = ..., dtype: object = ..., ilp64: object = ...) -> object: ... 9 | @deprecated("will be removed in SciPy v2.0.0") 10 | def qr( 11 | a: object, 12 | overwrite_a: object = ..., 13 | lwork: object = ..., 14 | mode: object = ..., 15 | pivoting: object = ..., 16 | check_finite: object = ..., 17 | ) -> object: ... 18 | @deprecated("will be removed in SciPy v2.0.0") 19 | def qr_multiply( 20 | a: object, 21 | c: object, 22 | mode: object = ..., 23 | pivoting: object = ..., 24 | conjugate: object = ..., 25 | overwrite_a: object = ..., 26 | overwrite_c: object = ..., 27 | ) -> object: ... 28 | @deprecated("will be removed in SciPy v2.0.0") 29 | def rq(a: object, overwrite_a: object = ..., lwork: object = ..., mode: object = ..., check_finite: object = ...) -> object: ... 30 | -------------------------------------------------------------------------------- /scipy-stubs/linalg/decomp_schur.pyi: -------------------------------------------------------------------------------- 1 | # This file is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | from typing_extensions import deprecated 4 | 5 | import numpy as np 6 | 7 | __all__ = ["LinAlgError", "eigvals", "get_lapack_funcs", "norm", "rsf2csf", "schur"] 8 | 9 | @deprecated("will be removed in SciPy v2.0.0") 10 | class LinAlgError(np.linalg.LinAlgError): ... 11 | 12 | @deprecated("will be removed in SciPy v2.0.0") 13 | def get_lapack_funcs(names: object, arrays: object = ..., dtype: object = ..., ilp64: object = ...) -> object: ... 14 | @deprecated("will be removed in SciPy v2.0.0") 15 | def eigvals( 16 | a: object, b: object = ..., overwrite_a: object = ..., check_finite: object = ..., homogeneous_eigvals: object = ... 17 | ) -> object: ... 18 | @deprecated("will be removed in SciPy v2.0.0") 19 | def norm(x: object, ord: object = ..., axis: object = ..., keepdims: object = ...) -> object: ... 20 | @deprecated("will be removed in SciPy v2.0.0") 21 | def schur( 22 | a: object, 23 | output: object = ..., 24 | lwork: object = ..., 25 | overwrite_a: object = ..., 26 | sort: object = ..., 27 | check_finite: object = ..., 28 | ) -> object: ... 29 | @deprecated("will be removed in SciPy v2.0.0") 30 | def rsf2csf(T: object, Z: object, check_finite: object = ...) -> object: ... 31 | -------------------------------------------------------------------------------- /scipy-stubs/linalg/decomp_svd.pyi: -------------------------------------------------------------------------------- 1 | # This file is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | from typing_extensions import deprecated 4 | 5 | import numpy as np 6 | 7 | __all__ = ["LinAlgError", "diagsvd", "get_lapack_funcs", "null_space", "orth", "subspace_angles", "svd", "svdvals"] 8 | 9 | @deprecated("will be removed in SciPy v2.0.0") 10 | class LinAlgError(np.linalg.LinAlgError): ... 11 | 12 | @deprecated("will be removed in SciPy v2.0.0") 13 | def get_lapack_funcs(names: object, arrays: object = ..., dtype: object = ..., ilp64: object = ...) -> object: ... 14 | @deprecated("will be removed in SciPy v2.0.0") 15 | def diagsvd(s: object, M: object, N: object) -> object: ... 16 | @deprecated("will be removed in SciPy v2.0.0") 17 | def null_space( 18 | A: object, rcond: object = ..., *, overwrite_a: bool = False, check_finite: bool = True, lapack_driver: str = "gesdd" 19 | ) -> object: ... 20 | @deprecated("will be removed in SciPy v2.0.0") 21 | def orth(A: object, rcond: object = ...) -> object: ... 22 | @deprecated("will be removed in SciPy v2.0.0") 23 | def subspace_angles(A: object, B: object) -> object: ... 24 | @deprecated("will be removed in SciPy v2.0.0") 25 | def svd( 26 | a: object, 27 | full_matrices: object = ..., 28 | compute_uv: object = ..., 29 | overwrite_a: object = ..., 30 | check_finite: object = ..., 31 | lapack_driver: object = ..., 32 | ) -> object: ... 33 | @deprecated("will be removed in SciPy v2.0.0") 34 | def svdvals(a: object, overwrite_a: object = ..., check_finite: object = ...) -> object: ... 35 | -------------------------------------------------------------------------------- /scipy-stubs/linalg/misc.pyi: -------------------------------------------------------------------------------- 1 | # This file is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | from typing_extensions import deprecated 4 | 5 | __all__ = ["LinAlgError", "LinAlgWarning", "get_blas_funcs", "get_lapack_funcs", "norm"] 6 | 7 | @deprecated("will be removed in SciPy v2.0.0") 8 | class LinAlgError(Exception): ... 9 | 10 | @deprecated("will be removed in SciPy v2.0.0") 11 | class LinAlgWarning(RuntimeWarning): ... 12 | 13 | @deprecated("will be removed in SciPy v2.0.0") 14 | def get_lapack_funcs(names: object, arrays: object = ..., dtype: object = ..., ilp64: object = ...) -> object: ... 15 | @deprecated("will be removed in SciPy v2.0.0") 16 | def norm(a: object, ord: object = ..., axis: object = ..., keepdims: object = ..., check_finite: object = ...) -> object: ... 17 | @deprecated("will be removed in SciPy v2.0.0") 18 | def get_blas_funcs(names: object, arrays: object = ..., dtype: object = ..., ilp64: object = ...) -> object: ... 19 | -------------------------------------------------------------------------------- /scipy-stubs/misc/__init__.pyi: -------------------------------------------------------------------------------- 1 | # scipy.misc is deprecated and will be removed in 2.0.0 2 | -------------------------------------------------------------------------------- /scipy-stubs/misc/common.pyi: -------------------------------------------------------------------------------- 1 | # scipy.misc is deprecated and will be removed in 2.0.0 2 | -------------------------------------------------------------------------------- /scipy-stubs/misc/doccer.pyi: -------------------------------------------------------------------------------- 1 | # scipy.misc is deprecated and will be removed in 2.0.0 2 | -------------------------------------------------------------------------------- /scipy-stubs/ndimage/fourier.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | from typing_extensions import deprecated 3 | 4 | __all__ = ["fourier_ellipsoid", "fourier_gaussian", "fourier_shift", "fourier_uniform"] 5 | 6 | @deprecated("will be removed in SciPy v2.0.0") 7 | def fourier_gaussian(input: object, sigma: object, n: object = ..., axis: object = ..., output: object = ...) -> object: ... 8 | @deprecated("will be removed in SciPy v2.0.0") 9 | def fourier_uniform(input: object, size: object, n: object = ..., axis: object = ..., output: object = ...) -> object: ... 10 | @deprecated("will be removed in SciPy v2.0.0") 11 | def fourier_ellipsoid(input: object, size: object, n: object = ..., axis: object = ..., output: object = ...) -> object: ... 12 | @deprecated("will be removed in SciPy v2.0.0") 13 | def fourier_shift(input: object, shift: object, n: object = ..., axis: object = ..., output: object = ...) -> object: ... 14 | -------------------------------------------------------------------------------- /scipy-stubs/odr/__init__.pyi: -------------------------------------------------------------------------------- 1 | from . import models, odrpack 2 | from ._models import * 3 | from ._odrpack import * 4 | 5 | __all__ = [ 6 | "ODR", 7 | "Data", 8 | "Model", 9 | "OdrError", 10 | "OdrStop", 11 | "OdrWarning", 12 | "Output", 13 | "RealData", 14 | "exponential", 15 | "models", 16 | "multilinear", 17 | "odr", 18 | "odrpack", 19 | "polynomial", 20 | "quadratic", 21 | "unilinear", 22 | ] 23 | -------------------------------------------------------------------------------- /scipy-stubs/odr/_add_newdocs.pyi: -------------------------------------------------------------------------------- 1 | # nothin to see here 2 | -------------------------------------------------------------------------------- /scipy-stubs/odr/_models.pyi: -------------------------------------------------------------------------------- 1 | from typing import Final, type_check_only 2 | 3 | import optype.numpy as onp 4 | 5 | from ._odrpack import Model 6 | 7 | __all__ = ["Model", "exponential", "multilinear", "polynomial", "quadratic", "unilinear"] 8 | 9 | @type_check_only 10 | class _NamedModel(Model): 11 | name: Final[str] 12 | equ: Final[str] 13 | TeXequ: Final[str] 14 | 15 | @type_check_only 16 | class _SimpleModel(_NamedModel): 17 | def __init__(self, /) -> None: ... 18 | 19 | ### 20 | 21 | class _MultilinearModel(_SimpleModel): ... 22 | class _ExponentialModel(_SimpleModel): ... 23 | class _UnilinearModel(_SimpleModel): ... 24 | class _QuadraticModel(_SimpleModel): ... 25 | 26 | def polynomial(order: onp.ToInt | onp.ToInt1D) -> _NamedModel: ... 27 | 28 | multilinear: Final[_MultilinearModel] = ... 29 | exponential: Final[_ExponentialModel] = ... 30 | unilinear: Final[_UnilinearModel] = ... 31 | quadratic: Final[_QuadraticModel] = ... 32 | -------------------------------------------------------------------------------- /scipy-stubs/odr/models.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | from typing_extensions import deprecated 3 | 4 | from ._models import exponential, multilinear, quadratic, unilinear 5 | from ._odrpack import Model as _Model 6 | 7 | __all__ = ["Model", "exponential", "multilinear", "polynomial", "quadratic", "unilinear"] 8 | 9 | @deprecated("will be removed in SciPy v2.0.0") 10 | class Model(_Model): ... 11 | 12 | @deprecated("will be removed in SciPy v2.0.0") 13 | def polynomial(order: object) -> Model: ... # pyright: ignore[reportDeprecated] 14 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_bracket.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scipy/scipy-stubs/c8048cf7848b5fdbf88f5ebfa71d7450c20dd67d/scipy-stubs/optimize/_bracket.pyi -------------------------------------------------------------------------------- /scipy-stubs/optimize/_chandrupatla.pyi: -------------------------------------------------------------------------------- 1 | # nothing to see here 2 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_cobyla_py.pyi: -------------------------------------------------------------------------------- 1 | from collections.abc import Callable, Sequence 2 | from typing import Concatenate, Literal, TypeAlias 3 | 4 | import numpy as np 5 | import optype.numpy as onp 6 | 7 | __all__ = ["fmin_cobyla"] 8 | 9 | _Ignored: TypeAlias = object 10 | 11 | ### 12 | 13 | def fmin_cobyla( 14 | func: Callable[Concatenate[onp.Array1D[np.float64], ...], onp.ToFloat], 15 | x0: onp.ToArray1D, 16 | cons: Sequence[Callable[[onp.Array1D[np.float64]], onp.ToFloat | onp.ToFloat1D]], 17 | args: tuple[object, ...] = (), 18 | consargs: tuple[object, ...] | None = None, 19 | rhobeg: onp.ToFloat = 1.0, 20 | rhoend: onp.ToFloat = 0.0001, 21 | maxfun: onp.ToInt = 1000, 22 | disp: Literal[0, 1, 2, 3] | None = None, 23 | catol: onp.ToFloat = 0.0002, 24 | *, 25 | callback: Callable[[onp.Array1D[np.float64]], _Ignored] | None = None, 26 | ) -> onp.Array1D[np.float64]: ... 27 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_cobyqa_py.pyi: -------------------------------------------------------------------------------- 1 | import threading 2 | from typing import Final 3 | 4 | COBYQA_LOCK: Final[threading.Lock] = ... 5 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_dcsrch.pyi: -------------------------------------------------------------------------------- 1 | from collections.abc import Callable 2 | from typing import Final, TypeAlias 3 | 4 | import optype.numpy as onp 5 | 6 | _Fun: TypeAlias = Callable[[float], onp.ToFloat] 7 | 8 | ### 9 | 10 | class DCSRCH: 11 | phi: Final[_Fun] 12 | derphi: Final[_Fun] 13 | ftol: Final[float] 14 | gtol: Final[float] 15 | xtol: Final[float] 16 | stpmin: Final[float] 17 | stpmax: Final[float] 18 | 19 | stage: int | None 20 | ginit: float | None 21 | gtest: float | None 22 | gx: float | None 23 | gy: float | None 24 | finit: float | None 25 | fx: float | None 26 | fy: float | None 27 | stx: float | None 28 | sty: float | None 29 | stmin: float | None 30 | stmax: float | None 31 | width: float | None 32 | width1: float | None 33 | 34 | def __init__( 35 | self, /, phi: _Fun, derphi: _Fun, ftol: float, gtol: float, xtol: float, stpmin: float, stpmax: float 36 | ) -> None: ... 37 | def __call__( 38 | self, /, alpha1: float, phi0: float | None = None, derphi0: float | None = None, maxiter: int = 100 39 | ) -> tuple[float | None, float, float, bytes]: ... # alpha, phi(alpha), phi(0), task 40 | 41 | def dcstep( 42 | stx: float, 43 | fx: float, 44 | dx: float, 45 | sty: float, 46 | fy: float, 47 | dy: float, 48 | stp: float, 49 | fp: float, 50 | dp: float, 51 | brackt: bool, 52 | stpmin: float, 53 | stpmax: float, 54 | ) -> tuple[float, float, float, float, float, float, float, bool]: ... # stx, fx, dx, sty, fy, dy, stp, brackt 55 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_direct_py.pyi: -------------------------------------------------------------------------------- 1 | from collections.abc import Callable 2 | from typing import Concatenate 3 | 4 | import numpy as np 5 | import optype.numpy as onp 6 | 7 | from ._constraints import Bounds 8 | from ._optimize import OptimizeResult as _OptimizeResult 9 | 10 | __all__ = ["direct"] 11 | 12 | class OptimizeResult(_OptimizeResult): 13 | x: onp.Array1D[np.float64] 14 | fun: float | np.float64 15 | status: int 16 | success: bool 17 | message: str 18 | nfev: int 19 | nit: int 20 | 21 | ### 22 | 23 | ERROR_MESSAGES: tuple[str, str, str, str, str, str, str, str, str, str, str] = ... 24 | SUCCESS_MESSAGES: tuple[str, str, str] = ... 25 | 26 | def direct( 27 | func: Callable[Concatenate[onp.Array1D[np.float64], ...], onp.ToFloat], 28 | bounds: tuple[onp.ToFloat1D, onp.ToFloat1D] | Bounds, 29 | *, 30 | args: tuple[object, ...] = (), 31 | eps: onp.ToFloat = 1e-4, 32 | maxfun: onp.ToJustInt | None = None, 33 | maxiter: onp.ToJustInt = 1000, 34 | locally_biased: onp.ToBool = True, 35 | f_min: onp.ToFloat = ..., 36 | f_min_rtol: onp.ToFloat = 0.0001, 37 | vol_tol: onp.ToFloat = 1e-16, 38 | len_tol: onp.ToFloat = 1e-06, 39 | callback: Callable[[onp.ToArray1D], None] | None = None, 40 | ) -> OptimizeResult: ... 41 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_dual_annealing.pyi: -------------------------------------------------------------------------------- 1 | from collections.abc import Callable 2 | from typing import Concatenate, Literal, TypeAlias 3 | 4 | import numpy as np 5 | import optype.numpy as onp 6 | 7 | from scipy._typing import ToRNG 8 | from scipy.optimize import OptimizeResult as _OptimizeResult 9 | 10 | from ._constraints import Bounds 11 | from ._typing import MinimizerKwargs 12 | 13 | __all__ = ["dual_annealing"] 14 | 15 | _Float1D: TypeAlias = onp.Array1D[np.float64] 16 | 17 | ### 18 | 19 | class OptimizeResult(_OptimizeResult): 20 | success: bool 21 | status: int 22 | x: _Float1D 23 | fun: float 24 | nit: int 25 | nfev: int 26 | njev: int 27 | nhev: int 28 | message: str 29 | 30 | def dual_annealing( 31 | func: Callable[Concatenate[_Float1D, ...], onp.ToFloat], 32 | bounds: Bounds | tuple[onp.ToFloat1D, onp.ToFloat1D] | onp.ToFloat2D, 33 | args: tuple[object, ...] = (), 34 | maxiter: onp.ToJustInt = 1_000, 35 | minimizer_kwargs: MinimizerKwargs | None = None, 36 | initial_temp: onp.ToFloat = 5_230.0, 37 | restart_temp_ratio: onp.ToFloat = 2e-05, 38 | visit: onp.ToFloat = 2.62, 39 | accept: onp.ToFloat = -5.0, 40 | maxfun: onp.ToFloat = 10_000_000.0, 41 | rng: ToRNG = None, 42 | no_local_search: onp.ToBool = False, 43 | callback: Callable[[_Float1D, float, Literal[0, 1, 2]], bool | None] | None = None, 44 | x0: onp.ToFloat1D | None = None, 45 | ) -> _OptimizeResult: ... 46 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_group_columns.pyi: -------------------------------------------------------------------------------- 1 | # https://github.com/scipy/scipy/blob/v1.14.1/scipy/optimize/_group_columns.py 2 | 3 | from typing import Final, LiteralString 4 | 5 | import numpy as np 6 | import optype.numpy as onp 7 | 8 | __pythran__: Final[tuple[LiteralString, LiteralString]] 9 | 10 | # (int, int, int[:, :]) -> int[:] 11 | def group_dense(m: onp.ToJustInt, n: onp.ToJustInt, A: onp.ToJustInt2D) -> onp.Array1D[np.int32]: ... 12 | 13 | # (int, int, int[:], int[:]) -> int[:] 14 | def group_sparse( 15 | m: onp.ToJustInt, n: onp.ToJustInt, indices: onp.ToJustInt1D, indptr: onp.ToJustInt1D 16 | ) -> onp.Array1D[np.int32]: ... 17 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_isotonic.pyi: -------------------------------------------------------------------------------- 1 | from typing import Final, final 2 | 3 | import numpy as np 4 | import optype as op 5 | import optype.numpy as onp 6 | 7 | from ._optimize import OptimizeResult as _OptimizeResult 8 | 9 | __all__ = ["isotonic_regression"] 10 | 11 | @final 12 | class OptimizeResult(_OptimizeResult): 13 | x: Final[onp.Array1D[np.float64]] 14 | weights: Final[onp.Array1D[np.float64]] 15 | blocks: Final[onp.Array1D[np.intp]] 16 | 17 | def isotonic_regression( 18 | y: onp.ToFloat1D, *, weights: onp.ToFloat1D | None = None, increasing: op.CanBool = True 19 | ) -> OptimizeResult: ... 20 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_linprog_doc.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scipy/scipy-stubs/c8048cf7848b5fdbf88f5ebfa71d7450c20dd67d/scipy-stubs/optimize/_linprog_doc.pyi -------------------------------------------------------------------------------- /scipy-stubs/optimize/_linprog_highs.pyi: -------------------------------------------------------------------------------- 1 | # nothing to see here 2 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_linprog_ip.pyi: -------------------------------------------------------------------------------- 1 | from typing import Final 2 | 3 | has_umfpack: Final[bool] = ... 4 | has_cholmod: Final[bool] = ... 5 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_linprog_rs.pyi: -------------------------------------------------------------------------------- 1 | # nothing to see here 2 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_linprog_simplex.pyi: -------------------------------------------------------------------------------- 1 | # nothing to see here 2 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_linprog_util.pyi: -------------------------------------------------------------------------------- 1 | # nothing to see here 2 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_lsap.pyi: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import optype.numpy as onp 3 | 4 | def linear_sum_assignment( 5 | cost_matrix: onp.ToFloat2D, maximize: onp.ToBool = False 6 | ) -> tuple[onp.Array1D[np.intp], onp.Array1D[np.intp]]: ... 7 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_lsq/__init__.pyi: -------------------------------------------------------------------------------- 1 | from .least_squares import least_squares 2 | from .lsq_linear import lsq_linear 3 | 4 | __all__ = ["least_squares", "lsq_linear"] 5 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_lsq/bvls.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, Literal, type_check_only 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | from scipy.optimize import OptimizeResult 7 | 8 | @type_check_only 9 | class _OptimizeResult(OptimizeResult): 10 | x: onp.ArrayND[np.float64] 11 | fun: float | np.float64 12 | cost: float | np.float64 13 | initial_cost: float | np.float64 14 | optimality: float | np.float64 15 | active_mask: onp.ArrayND[np.float64] 16 | nit: int 17 | status: int 18 | 19 | # undocumented 20 | def compute_kkt_optimality(g: onp.ArrayND[np.float64], on_bound: onp.ArrayND[np.float64]) -> np.float64: ... 21 | 22 | # undocumented 23 | def bvls( 24 | A: onp.ArrayND[np.floating[Any]], 25 | b: onp.ArrayND[np.floating[Any]], 26 | x_lsq: onp.ArrayND[np.floating[Any]], 27 | lb: onp.ArrayND[np.floating[Any]], 28 | ub: onp.ArrayND[np.floating[Any]], 29 | tol: onp.ToFloat, 30 | max_iter: onp.ToInt | None, 31 | verbose: Literal[0, 1, 2], 32 | rcond: onp.ToFloat | None = None, 33 | ) -> _OptimizeResult: ... 34 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_lsq/givens_elimination.pyi: -------------------------------------------------------------------------------- 1 | # scipy/optimize/_lsq/givens_elimination.pyx 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | def givens_elimination(S: onp.Array2D[np.float64], v: onp.Array1D[np.float64], diag: onp.Array1D[np.float64]) -> None: ... 7 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_lsq/lsq_linear.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, Final, Literal, TypeAlias, type_check_only 2 | 3 | import numpy as np 4 | import optype as op 5 | import optype.numpy as onp 6 | 7 | from scipy.optimize import OptimizeResult 8 | from scipy.optimize._typing import Bound 9 | from scipy.sparse._base import _spbase 10 | from scipy.sparse.linalg import LinearOperator 11 | 12 | _Int1D: TypeAlias = onp.Array1D[np.intp] 13 | 14 | _Float: TypeAlias = float | np.float64 15 | _Float1D: TypeAlias = onp.Array1D[np.float64] 16 | 17 | _ToBounds: TypeAlias = tuple[onp.ToFloat | onp.ToFloat1D, onp.ToFloat | onp.ToFloat1D] | Bound 18 | _TerminationStatus: TypeAlias = Literal[-1, 0, 1, 2, 3] 19 | 20 | @type_check_only 21 | class _OptimizeResult(OptimizeResult): 22 | x: _Float1D 23 | fun: _Float1D 24 | const: _Float 25 | optimality: _Float 26 | active_mask: _Int1D 27 | unbounded_sol: tuple[onp.ToFloat | onp.ArrayND[np.number[Any]], ...] 28 | nit: int 29 | status: _TerminationStatus 30 | message: str 31 | success: bool 32 | 33 | ### 34 | 35 | TERMINATION_MESSAGES: Final[dict[_TerminationStatus, str]] = ... 36 | 37 | def lsq_linear( 38 | A: onp.ToFloat2D | _spbase | LinearOperator, 39 | b: onp.ToFloat1D, 40 | bounds: _ToBounds = ..., # (inf, inf) 41 | method: Literal["trf", "bvls"] = "trf", 42 | tol: onp.ToFloat = 1e-10, 43 | lsq_solver: Literal["exact", "lsmr"] | None = None, 44 | lsmr_tol: onp.ToFloat | Literal["auto"] | None = None, 45 | max_iter: onp.ToInt | None = None, 46 | verbose: Literal[0, 1, 2] = 0, 47 | *, 48 | lsmr_maxiter: onp.ToInt | None = None, 49 | ) -> _OptimizeResult: ... 50 | 51 | # undocumented 52 | def prepare_bounds(bounds: _ToBounds, n: op.CanIndex) -> tuple[_Float, _Float] | tuple[_Float1D, _Float1D]: ... 53 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_nnls.pyi: -------------------------------------------------------------------------------- 1 | from typing import overload 2 | from typing_extensions import deprecated 3 | 4 | import numpy as np 5 | import optype.numpy as onp 6 | 7 | __all__ = ["nnls"] 8 | 9 | @overload 10 | def nnls( 11 | A: onp.ToFloat2D, b: onp.ToFloat1D, *, maxiter: onp.ToInt | None = None 12 | ) -> tuple[onp.ArrayND[np.float64], np.float64]: ... 13 | @overload 14 | @deprecated("The atol parameter is deprecated and will be removed in SciPy 1.18.0. It is not used in the implementation.") 15 | def nnls( 16 | A: onp.ToFloat2D, b: onp.ToFloat1D, *, maxiter: onp.ToInt | None = None, atol: onp.ToFloat 17 | ) -> tuple[onp.ArrayND[np.float64], np.float64]: ... 18 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_qap.pyi: -------------------------------------------------------------------------------- 1 | from typing import Final, Literal, TypedDict, overload, type_check_only 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | from scipy._typing import ToRNG 7 | 8 | from ._optimize import OptimizeResult as _OptimizeResult 9 | 10 | @type_check_only 11 | class _CommonOptions(TypedDict, total=False): 12 | maximize: onp.ToBool 13 | rng: ToRNG 14 | partial_match: onp.ToInt2D | None 15 | 16 | @type_check_only 17 | class _FAQOptions(_CommonOptions, TypedDict, total=False): 18 | P0: onp.ToFloat2D | Literal["barycenter", "randomized"] 19 | shuffle: onp.ToBool 20 | maxiter: onp.ToJustInt 21 | tol: onp.ToFloat 22 | 23 | @type_check_only 24 | class _2OptOptions(_CommonOptions, TypedDict, total=False): 25 | partial_guess: onp.ToInt2D | None 26 | 27 | ### 28 | 29 | QUADRATIC_ASSIGNMENT_METHODS: Final = ["faq", "2opt"] 30 | 31 | class OptimizeResult(_OptimizeResult): 32 | col_ind: onp.Array1D[np.intp] 33 | fun: float | np.float64 34 | nit: int 35 | 36 | @overload 37 | def quadratic_assignment( 38 | A: onp.ToFloat2D, B: onp.ToFloat2D, method: Literal["faq"] = "faq", options: _FAQOptions | None = None 39 | ) -> OptimizeResult: ... 40 | @overload 41 | def quadratic_assignment( 42 | A: onp.ToFloat2D, B: onp.ToFloat2D, method: Literal["2opt"], options: _2OptOptions | None = None 43 | ) -> OptimizeResult: ... 44 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_shgo_lib/__init__.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scipy/scipy-stubs/c8048cf7848b5fdbf88f5ebfa71d7450c20dd67d/scipy-stubs/optimize/_shgo_lib/__init__.pyi -------------------------------------------------------------------------------- /scipy-stubs/optimize/_slsqplib.pyi: -------------------------------------------------------------------------------- 1 | # scipy/optimize/__slsqp.h 2 | 3 | from typing import Any 4 | 5 | import numpy as np 6 | import optype.numpy as onp 7 | 8 | class error(Exception): ... # undocumented 9 | 10 | def nnls(A: onp.Array2D[np.float64], b: onp.Array1D[np.float64], maxiter: int, /) -> onp.Array1D[np.float64]: ... # undocumented 11 | def slsqp( 12 | state_dict: dict[str, Any], 13 | funx: float, 14 | gradx: onp.Array1D[np.float64], 15 | C: onp.Array2D[np.float64], 16 | d: onp.Array1D[np.float64], 17 | sol: onp.Array1D[np.float64], 18 | mult: onp.Array1D[np.float64], 19 | xl: onp.Array1D[np.float64], 20 | xu: onp.Array1D[np.float64], 21 | buffer: onp.Array1D[np.float64], 22 | indices: onp.Array1D[np.int32], 23 | ) -> None: ... # undocumented 24 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_spectral.pyi: -------------------------------------------------------------------------------- 1 | from scipy.optimize import OptimizeResult as OptimizeResult 2 | 3 | class _NoConvergence(Exception): ... 4 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_tnc.pyi: -------------------------------------------------------------------------------- 1 | from collections.abc import Callable, Sequence 2 | from typing import Final, Literal, TypeAlias 3 | 4 | import numpy as np 5 | import optype.numpy as onp 6 | 7 | __all__ = ["fmin_tnc"] 8 | 9 | _ReturnCode: TypeAlias = Literal[-1, 0, 1, 2, 3, 4, 5, 6, 7] 10 | 11 | MSG_NONE: Final = 0 12 | MSG_ITER: Final = 1 13 | MSG_INFO: Final = 2 14 | MSG_VERS: Final = 4 15 | MSG_EXIT: Final = 8 16 | MSG_ALL: Final = 15 17 | MSGS: Final[dict[Literal[0, 1, 2, 4, 8, 15], str]] 18 | 19 | INFEASIBLE: Final = -1 20 | LOCALMINIMUM: Final = 0 21 | FCONVERGED: Final = 1 22 | XCONVERGED: Final = 2 23 | MAXFUN: Final = 3 24 | LSFAIL: Final = 4 25 | CONSTANT: Final = 5 26 | NOPROGRESS: Final = 6 27 | USERABORT: Final = 7 28 | RCSTRINGS: Final[dict[_ReturnCode, str]] 29 | 30 | def fmin_tnc( 31 | func: Callable[..., onp.ToFloat] | Callable[..., tuple[onp.ToFloat, onp.ToFloat]], 32 | x0: onp.ToFloat | onp.ToFloat1D, 33 | fprime: Callable[..., onp.ToFloat] | None = None, 34 | args: tuple[object, ...] = (), 35 | approx_grad: int = 0, 36 | bounds: Sequence[tuple[float | None, float | None]] | None = None, 37 | epsilon: float = 1e-08, 38 | scale: onp.ToFloat | onp.ToFloat1D | None = None, 39 | offset: onp.ToFloat | onp.ToFloat1D | None = None, 40 | messages: int = ..., 41 | maxCGit: int = -1, 42 | maxfun: int | None = None, 43 | eta: float = -1, 44 | stepmx: float = 0, 45 | accuracy: float = 0, 46 | fmin: float = 0, 47 | ftol: float = -1, 48 | xtol: float = -1, 49 | pgtol: float = -1, 50 | rescale: float = -1, 51 | disp: bool | None = None, 52 | callback: Callable[[onp.Array1D[np.float64]], None] | None = None, 53 | ) -> tuple[onp.Array1D[np.float64], int, _ReturnCode]: ... 54 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_trlib/__init__.pyi: -------------------------------------------------------------------------------- 1 | from collections.abc import Callable 2 | from typing import Protocol, type_check_only 3 | 4 | import numpy as np 5 | import optype.numpy as onp 6 | 7 | from ._trlib import TRLIBQuadraticSubproblem 8 | 9 | __all__ = ["TRLIBQuadraticSubproblem", "get_trlib_quadratic_subproblem"] 10 | 11 | @type_check_only 12 | class _SubproblemFactory(Protocol): 13 | def __call__( 14 | self, 15 | /, 16 | x: onp.ToFloat1D, 17 | fun: Callable[[onp.Array1D[np.float64]], onp.ToFloat], 18 | jac: Callable[[onp.Array1D[np.float64]], onp.ToFloat1D], 19 | hess: Callable[[onp.Array1D[np.float64]], onp.ToFloat2D] | None = None, 20 | hessp: Callable[[onp.Array1D[np.float64], onp.Array1D[np.float64]], onp.ToFloat1D] | None = None, 21 | ) -> TRLIBQuadraticSubproblem: ... 22 | 23 | ### 24 | 25 | def get_trlib_quadratic_subproblem( 26 | tol_rel_i: onp.ToFloat = -2.0, tol_rel_b: onp.ToFloat = -3.0, disp: onp.ToBool = False 27 | ) -> _SubproblemFactory: ... 28 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_trlib/_trlib.pyi: -------------------------------------------------------------------------------- 1 | # https://github.com/scipy/scipy/blob/v1.14.1/scipy/optimize/_trlib/_trlib.pyx 2 | 3 | from collections.abc import Callable, Mapping 4 | from typing import Final, Never 5 | 6 | import numpy as np 7 | import optype.numpy as onp 8 | 9 | from scipy.optimize._trustregion import BaseQuadraticSubproblem 10 | 11 | ### 12 | 13 | __test__: Final[Mapping[Never, Never]] # undocumented 14 | 15 | class TRLIBQuadraticSubproblem(BaseQuadraticSubproblem): # undocumented 16 | def __init__( 17 | self, 18 | /, 19 | x: onp.ToFloat1D, 20 | fun: Callable[[onp.Array1D[np.float64]], onp.ToFloat], 21 | jac: Callable[[onp.Array1D[np.float64]], onp.ToFloat1D], 22 | hess: Callable[[onp.Array1D[np.float64]], onp.ToFloat2D] | None, 23 | hessp: Callable[[onp.Array1D[np.float64], onp.Array1D[np.float64]], onp.ToFloat1D] | None, 24 | tol_rel_i: onp.ToFloat = -2.0, 25 | tol_rel_b: onp.ToFloat = -3.0, 26 | disp: onp.ToBool = False, 27 | ) -> None: ... 28 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_trustregion.pyi: -------------------------------------------------------------------------------- 1 | from collections.abc import Callable 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | __all__: list[str] = [] 7 | 8 | class BaseQuadraticSubproblem: 9 | def __init__( 10 | self, 11 | /, 12 | x: onp.ToFloat1D, 13 | fun: Callable[[onp.Array1D[np.float64]], onp.ToFloat], 14 | jac: Callable[[onp.Array1D[np.float64]], onp.ToFloat1D], 15 | hess: Callable[[onp.Array1D[np.float64]], onp.ToFloat2D] | None = None, 16 | hessp: Callable[[onp.Array1D[np.float64], onp.Array1D[np.float64]], onp.ToFloat1D] | None = None, 17 | ) -> None: ... 18 | def __call__(self, /, p: onp.ToFloat1D) -> float | np.float64: ... 19 | 20 | # 21 | @property 22 | def fun(self, /) -> float | np.float64: ... 23 | @property 24 | def jac_mag(self, /) -> float | np.float64: ... 25 | @property 26 | def jac(self, /) -> onp.Array1D[np.float64]: ... 27 | @property 28 | def hess(self, /) -> onp.Array2D[np.float64]: ... 29 | 30 | # 31 | def hessp(self, /, p: onp.ToFloat1D) -> onp.Array1D[np.float64]: ... 32 | def get_boundaries_intersections( 33 | self, /, z: onp.ToArray1D, d: onp.ToArray1D, trust_radius: onp.ToFloat 34 | ) -> list[float | np.float64]: ... # list of size 2 35 | 36 | # 37 | def solve(self, /, trust_radius: onp.ToFloat) -> tuple[onp.Array1D[np.float64], bool]: ... 38 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_trustregion_constr/__init__.pyi: -------------------------------------------------------------------------------- 1 | from .minimize_trustregion_constr import _minimize_trustregion_constr 2 | 3 | __all__ = ["_minimize_trustregion_constr"] 4 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_trustregion_constr/equality_constrained_sqp.pyi: -------------------------------------------------------------------------------- 1 | from collections.abc import Callable 2 | from typing import Any, Literal, TypeVar 3 | 4 | import numpy as np 5 | import optype.numpy as onp 6 | 7 | from scipy.sparse import dia_matrix 8 | 9 | __all__ = ["equality_constrained_sqp"] 10 | 11 | _StateT = TypeVar("_StateT") 12 | 13 | def default_scaling(x: onp.ToArray1D) -> dia_matrix: ... 14 | def equality_constrained_sqp( 15 | fun_and_constr: Callable[[onp.Array1D[np.float64]], tuple[float | np.floating[Any], onp.ToFloat1D]], 16 | grad_and_jac: Callable[[onp.Array1D[np.float64]], tuple[onp.ToFloat1D, onp.ToFloat2D]], 17 | lagr_hess: Callable[[onp.Array1D[np.float64], onp.Array1D[np.float64]], onp.ToFloat2D], 18 | x0: onp.ToFloat1D, 19 | fun0: onp.ToFloat, 20 | grad0: onp.ToFloat1D, 21 | constr0: onp.ToFloat1D, 22 | jac0: onp.ToFloat2D, 23 | stop_criteria: Callable[ 24 | [ 25 | _StateT, # state 26 | onp.Array1D[np.float64], # x 27 | bool, # last_iteration_failed 28 | np.float64, # optimality 29 | np.float64, # const_violation 30 | np.float64, # trust_radius 31 | np.float64, # penalty 32 | dict[str, int], # cg_info 33 | ], 34 | onp.ToBool, 35 | ], 36 | state: _StateT, 37 | initial_penalty: onp.ToFloat, 38 | initial_trust_radius: onp.ToFloat, 39 | factorization_method: Literal["NormalEquation", "AugmentedSystem", "QRFactorization", "SVDFactorization"], 40 | trust_lb: onp.Array1D[np.floating[Any]] | None = None, 41 | trust_ub: onp.Array1D[np.floating[Any]] | None = None, 42 | scaling: Callable[[onp.Array1D[np.float64]], dia_matrix] = ..., 43 | ) -> tuple[onp.Array1D[np.floating[Any]], _StateT]: ... 44 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_trustregion_constr/report.pyi: -------------------------------------------------------------------------------- 1 | from collections.abc import Sequence 2 | from typing import ClassVar 3 | 4 | class ReportBase: 5 | COLUMN_NAMES: ClassVar[Sequence[str]] = ... 6 | COLUMN_WIDTHS: ClassVar[Sequence[int]] = ... 7 | ITERATION_FORMATS: ClassVar[Sequence[str]] = ... 8 | 9 | @classmethod 10 | def print_header(cls) -> None: ... 11 | @classmethod 12 | def print_iteration(cls, /, *args: object) -> None: ... 13 | @classmethod 14 | def print_footer(cls) -> None: ... 15 | 16 | class BasicReport(ReportBase): ... 17 | class SQPReport(ReportBase): ... 18 | class IPReport(ReportBase): ... 19 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_trustregion_dogleg.pyi: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import optype.numpy as onp 3 | 4 | from ._trustregion import BaseQuadraticSubproblem 5 | 6 | __all__: list[str] = [] 7 | 8 | class DoglegSubproblem(BaseQuadraticSubproblem): 9 | def cauchy_point(self, /) -> onp.Array1D[np.float64]: ... 10 | def newton_point(self, /) -> onp.Array1D[np.float64]: ... 11 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_trustregion_krylov.pyi: -------------------------------------------------------------------------------- 1 | from collections.abc import Callable 2 | from typing import Concatenate, TypedDict, type_check_only 3 | from typing_extensions import Unpack 4 | 5 | import numpy as np 6 | import optype.numpy as onp 7 | 8 | from ._minimize import OptimizeResult 9 | 10 | __all__ = ["_minimize_trust_krylov"] 11 | 12 | @type_check_only 13 | class _TrustRegionOptions(TypedDict, total=False): 14 | initial_trust_radius: onp.ToFloat 15 | max_trust_radius: onp.ToFloat 16 | eta: onp.ToFloat 17 | gtol: onp.ToFloat 18 | maxiter: onp.ToJustInt 19 | disp: onp.ToBool 20 | 21 | ### 22 | 23 | def _minimize_trust_krylov( 24 | fun: Callable[Concatenate[onp.Array1D[np.float64], ...], onp.ToFloat], 25 | x0: onp.ToFloat1D, 26 | args: tuple[object, ...] = (), 27 | jac: Callable[Concatenate[onp.Array1D[np.float64], ...], onp.ToFloat1D] | None = None, 28 | hess: Callable[Concatenate[onp.Array1D[np.float64], ...], onp.ToFloat2D] | None = None, 29 | hessp: Callable[Concatenate[onp.Array1D[np.float64], onp.Array1D[np.float64], ...], onp.ToFloat1D] | None = None, 30 | inexact: onp.ToBool = True, 31 | **trust_region_options: Unpack[_TrustRegionOptions], 32 | ) -> OptimizeResult: ... 33 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/_trustregion_ncg.pyi: -------------------------------------------------------------------------------- 1 | from ._trustregion import BaseQuadraticSubproblem 2 | 3 | __all__: list[str] = [] 4 | 5 | class CGSteihaugSubproblem(BaseQuadraticSubproblem): ... 6 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/cobyla.pyi: -------------------------------------------------------------------------------- 1 | # This file is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | from typing import Any 4 | from typing_extensions import deprecated 5 | 6 | __all__ = ["OptimizeResult", "fmin_cobyla"] 7 | 8 | @deprecated("will be removed in SciPy v2.0.0") 9 | class OptimizeResult(Any): ... 10 | 11 | @deprecated("will be removed in SciPy v2.0.0") 12 | def fmin_cobyla( 13 | func: object, 14 | x0: object, 15 | cons: object, 16 | args: object = ..., 17 | consargs: object = ..., 18 | rhobeg: object = ..., 19 | rhoend: object = ..., 20 | maxfun: object = ..., 21 | disp: object = ..., 22 | catol: object = ..., 23 | *, 24 | callback: object = ..., 25 | ) -> object: ... 26 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/cython_optimize/__init__.pyi: -------------------------------------------------------------------------------- 1 | # nothing to see here 2 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/elementwise.pyi: -------------------------------------------------------------------------------- 1 | from ._elementwise import bracket_minimum, bracket_root, find_minimum, find_root 2 | 3 | __all__ = ["bracket_minimum", "bracket_root", "find_minimum", "find_root"] 4 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/lbfgsb.pyi: -------------------------------------------------------------------------------- 1 | # This file is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | from typing import Any 4 | from typing_extensions import deprecated 5 | 6 | __all__ = ["LbfgsInvHessProduct", "OptimizeResult", "fmin_l_bfgs_b", "zeros"] 7 | 8 | @deprecated("will be removed in SciPy v2.0.0") 9 | def zeros(shape: object, dtype: object = ..., order: object = ..., *, device: object = ..., like: object = ...) -> object: ... 10 | @deprecated("will be removed in SciPy v2.0.0") 11 | class OptimizeResult(Any): ... 12 | 13 | @deprecated("will be removed in SciPy v2.0.0") 14 | def fmin_l_bfgs_b( 15 | func: object, 16 | x0: object, 17 | fprime: object = ..., 18 | args: object = ..., 19 | approx_grad: object = ..., 20 | bounds: object = ..., 21 | m: object = ..., 22 | factr: object = ..., 23 | pgtol: object = ..., 24 | epsilon: object = ..., 25 | iprint: object = ..., 26 | maxfun: object = ..., 27 | maxiter: object = ..., 28 | disp: object = ..., 29 | callback: object = ..., 30 | maxls: object = ..., 31 | ) -> object: ... 32 | @deprecated("will be removed in SciPy v2.0.0") 33 | class LbfgsInvHessProduct: 34 | def __init__(self, /, sk: object, yk: object) -> None: ... 35 | def todense(self, /) -> object: ... 36 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/linesearch.pyi: -------------------------------------------------------------------------------- 1 | # This file is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | from typing_extensions import deprecated 4 | 5 | __all__ = ["line_search"] 6 | 7 | @deprecated("will be removed in SciPy v2.0.0") 8 | def line_search( 9 | f: object, 10 | fprime: object, 11 | xk: object, 12 | pk: object, 13 | gfk: object = ..., 14 | old_fval: object = ..., 15 | old_old_fval: object = ..., 16 | args: object = (), 17 | c1: object = ..., 18 | c2: object = ..., 19 | amax: object = ..., 20 | amin: object = ..., 21 | xtol: object = ..., 22 | ) -> object: ... 23 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/minpack2.pyi: -------------------------------------------------------------------------------- 1 | # This file is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | __all__: list[str] = [] 4 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/moduleTNC.pyi: -------------------------------------------------------------------------------- 1 | # This file is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | __all__: list[str] = [] 4 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/slsqp.pyi: -------------------------------------------------------------------------------- 1 | # This file is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | from collections.abc import Callable 4 | from typing import Any 5 | from typing_extensions import deprecated 6 | 7 | __all__ = ["OptimizeResult", "fmin_slsqp", "slsqp"] 8 | 9 | @deprecated("will be removed in SciPy v2.0.0") 10 | class OptimizeResult(Any): ... 11 | 12 | @deprecated("will be removed in SciPy v2.0.0") 13 | def fmin_slsqp( 14 | func: object, 15 | x0: object, 16 | eqcons: object = ..., 17 | f_eqcons: object = ..., 18 | ieqcons: object = ..., 19 | f_ieqcons: object = ..., 20 | bounds: object = ..., 21 | fprime: object = ..., 22 | fprime_eqcons: object = ..., 23 | fprime_ieqcons: object = ..., 24 | args: object = ..., 25 | iter: object = ..., 26 | acc: object = ..., 27 | iprint: object = ..., 28 | disp: object = ..., 29 | full_output: object = ..., 30 | epsilon: object = ..., 31 | callback: object = ..., 32 | ) -> Any: ... # noqa: ANN401 33 | 34 | slsqp: Callable[..., Any] = ... # deprecated 35 | -------------------------------------------------------------------------------- /scipy-stubs/optimize/tnc.pyi: -------------------------------------------------------------------------------- 1 | # This file is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | from typing import Any 4 | from typing_extensions import deprecated 5 | 6 | __all__ = ["OptimizeResult", "fmin_tnc", "zeros"] 7 | 8 | @deprecated("will be removed in SciPy v2.0.0") 9 | def zeros(shape: object, dtype: object = ..., order: object = ..., *, device: object = ..., like: object = ...) -> object: ... 10 | @deprecated("will be removed in SciPy v2.0.0") 11 | class OptimizeResult(Any): ... 12 | 13 | @deprecated("will be removed in SciPy v2.0.0") 14 | def fmin_tnc( 15 | func: object, 16 | x0: object, 17 | fprime: object = ..., 18 | args: object = ..., 19 | approx_grad: object = ..., 20 | bounds: object = ..., 21 | epsilon: object = ..., 22 | scale: object = ..., 23 | offset: object = ..., 24 | messages: object = ..., 25 | maxCGit: object = ..., 26 | maxfun: object = ..., 27 | eta: object = ..., 28 | stepmx: object = ..., 29 | accuracy: object = ..., 30 | fmin: object = ..., 31 | ftol: object = ..., 32 | xtol: object = ..., 33 | pgtol: object = ..., 34 | rescale: object = ..., 35 | disp: object = ..., 36 | callback: object = ..., 37 | ) -> object: ... 38 | -------------------------------------------------------------------------------- /scipy-stubs/signal/_arraytools.pyi: -------------------------------------------------------------------------------- 1 | from typing import TypeVar, overload 2 | 3 | import numpy as np 4 | import optype as op 5 | import optype.numpy as onp 6 | 7 | from scipy._typing import Truthy 8 | 9 | _SCT = TypeVar("_SCT", bound=np.generic) 10 | 11 | ### 12 | 13 | def axis_slice( 14 | a: onp.ArrayND[_SCT], 15 | start: op.CanIndex | None = None, 16 | stop: op.CanIndex | None = None, 17 | step: op.CanIndex | None = None, 18 | axis: op.CanIndex = -1, 19 | ) -> onp.ArrayND[_SCT]: ... 20 | def axis_reverse(a: onp.ArrayND[_SCT], axis: op.CanIndex = -1) -> onp.ArrayND[_SCT]: ... 21 | 22 | # 23 | def odd_ext(x: onp.ArrayND[_SCT], n: onp.ToInt, axis: op.CanIndex = -1) -> onp.ArrayND[_SCT]: ... 24 | def even_ext(x: onp.ArrayND[_SCT], n: onp.ToInt, axis: op.CanIndex = -1) -> onp.ArrayND[_SCT]: ... 25 | def const_ext(x: onp.ArrayND[_SCT], n: onp.ToInt, axis: op.CanIndex = -1) -> onp.ArrayND[_SCT]: ... 26 | def zero_ext(x: onp.ArrayND[_SCT], n: onp.ToInt, axis: op.CanIndex = -1) -> onp.ArrayND[_SCT]: ... 27 | 28 | # 29 | @overload 30 | def _validate_fs(fs: None, allow_none: Truthy = True) -> None: ... 31 | @overload 32 | def _validate_fs(fs: onp.ToFloat, allow_none: onp.ToBool = True) -> float: ... 33 | -------------------------------------------------------------------------------- /scipy-stubs/signal/_max_len_seq.pyi: -------------------------------------------------------------------------------- 1 | from typing import Final 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | __all__ = ["max_len_seq"] 7 | 8 | _mls_taps: Final[dict[int, list[int]]] = ... 9 | 10 | def max_len_seq( 11 | nbits: onp.ToJustInt, 12 | state: onp.ToInt1D | None = None, 13 | length: onp.ToJustInt | None = None, 14 | taps: onp.ToJustInt1D | None = None, 15 | ) -> tuple[onp.Array1D[np.int8], onp.Array1D[np.int8]]: ... 16 | -------------------------------------------------------------------------------- /scipy-stubs/signal/_max_len_seq_inner.pyi: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import optype.numpy as onp 3 | 4 | __pythran__: tuple[str, str] = ... 5 | 6 | def _max_len_seq_inner( 7 | taps: onp.Array1D[np.intp], 8 | state: onp.Array1D[np.int8], 9 | nbits: int | np.intp, 10 | length: int | np.intp, 11 | out: onp.Array1D[np.int8], 12 | ) -> onp.Array1D[np.int8]: ... 13 | -------------------------------------------------------------------------------- /scipy-stubs/signal/_peak_finding_utils.pyi: -------------------------------------------------------------------------------- 1 | # scipy/signal/_peak_finding_utils.pyx 2 | from typing import TypeAlias 3 | 4 | import numpy as np 5 | import optype.numpy as onp 6 | 7 | __all__ = ["_local_maxima_1d", "_peak_prominences", "_peak_widths", "_select_by_peak_distance"] 8 | 9 | _Array_b_1d: TypeAlias = onp.Array1D[np.bool_] 10 | _Array_n_1d: TypeAlias = onp.Array1D[np.intp] 11 | _Array_f8_1d: TypeAlias = onp.Array1D[np.float64] 12 | 13 | class PeakPropertyWarning(RuntimeWarning): ... # undocumented 14 | 15 | def _local_maxima_1d(x: _Array_f8_1d) -> tuple[_Array_n_1d, _Array_n_1d, _Array_n_1d]: ... 16 | def _select_by_peak_distance(peaks: _Array_n_1d, priority: _Array_f8_1d, distance: np.float64) -> _Array_b_1d: ... 17 | def _peak_prominences(x: _Array_f8_1d, peaks: _Array_n_1d, wlen: np.intp) -> tuple[_Array_f8_1d, _Array_n_1d, _Array_n_1d]: ... 18 | def _peak_widths( 19 | x: _Array_f8_1d, 20 | peaks: _Array_n_1d, 21 | rel_height: np.float64, 22 | prominences: _Array_f8_1d, 23 | left_bases: _Array_n_1d, 24 | right_bases: _Array_n_1d, 25 | ) -> tuple[_Array_f8_1d, _Array_f8_1d, _Array_f8_1d, _Array_f8_1d]: ... 26 | -------------------------------------------------------------------------------- /scipy-stubs/signal/_savitzky_golay.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, Literal, TypeAlias 2 | 3 | import numpy as np 4 | import optype as op 5 | import optype.numpy as onp 6 | 7 | _Mode: TypeAlias = Literal["mirror", "constant", "nearest", "wrap", "interp"] 8 | 9 | def savgol_coeffs( 10 | window_length: int, 11 | polyorder: int, 12 | deriv: int = 0, 13 | delta: float = 1.0, 14 | pos: int | None = None, 15 | use: Literal["conv", "dot"] = "conv", 16 | ) -> onp.Array1D[np.floating[Any]]: ... 17 | 18 | # 19 | def savgol_filter( 20 | x: onp.ToFloatND, 21 | window_length: int, 22 | polyorder: int, 23 | deriv: int = 0, 24 | delta: float = 1.0, 25 | axis: op.CanIndex = -1, 26 | mode: _Mode = "interp", 27 | cval: float = 0.0, 28 | ) -> onp.ArrayND[np.float32 | np.float64]: ... 29 | -------------------------------------------------------------------------------- /scipy-stubs/signal/_spline.pyi: -------------------------------------------------------------------------------- 1 | from typing import TypeAlias, overload 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | _Float: TypeAlias = np.float32 | np.float64 7 | _Complex: TypeAlias = np.complex64 | np.complex128 8 | 9 | _ToFloat: TypeAlias = float | _Float 10 | 11 | _FloatND: TypeAlias = onp.ArrayND[_Float] 12 | _ComplexND: TypeAlias = onp.ArrayND[_Complex] 13 | _InexactND: TypeAlias = onp.ArrayND[_Float | _Complex] 14 | 15 | ### 16 | 17 | @overload 18 | def sepfir2d(input: _FloatND, hrow: _FloatND, hcol: _FloatND) -> _FloatND: ... 19 | @overload 20 | def sepfir2d(input: _ComplexND, hrow: _ComplexND, hcol: _ComplexND) -> _ComplexND: ... 21 | @overload 22 | def sepfir2d(input: _InexactND, hrow: _InexactND, hcol: _InexactND) -> _InexactND: ... 23 | 24 | # 25 | @overload 26 | def symiirorder1_ic(signal: _FloatND, c0: _ToFloat, z1: _ToFloat, precision: _ToFloat) -> _FloatND: ... 27 | @overload 28 | def symiirorder1_ic(signal: _ComplexND, c0: _ToFloat, z1: _ToFloat, precision: _ToFloat) -> _ComplexND: ... 29 | @overload 30 | def symiirorder1_ic(signal: _InexactND, c0: _ToFloat, z1: _ToFloat, precision: _ToFloat) -> _InexactND: ... 31 | 32 | # 33 | def symiirorder2_ic_fwd(signal: _FloatND, r: _ToFloat, omega: _ToFloat, precision: _ToFloat) -> _FloatND: ... 34 | def symiirorder2_ic_bwd(signal: _FloatND, r: _ToFloat, omega: _ToFloat, precision: _ToFloat) -> _FloatND: ... 35 | -------------------------------------------------------------------------------- /scipy-stubs/signal/_upfirdn.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, Literal, TypeAlias 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | __all__ = ["_output_len", "upfirdn"] 7 | 8 | _FIRMode: TypeAlias = Literal["constant", "symmetric", "reflect", "wrap"] 9 | _int64_t: TypeAlias = int | np.int64 # noqa: PYI042 10 | 11 | class _UpFIRDn: 12 | def __init__(self, /, h: onp.ArrayND[np.floating[Any]], x_dtype: np.dtype[np.floating[Any]], up: int, down: int) -> None: ... 13 | def apply_filter( 14 | self, /, x: onp.ArrayND[np.number[Any]], axis: int = -1, mode: _FIRMode = "constant", cval: int = 0 15 | ) -> onp.ArrayND[np.floating[Any]]: ... 16 | 17 | def upfirdn( 18 | h: onp.AnyFloatingArray, 19 | x: onp.AnyIntegerArray | onp.AnyFloatingArray, 20 | up: int = 1, 21 | down: int = 1, 22 | axis: int = -1, 23 | mode: _FIRMode = "constant", 24 | cval: float = 0, 25 | ) -> onp.ArrayND[np.floating[Any]]: ... 26 | 27 | # originally defined in `scipy/signal/_upfirdn_apply.pyx` (as `(((in_len - 1) * up + len_h) - 1) // down + 1`) 28 | def _output_len(len_h: _int64_t, in_len: _int64_t, up: _int64_t, down: _int64_t) -> _int64_t: ... 29 | -------------------------------------------------------------------------------- /scipy-stubs/signal/_wavelets.pyi: -------------------------------------------------------------------------------- 1 | # nothing to see here 2 | -------------------------------------------------------------------------------- /scipy-stubs/signal/bsplines.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | from typing_extensions import deprecated 3 | 4 | from .spline import sepfir2d 5 | 6 | __all__ = ["cspline1d", "cspline1d_eval", "cspline2d", "gauss_spline", "qspline1d", "qspline1d_eval", "sepfir2d", "spline_filter"] 7 | 8 | @deprecated("will be removed in SciPy v2.0.0") 9 | def cspline1d(signal: object, lamb: object = ...) -> object: ... 10 | @deprecated("will be removed in SciPy v2.0.0") 11 | def cspline1d_eval(cj: object, newx: object, dx: object = ..., x0: object = ...) -> object: ... 12 | @deprecated("will be removed in SciPy v2.0.0") 13 | def cspline2d(signal: object, lamb: object = ..., precision: object = ...) -> object: ... 14 | @deprecated("will be removed in SciPy v2.0.0") 15 | def gauss_spline(x: object, n: object) -> object: ... 16 | @deprecated("will be removed in SciPy v2.0.0") 17 | def qspline1d(signal: object, lamb: object = ...) -> object: ... 18 | @deprecated("will be removed in SciPy v2.0.0") 19 | def qspline1d_eval(cj: object, newx: object, dx: object = ..., x0: object = ...) -> object: ... 20 | @deprecated("will be removed in SciPy v2.0.0") 21 | def spline_filter(Iin: object, lmbda: object = ...) -> object: ... 22 | -------------------------------------------------------------------------------- /scipy-stubs/signal/lti_conversion.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | from typing_extensions import deprecated 3 | 4 | from .filter_design import normalize, tf2zpk, zpk2tf 5 | 6 | __all__ = ["abcd_normalize", "cont2discrete", "normalize", "ss2tf", "ss2zpk", "tf2ss", "tf2zpk", "zpk2ss", "zpk2tf"] 7 | 8 | @deprecated("will be removed in SciPy v2.0.0") 9 | def tf2ss(num: object, den: object) -> object: ... 10 | @deprecated("will be removed in SciPy v2.0.0") 11 | def abcd_normalize(A: object = ..., B: object = ..., C: object = ..., D: object = ...) -> object: ... 12 | @deprecated("will be removed in SciPy v2.0.0") 13 | def ss2tf(A: object, B: object, C: object, D: object, input: object = ...) -> object: ... 14 | @deprecated("will be removed in SciPy v2.0.0") 15 | def zpk2ss(z: object, p: object, k: object) -> object: ... 16 | @deprecated("will be removed in SciPy v2.0.0") 17 | def ss2zpk(A: object, B: object, C: object, D: object, input: object = ...) -> object: ... 18 | @deprecated("will be removed in SciPy v2.0.0") 19 | def cont2discrete(system: object, dt: object, method: object = ..., alpha: object = ...) -> object: ... 20 | -------------------------------------------------------------------------------- /scipy-stubs/signal/spline.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | from typing_extensions import deprecated 4 | 5 | __all__ = ["sepfir2d"] 6 | 7 | @deprecated("will be removed in SciPy v2.0.0") 8 | def sepfir2d(input: object, hrow: object, hcol: object) -> object: ... 9 | -------------------------------------------------------------------------------- /scipy-stubs/signal/waveforms.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | from typing_extensions import deprecated 4 | 5 | __all__ = ["chirp", "gausspulse", "sawtooth", "square", "sweep_poly", "unit_impulse"] 6 | 7 | @deprecated("will be removed in SciPy v2.0.0") 8 | def sawtooth(t: object, width: object = ...) -> object: ... 9 | @deprecated("will be removed in SciPy v2.0.0") 10 | def square(t: object, duty: object = ...) -> object: ... 11 | @deprecated("will be removed in SciPy v2.0.0") 12 | def gausspulse( 13 | t: object, 14 | fc: object = ..., 15 | bw: object = ..., 16 | bwr: object = ..., 17 | tpr: object = ..., 18 | retquad: object = ..., 19 | retenv: object = ..., 20 | ) -> object: ... 21 | @deprecated("will be removed in SciPy v2.0.0") 22 | def chirp( 23 | t: object, 24 | f0: object, 25 | t1: object, 26 | f1: object, 27 | method: object = ..., 28 | phi: object = ..., 29 | vertex_zero: object = ..., 30 | *, 31 | complex: object = False, 32 | ) -> object: ... 33 | @deprecated("will be removed in SciPy v2.0.0") 34 | def sweep_poly(t: object, poly: object, phi: object = ...) -> object: ... 35 | @deprecated("will be removed in SciPy v2.0.0") 36 | def unit_impulse(shape: object, idx: object = ..., dtype: object = ...) -> object: ... 37 | -------------------------------------------------------------------------------- /scipy-stubs/signal/wavelets.pyi: -------------------------------------------------------------------------------- 1 | # This file is not meant for public use and will be removed in SciPy v2.0.0. 2 | __all__: list[str] = [] 3 | -------------------------------------------------------------------------------- /scipy-stubs/signal/windows/__init__.pyi: -------------------------------------------------------------------------------- 1 | from . import windows as windows 2 | from ._windows import * 3 | 4 | __all__ = [ 5 | "barthann", 6 | "bartlett", 7 | "blackman", 8 | "blackmanharris", 9 | "bohman", 10 | "boxcar", 11 | "chebwin", 12 | "cosine", 13 | "dpss", 14 | "exponential", 15 | "flattop", 16 | "gaussian", 17 | "general_cosine", 18 | "general_gaussian", 19 | "general_hamming", 20 | "get_window", 21 | "hamming", 22 | "hann", 23 | "kaiser", 24 | "kaiser_bessel_derived", 25 | "lanczos", 26 | "nuttall", 27 | "parzen", 28 | "taylor", 29 | "triang", 30 | "tukey", 31 | ] 32 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/_csc.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, Generic, Literal, overload 2 | from typing_extensions import TypeIs, TypeVar, override 3 | 4 | import numpy as np 5 | import optype as op 6 | import optype.numpy as onp 7 | 8 | from ._base import sparray 9 | from ._compressed import _cs_matrix 10 | from ._matrix import spmatrix 11 | from ._typing import Index1D, Numeric 12 | 13 | __all__ = ["csc_array", "csc_matrix", "isspmatrix_csc"] 14 | 15 | _SCT = TypeVar("_SCT", bound=Numeric, default=Any) 16 | 17 | ### 18 | 19 | class _csc_base(_cs_matrix[_SCT, tuple[int, int]], Generic[_SCT]): 20 | @property 21 | @override 22 | def format(self, /) -> Literal["csc"]: ... 23 | @property 24 | @override 25 | def ndim(self, /) -> Literal[2]: ... 26 | @property 27 | @override 28 | def shape(self, /) -> tuple[int, int]: ... 29 | 30 | # 31 | @overload 32 | def count_nonzero(self, /, axis: None = None) -> int: ... 33 | @overload 34 | def count_nonzero(self, /, axis: op.CanIndex) -> onp.Array1D[np.intp]: ... 35 | 36 | class csc_array(_csc_base[_SCT], sparray[_SCT, tuple[int, int]], Generic[_SCT]): ... 37 | 38 | class csc_matrix(_csc_base[_SCT], spmatrix[_SCT], Generic[_SCT]): 39 | # NOTE: using `@override` together with `@overload` causes stubtest to crash... 40 | @overload 41 | def getnnz(self, /, axis: None = None) -> int: ... 42 | @overload 43 | def getnnz(self, /, axis: op.CanIndex) -> Index1D: ... 44 | 45 | def isspmatrix_csc(x: object) -> TypeIs[csc_matrix]: ... 46 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/_matrix_io.pyi: -------------------------------------------------------------------------------- 1 | from typing import Final, Literal, Protocol, TypeAlias, TypedDict, type_check_only 2 | 3 | import optype as op 4 | 5 | from ._bsr import bsr_array, bsr_matrix 6 | from ._coo import coo_array, coo_matrix 7 | from ._csc import csc_array, csc_matrix 8 | from ._csr import csr_array, csr_matrix 9 | from ._data import _data_matrix 10 | from ._dia import dia_array, dia_matrix 11 | 12 | __all__ = ["load_npz", "save_npz"] 13 | 14 | _DataArrayOut: TypeAlias = bsr_array | coo_array | csc_array | csr_array | dia_array 15 | _DataMatrixOut: TypeAlias = bsr_matrix | coo_matrix | csc_matrix | csr_matrix | dia_matrix 16 | 17 | @type_check_only 18 | class _CanReadAndSeekBytes(Protocol): 19 | def read(self, length: int = ..., /) -> bytes: ... 20 | def seek(self, offset: int, whence: int, /) -> object: ... 21 | 22 | @type_check_only 23 | class _PickleKwargs(TypedDict): 24 | allow_pickle: Literal[False] 25 | 26 | ### 27 | 28 | PICKLE_KWARGS: Final[_PickleKwargs] = ... 29 | 30 | def load_npz(file: op.io.ToPath | _CanReadAndSeekBytes) -> _DataArrayOut | _DataMatrixOut: ... 31 | def save_npz(file: op.io.ToPath[str] | op.io.CanWrite[bytes], matrix: _data_matrix, compressed: op.CanBool = True) -> None: ... 32 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/_spfuncs.pyi: -------------------------------------------------------------------------------- 1 | from typing import Literal as L, TypeAlias, TypeVar 2 | 3 | import optype.numpy as onp 4 | 5 | from ._base import _spbase 6 | from ._typing import Floating 7 | 8 | __all__ = ["count_blocks", "estimate_blocksize"] 9 | 10 | _SizeT = TypeVar("_SizeT", bound=int) 11 | _BlockSize: TypeAlias = tuple[_SizeT, _SizeT] 12 | 13 | def estimate_blocksize( 14 | A: _spbase | onp.ToComplex2D, efficiency: float | Floating = 0.7 15 | ) -> _BlockSize[L[1]] | _BlockSize[L[2]] | _BlockSize[L[3]] | _BlockSize[L[4]] | _BlockSize[L[6]]: ... 16 | 17 | # 18 | def count_blocks(A: _spbase | onp.ToComplex2D, blocksize: tuple[onp.ToJustInt, onp.ToJustInt]) -> int: ... 19 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/_typing.pyi: -------------------------------------------------------------------------------- 1 | # NOTE(scipy-stubs): This ia a module only exists `if typing.TYPE_CHECKING: ...` 2 | from typing import Literal, TypeAlias 3 | from typing_extensions import TypeAliasType 4 | 5 | import numpy as np 6 | import optype as op 7 | import optype.numpy as onp 8 | from optype.numpy.compat import complexfloating as CFloating, integer as Integer 9 | 10 | __all__ = ( 11 | "CFloating", 12 | "Floating", 13 | "Index1D", 14 | "Integer", 15 | "Numeric", 16 | "SPFormat", 17 | "ToShape1D", 18 | "ToShape1D", 19 | "ToShape2D", 20 | "ToShapeMin1D", 21 | "ToShapeMin3D", 22 | ) 23 | 24 | ### 25 | 26 | # NOTE: The `TypeAliasType`s are used to avoid long error messages. 27 | Floating = TypeAliasType("Floating", np.float32 | np.float64 | np.longdouble) 28 | # NOTE: This (almost always) matches `scipy.sparse._sputils.supported_dtypes` 29 | Numeric = TypeAliasType("Numeric", np.bool_ | Integer | Floating | CFloating) 30 | 31 | Index1D: TypeAlias = onp.Array1D[np.int32 | np.int64] 32 | 33 | ToShape1D: TypeAlias = tuple[op.CanIndex] # ndim == 1 34 | ToShape2D: TypeAlias = tuple[op.CanIndex, op.CanIndex] # ndim == 2 35 | ToShapeMin1D: TypeAlias = tuple[op.CanIndex, *tuple[op.CanIndex, ...]] # ndim >= 1 36 | ToShapeMin3D: TypeAlias = tuple[op.CanIndex, op.CanIndex, op.CanIndex, *tuple[op.CanIndex, ...]] # ndim >= 2 37 | 38 | SPFormat: TypeAlias = Literal["bsr", "coo", "csc", "csr", "dia", "dok", "lil"] 39 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/base.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | from typing_extensions import deprecated 4 | 5 | from . import _base, _matrix 6 | 7 | __all__ = ["SparseEfficiencyWarning", "SparseWarning", "issparse", "isspmatrix", "spmatrix"] 8 | 9 | @deprecated("will be removed in SciPy v2.0.0") 10 | class SparseWarning(_base.SparseWarning): ... 11 | 12 | @deprecated("will be removed in SciPy v2.0.0") 13 | class SparseEfficiencyWarning(_base.SparseEfficiencyWarning): ... 14 | 15 | @deprecated("will be removed in SciPy v2.0.0") 16 | class spmatrix(_matrix.spmatrix): ... 17 | 18 | @deprecated("will be removed in SciPy v2.0.0") 19 | def issparse(x: object) -> bool: ... 20 | @deprecated("will be removed in SciPy v2.0.0") 21 | def isspmatrix(x: object) -> bool: ... 22 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/bsr.pyi: -------------------------------------------------------------------------------- 1 | # ruff: noqa: ANN401 2 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 3 | 4 | from typing import Any 5 | from typing_extensions import deprecated 6 | 7 | from . import _bsr, _matrix 8 | 9 | __all__ = ["bsr_matrix", "isspmatrix_bsr", "spmatrix"] 10 | 11 | @deprecated("will be removed in SciPy v2.0.0") 12 | class spmatrix(_matrix.spmatrix): ... 13 | 14 | @deprecated("will be removed in SciPy v2.0.0") 15 | class bsr_matrix(_bsr.bsr_matrix): ... 16 | 17 | @deprecated("will be removed in SciPy v2.0.0") 18 | def isspmatrix_bsr(x: object) -> Any: ... 19 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/compressed.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | from typing_extensions import deprecated 4 | 5 | from . import _base 6 | 7 | __all__ = ["SparseEfficiencyWarning"] 8 | 9 | @deprecated("will be removed in SciPy v2.0.0") 10 | class SparseEfficiencyWarning(_base.SparseEfficiencyWarning): ... 11 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/coo.pyi: -------------------------------------------------------------------------------- 1 | # ruff: noqa: ANN401 2 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 3 | 4 | from typing import Any 5 | from typing_extensions import deprecated 6 | 7 | from . import _base, _coo, _matrix 8 | 9 | __all__ = ["SparseEfficiencyWarning", "coo_matrix", "isspmatrix_coo", "spmatrix"] 10 | 11 | @deprecated("will be removed in SciPy v2.0.0") 12 | class SparseEfficiencyWarning(_base.SparseEfficiencyWarning): ... 13 | 14 | @deprecated("will be removed in SciPy v2.0.0") 15 | class spmatrix(_matrix.spmatrix): ... 16 | 17 | @deprecated("will be removed in SciPy v2.0.0") 18 | class coo_matrix(_coo.coo_matrix): ... 19 | 20 | @deprecated("will be removed in SciPy v2.0.0") 21 | def isspmatrix_coo(x: object) -> Any: ... 22 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/csc.pyi: -------------------------------------------------------------------------------- 1 | # ruff: noqa: ANN401 2 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 3 | 4 | from typing import Any 5 | from typing_extensions import deprecated 6 | 7 | from . import _base, _csc 8 | 9 | __all__ = ["csc_matrix", "isspmatrix_csc", "spmatrix"] 10 | 11 | @deprecated("will be removed in SciPy v2.0.0") 12 | class spmatrix(_base.spmatrix): ... 13 | 14 | @deprecated("will be removed in SciPy v2.0.0") 15 | class csc_matrix(_csc.csc_matrix): ... 16 | 17 | @deprecated("will be removed in SciPy v2.0.0") 18 | def isspmatrix_csc(x: object) -> Any: ... 19 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/csgraph/__init__.pyi: -------------------------------------------------------------------------------- 1 | from ._flow import maximum_flow 2 | from ._laplacian import laplacian 3 | from ._matching import maximum_bipartite_matching, min_weight_full_bipartite_matching 4 | from ._min_spanning_tree import minimum_spanning_tree 5 | from ._reordering import reverse_cuthill_mckee, structural_rank 6 | from ._shortest_path import NegativeCycleError, bellman_ford, dijkstra, floyd_warshall, johnson, shortest_path, yen 7 | from ._tools import ( 8 | construct_dist_matrix, 9 | csgraph_from_dense, 10 | csgraph_from_masked, 11 | csgraph_masked_from_dense, 12 | csgraph_to_dense, 13 | csgraph_to_masked, 14 | reconstruct_path, 15 | ) 16 | from ._traversal import breadth_first_order, breadth_first_tree, connected_components, depth_first_order, depth_first_tree 17 | 18 | __all__ = [ 19 | "NegativeCycleError", 20 | "bellman_ford", 21 | "breadth_first_order", 22 | "breadth_first_tree", 23 | "connected_components", 24 | "construct_dist_matrix", 25 | "csgraph_from_dense", 26 | "csgraph_from_masked", 27 | "csgraph_masked_from_dense", 28 | "csgraph_to_dense", 29 | "csgraph_to_masked", 30 | "depth_first_order", 31 | "depth_first_tree", 32 | "dijkstra", 33 | "floyd_warshall", 34 | "johnson", 35 | "laplacian", 36 | "maximum_bipartite_matching", 37 | "maximum_flow", 38 | "min_weight_full_bipartite_matching", 39 | "minimum_spanning_tree", 40 | "reconstruct_path", 41 | "reverse_cuthill_mckee", 42 | "shortest_path", 43 | "structural_rank", 44 | "yen", 45 | ] 46 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/csgraph/_flow.pyi: -------------------------------------------------------------------------------- 1 | from typing import Final, Literal 2 | 3 | import numpy as np 4 | 5 | from scipy.sparse import csr_array 6 | 7 | ### 8 | 9 | DTYPE: Final[type[np.float64]] = ... 10 | ITYPE: Final[type[np.int32]] = ... 11 | 12 | class MaximumFlowResult: 13 | flow_value: Final[int | np.int32 | np.int64] 14 | flow: csr_array[np.float64, tuple[int, int]] 15 | 16 | def __init__(self, /, flow_value: int | np.int32 | np.int64, flow: csr_array[np.float64, tuple[int, int]]) -> None: ... 17 | 18 | def maximum_flow( 19 | csgraph: csr_array, source: int, sink: int, *, method: Literal["edmonds_karp", "dinic"] = "dinic" 20 | ) -> MaximumFlowResult: ... 21 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/csgraph/_laplacian.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, Literal, TypeAlias, overload 2 | 3 | import numpy as np 4 | import numpy.typing as npt 5 | import optype.numpy as onp 6 | 7 | from scipy._typing import Falsy, Truthy 8 | from scipy.sparse._base import _spbase 9 | from scipy.sparse.linalg import LinearOperator 10 | 11 | _LaplacianMatrix: TypeAlias = onp.Array2D[np.number[Any]] | _spbase | LinearOperator 12 | _LaplacianDiag: TypeAlias = onp.Array1D[np.number[Any]] 13 | _ToCSGraph: TypeAlias = onp.ToComplex2D | _spbase 14 | _Form: TypeAlias = Literal["array", "function", "lo"] 15 | 16 | ### 17 | 18 | @overload 19 | def laplacian( 20 | csgraph: _ToCSGraph, 21 | normed: bool = False, 22 | return_diag: Falsy = False, 23 | use_out_degree: bool = False, 24 | *, 25 | copy: bool = True, 26 | form: _Form = "array", 27 | dtype: npt.DTypeLike | None = None, 28 | symmetrized: bool = False, 29 | ) -> _LaplacianMatrix: ... 30 | @overload 31 | def laplacian( 32 | csgraph: _ToCSGraph, 33 | normed: bool, 34 | return_diag: Truthy, 35 | use_out_degree: bool = False, 36 | *, 37 | copy: bool = True, 38 | form: _Form = "array", 39 | dtype: npt.DTypeLike | None = None, 40 | symmetrized: bool = False, 41 | ) -> tuple[_LaplacianMatrix, _LaplacianDiag]: ... 42 | @overload 43 | def laplacian( 44 | csgraph: _ToCSGraph, 45 | normed: bool = False, 46 | *, 47 | return_diag: Truthy, 48 | use_out_degree: bool = False, 49 | copy: bool = True, 50 | form: _Form = "array", 51 | dtype: npt.DTypeLike | None = None, 52 | symmetrized: bool = False, 53 | ) -> tuple[_LaplacianMatrix, _LaplacianDiag]: ... 54 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/csgraph/_matching.pyi: -------------------------------------------------------------------------------- 1 | from typing import Final, Literal, TypeAlias 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | from scipy.sparse import csr_array, csr_matrix 7 | from scipy.sparse._coo import coo_array, coo_matrix 8 | from scipy.sparse._csc import csc_array, csc_matrix 9 | 10 | _CXXArray: TypeAlias = csr_array | csr_matrix | csc_array | csc_matrix | coo_array | coo_matrix 11 | _IntVector: TypeAlias = onp.Array1D[np.int32 | np.intp] 12 | 13 | DTYPE: Final[type[np.float64]] = ... 14 | ITYPE: Final[type[np.int32]] = ... 15 | BTYPE: Final[type[np.uint8]] = ... 16 | 17 | def maximum_bipartite_matching(graph: _CXXArray, perm_type: Literal["row", "column"] = "row") -> _IntVector: ... 18 | def min_weight_full_bipartite_matching(biadjacency: _CXXArray, maximize: bool = False) -> tuple[_IntVector, _IntVector]: ... 19 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/csgraph/_min_spanning_tree.pyi: -------------------------------------------------------------------------------- 1 | from typing import Final, TypeAlias 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | from scipy.sparse import csr_matrix 7 | from scipy.sparse._base import _spbase 8 | from scipy.sparse._typing import Floating, Integer 9 | 10 | _Real: TypeAlias = Integer | Floating 11 | _ToGraph: TypeAlias = onp.ToFloat2D | _spbase[_Real, tuple[int, int]] 12 | 13 | ### 14 | 15 | DTYPE: Final[type[np.float64]] = ... 16 | ITYPE: Final[type[np.int32]] = ... 17 | 18 | def minimum_spanning_tree(csgraph: onp.ToFloat2D | _ToGraph, overwrite: bool = False) -> csr_matrix[_Real]: ... 19 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/csgraph/_reordering.pyi: -------------------------------------------------------------------------------- 1 | from typing import Final, TypeAlias 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | from scipy.sparse import coo_array, coo_matrix, csc_array, csc_matrix, csr_array, csr_matrix 7 | 8 | _CSXArray: TypeAlias = csr_array | csr_matrix | csc_array | csc_matrix 9 | _CXXArray: TypeAlias = _CSXArray | coo_array | coo_matrix 10 | 11 | DTYPE: Final[type[np.float64]] = ... 12 | ITYPE: Final[type[np.int32]] = ... 13 | 14 | def reverse_cuthill_mckee(graph: _CSXArray, symmetric_mode: bool = False) -> onp.Array1D[np.int32]: ... 15 | def structural_rank(graph: _CXXArray) -> np.intp: ... 16 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/csgraph/_validation.pyi: -------------------------------------------------------------------------------- 1 | from typing import Final, TypeAlias 2 | 3 | import numpy as np 4 | import numpy.typing as npt 5 | import optype.numpy as onp 6 | 7 | from scipy.sparse._base import _spbase 8 | from scipy.sparse._typing import Floating, Integer 9 | 10 | _Real: TypeAlias = Integer | Floating 11 | _ToGraph: TypeAlias = onp.ToFloat2D | _spbase[_Real, tuple[int, int]] 12 | 13 | ### 14 | 15 | DTYPE: Final[type[np.float64]] = ... 16 | 17 | def validate_graph( 18 | csgraph: _ToGraph, 19 | directed: bool, 20 | dtype: npt.DTypeLike = ..., 21 | csr_output: bool = True, 22 | dense_output: bool = True, 23 | copy_if_dense: bool = False, 24 | copy_if_sparse: bool = False, 25 | null_value_in: float = 0, 26 | null_value_out: float = ..., 27 | infinity_null: bool = True, 28 | nan_null: bool = True, 29 | ) -> onp.Array2D[_Real]: ... 30 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/csr.pyi: -------------------------------------------------------------------------------- 1 | # ruff: noqa: ANN401 2 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 3 | 4 | from typing import Any 5 | from typing_extensions import deprecated 6 | 7 | from . import _csr, _matrix 8 | 9 | __all__ = ["csr_matrix", "isspmatrix_csr", "spmatrix"] 10 | 11 | @deprecated("will be removed in SciPy v2.0.0") 12 | class spmatrix(_matrix.spmatrix): ... 13 | 14 | @deprecated("will be removed in SciPy v2.0.0") 15 | class csr_matrix(_csr.csr_matrix): ... 16 | 17 | @deprecated("will be removed in SciPy v2.0.0") 18 | def isspmatrix_csr(x: object) -> Any: ... 19 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/data.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | __all__: list[str] = [] 3 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/dia.pyi: -------------------------------------------------------------------------------- 1 | # ruff: noqa: ANN401 2 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 3 | 4 | from typing import Any 5 | from typing_extensions import deprecated 6 | 7 | from . import _dia, _matrix 8 | 9 | __all__ = ["dia_matrix", "isspmatrix_dia", "spmatrix"] 10 | 11 | @deprecated("will be removed in SciPy v2.0.0") 12 | class spmatrix(_matrix.spmatrix): ... 13 | 14 | @deprecated("will be removed in SciPy v2.0.0") 15 | class dia_matrix(_dia.dia_matrix): ... 16 | 17 | @deprecated("will be removed in SciPy v2.0.0") 18 | def isspmatrix_dia(x: object) -> Any: ... 19 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/dok.pyi: -------------------------------------------------------------------------------- 1 | # ruff: noqa: ANN401 2 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 3 | 4 | from typing import Any 5 | from typing_extensions import deprecated 6 | 7 | from . import _dok, _matrix 8 | 9 | __all__ = ["dok_matrix", "isspmatrix_dok", "spmatrix"] 10 | 11 | @deprecated("will be removed in SciPy v2.0.0") 12 | class spmatrix(_matrix.spmatrix): ... 13 | 14 | @deprecated("will be removed in SciPy v2.0.0") 15 | class dok_matrix(_dok.dok_matrix): ... 16 | 17 | @deprecated("will be removed in SciPy v2.0.0") 18 | def isspmatrix_dok(x: object) -> Any: ... 19 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/extract.pyi: -------------------------------------------------------------------------------- 1 | # ruff: noqa: ANN401 2 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 3 | 4 | from typing import Any 5 | from typing_extensions import deprecated 6 | 7 | from . import _coo 8 | 9 | __all__ = ["coo_matrix", "find", "tril", "triu"] 10 | 11 | @deprecated("will be removed in SciPy v2.0.0") 12 | class coo_matrix(_coo.coo_matrix): ... 13 | 14 | @deprecated("will be removed in SciPy v2.0.0") 15 | def find(A: object) -> Any: ... 16 | @deprecated("will be removed in SciPy v2.0.0") 17 | def tril(A: object, k: object = ..., format: object = ...) -> Any: ... 18 | @deprecated("will be removed in SciPy v2.0.0") 19 | def triu(A: object, k: object = ..., format: object = ...) -> Any: ... 20 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/lil.pyi: -------------------------------------------------------------------------------- 1 | # ruff: noqa: ANN401 2 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 3 | 4 | from typing import Any 5 | from typing_extensions import deprecated 6 | 7 | from . import _lil 8 | 9 | __all__ = ["isspmatrix_lil", "lil_array", "lil_matrix"] 10 | 11 | @deprecated("will be removed in SciPy v2.0.0") 12 | class lil_array(_lil.lil_array): ... 13 | 14 | @deprecated("will be removed in SciPy v2.0.0") 15 | class lil_matrix(_lil.lil_matrix): ... 16 | 17 | @deprecated("will be removed in SciPy v2.0.0") 18 | def isspmatrix_lil(x: object) -> Any: ... 19 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/linalg/__init__.pyi: -------------------------------------------------------------------------------- 1 | from . import dsolve, eigen, interface, isolve, matfuncs 2 | from ._dsolve import ( 3 | MatrixRankWarning, 4 | SuperLU, 5 | factorized, 6 | is_sptriangular, 7 | spbandwidth, 8 | spilu, 9 | splu, 10 | spsolve, 11 | spsolve_triangular, 12 | use_solver, 13 | ) 14 | from ._eigen import ArpackError, ArpackNoConvergence, eigs, eigsh, lobpcg, svds 15 | from ._expm_multiply import expm_multiply 16 | from ._interface import LinearOperator, aslinearoperator 17 | from ._isolve import bicg, bicgstab, cg, cgs, gcrotmk, gmres, lgmres, lsmr, lsqr, minres, qmr, tfqmr 18 | from ._matfuncs import expm, inv, matrix_power 19 | from ._norm import norm 20 | from ._onenormest import onenormest 21 | from ._special_sparse_arrays import LaplacianNd 22 | 23 | __all__ = [ 24 | "ArpackError", 25 | "ArpackNoConvergence", 26 | "LaplacianNd", 27 | "LinearOperator", 28 | "MatrixRankWarning", 29 | "SuperLU", 30 | "aslinearoperator", 31 | "bicg", 32 | "bicgstab", 33 | "cg", 34 | "cgs", 35 | "dsolve", 36 | "eigen", 37 | "eigs", 38 | "eigsh", 39 | "expm", 40 | "expm_multiply", 41 | "factorized", 42 | "gcrotmk", 43 | "gmres", 44 | "interface", 45 | "inv", 46 | "is_sptriangular", 47 | "isolve", 48 | "lgmres", 49 | "lobpcg", 50 | "lsmr", 51 | "lsqr", 52 | "matfuncs", 53 | "matrix_power", 54 | "minres", 55 | "norm", 56 | "onenormest", 57 | "qmr", 58 | "spbandwidth", 59 | "spilu", 60 | "splu", 61 | "spsolve", 62 | "spsolve_triangular", 63 | "svds", 64 | "tfqmr", 65 | "use_solver", 66 | ] 67 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/linalg/_dsolve/__init__.pyi: -------------------------------------------------------------------------------- 1 | from . import linsolve as linsolve 2 | from ._superlu import SuperLU 3 | from .linsolve import ( 4 | MatrixRankWarning, 5 | factorized, 6 | is_sptriangular, 7 | spbandwidth, 8 | spilu, 9 | splu, 10 | spsolve, 11 | spsolve_triangular, 12 | use_solver, 13 | ) 14 | 15 | __all__ = [ 16 | "MatrixRankWarning", 17 | "SuperLU", 18 | "factorized", 19 | "is_sptriangular", 20 | "spbandwidth", 21 | "spilu", 22 | "splu", 23 | "spsolve", 24 | "spsolve_triangular", 25 | "use_solver", 26 | ] 27 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/linalg/_eigen/__init__.pyi: -------------------------------------------------------------------------------- 1 | from . import arpack as arpack 2 | from ._svds import svds 3 | from .arpack import ArpackError, ArpackNoConvergence, eigs, eigsh 4 | from .lobpcg import lobpcg 5 | 6 | __all__ = ["ArpackError", "ArpackNoConvergence", "eigs", "eigsh", "lobpcg", "svds"] 7 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/linalg/_eigen/_svds.pyi: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | from typing import Literal, TypeAlias, TypeVar 3 | 4 | import numpy as np 5 | import optype.numpy as onp 6 | 7 | from scipy._typing import ToRNG 8 | from scipy.sparse._base import _spbase 9 | from scipy.sparse.linalg import LinearOperator 10 | 11 | __all__ = ["svds"] 12 | 13 | _SCT = TypeVar("_SCT", bound=np.float32 | np.float64 | np.complex64 | np.complex128) 14 | _ToMatrix: TypeAlias = onp.ArrayND[_SCT] | LinearOperator[_SCT] | _spbase 15 | 16 | _Which: TypeAlias = Literal["LM", "SM"] 17 | _ReturnSingularVectors: TypeAlias = Literal["u", "v"] | bool 18 | _Solver: TypeAlias = Literal["arpack", "propack", "lobpcg"] 19 | 20 | ### 21 | 22 | def svds( 23 | A: _ToMatrix[_SCT], 24 | k: int = 6, 25 | ncv: int | None = None, 26 | tol: float = 0, 27 | which: _Which = "LM", 28 | v0: onp.ArrayND[_SCT] | None = None, 29 | maxiter: int | None = None, 30 | return_singular_vectors: _ReturnSingularVectors = True, 31 | solver: _Solver = "arpack", 32 | rng: ToRNG = None, 33 | options: Mapping[str, object] | None = None, 34 | ) -> tuple[onp.Array2D[_SCT], onp.ArrayND[np.float32 | np.float64], onp.ArrayND[_SCT]]: ... 35 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/linalg/_eigen/arpack/__init__.pyi: -------------------------------------------------------------------------------- 1 | from .arpack import ArpackError as ArpackError, ArpackNoConvergence as ArpackNoConvergence, eigs as eigs, eigsh as eigsh 2 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/linalg/_eigen/lobpcg/__init__.pyi: -------------------------------------------------------------------------------- 1 | from .lobpcg import lobpcg 2 | 3 | __all__ = ["lobpcg"] 4 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/linalg/_expm_multiply.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, TypeVar, overload 2 | 3 | import numpy as np 4 | import optype as op 5 | import optype.numpy as onp 6 | 7 | from scipy.sparse._typing import Numeric 8 | from scipy.sparse.linalg._interface import LinearOperator 9 | 10 | __all__ = ["expm_multiply"] 11 | 12 | _SCT = TypeVar("_SCT", bound=Numeric) 13 | 14 | ### 15 | 16 | @overload # 1-d 17 | def expm_multiply( 18 | A: LinearOperator[_SCT], 19 | B: onp.Array1D[_SCT | np.integer[Any] | np.float16 | np.bool_], 20 | start: onp.ToFloat | None = None, 21 | stop: onp.ToFloat | None = None, 22 | num: op.CanIndex | None = None, 23 | endpoint: bool | None = None, 24 | traceA: onp.ToComplex | None = None, 25 | ) -> onp.Array1D[_SCT]: ... 26 | @overload # 2-d 27 | def expm_multiply( 28 | A: LinearOperator[_SCT], 29 | B: onp.Array2D[_SCT | np.integer[Any] | np.float16 | np.bool_], 30 | start: onp.ToFloat | None = None, 31 | stop: onp.ToFloat | None = None, 32 | num: op.CanIndex | None = None, 33 | endpoint: bool | None = None, 34 | traceA: onp.ToComplex | None = None, 35 | ) -> onp.Array2D[_SCT]: ... 36 | @overload # 1-d or 2-d 37 | def expm_multiply( 38 | A: LinearOperator[_SCT], 39 | B: onp.ArrayND[_SCT | np.float16 | np.integer[Any] | np.bool_], 40 | start: onp.ToFloat | None = None, 41 | stop: onp.ToFloat | None = None, 42 | num: op.CanIndex | None = None, 43 | endpoint: bool | None = None, 44 | traceA: onp.ToComplex | None = None, 45 | ) -> onp.Array1D[_SCT] | onp.Array2D[_SCT]: ... 46 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/linalg/_isolve/__init__.pyi: -------------------------------------------------------------------------------- 1 | from ._gcrotmk import gcrotmk 2 | from .iterative import bicg, bicgstab, cg, cgs, gmres, qmr 3 | from .lgmres import lgmres 4 | from .lsmr import lsmr 5 | from .lsqr import lsqr 6 | from .minres import minres 7 | from .tfqmr import tfqmr 8 | 9 | __all__ = ["bicg", "bicgstab", "cg", "cgs", "gcrotmk", "gmres", "lgmres", "lsmr", "lsqr", "minres", "qmr", "tfqmr"] 10 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/linalg/_isolve/lsmr.pyi: -------------------------------------------------------------------------------- 1 | from typing import Literal, TypeAlias 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | from scipy.sparse._base import _spbase 7 | from scipy.sparse._typing import Floating, Integer 8 | from scipy.sparse.linalg import LinearOperator 9 | 10 | __all__ = ["lsmr"] 11 | 12 | _Float64: TypeAlias = float | np.float64 13 | _Real: TypeAlias = np.bool_ | Integer | Floating 14 | _ToRealMatrix: TypeAlias = onp.CanArrayND[_Real] | _spbase[_Real] | LinearOperator[_Real] 15 | 16 | _IStop: TypeAlias = Literal[0, 1, 2, 3, 4, 5, 6, 7] 17 | 18 | ### 19 | 20 | def lsmr( 21 | A: _ToRealMatrix, 22 | b: onp.ToFloat1D, 23 | damp: float | Floating = 0.0, 24 | atol: float | Floating = 1e-6, 25 | btol: float | Floating = 1e-6, 26 | conlim: onp.ToFloat = 1e8, 27 | maxiter: int | None = None, 28 | show: onp.ToBool = False, 29 | x0: onp.ToFloat1D | None = None, 30 | ) -> tuple[ 31 | onp.Array1D[np.float64], # x 32 | _IStop, # istop 33 | int, # itn 34 | _Float64, # normr 35 | _Float64, # normar 36 | _Float64, # norma 37 | _Float64, # conda 38 | _Float64, # normx 39 | ]: ... 40 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/linalg/_isolve/lsqr.pyi: -------------------------------------------------------------------------------- 1 | from typing import Literal, TypeAlias 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | from scipy.sparse._base import _spbase 7 | from scipy.sparse._typing import Floating, Integer 8 | from scipy.sparse.linalg import LinearOperator 9 | 10 | __all__ = ["lsqr"] 11 | 12 | _Float64: TypeAlias = float | np.float64 13 | _Real: TypeAlias = np.bool_ | Integer | Floating 14 | _ToRealMatrix: TypeAlias = onp.CanArrayND[_Real] | _spbase[_Real] | LinearOperator[_Real] 15 | 16 | _IStop: TypeAlias = Literal[0, 1, 2, 3, 4, 5, 6, 7] 17 | 18 | ### 19 | 20 | def lsqr( 21 | A: _ToRealMatrix, 22 | b: onp.ToFloat1D, 23 | damp: float | Floating = 0.0, 24 | atol: float | Floating = 1e-6, 25 | btol: float | Floating = 1e-6, 26 | conlim: onp.ToFloat = 1e8, 27 | iter_lim: int | None = None, 28 | show: onp.ToBool = False, 29 | calc_var: onp.ToBool = False, 30 | x0: onp.ToFloat1D | None = None, 31 | ) -> tuple[ 32 | onp.Array1D[np.float64], # x 33 | _IStop, # istop 34 | int, # itn 35 | _Float64, # r1norm 36 | _Float64, # r2norm 37 | _Float64, # anorm 38 | _Float64, # acond 39 | _Float64, # arnorm 40 | _Float64, # xnorm 41 | onp.Array1D[np.float64], # var 42 | ]: ... 43 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/linalg/_isolve/minres.pyi: -------------------------------------------------------------------------------- 1 | from collections.abc import Callable 2 | from typing import Any, TypeAlias 3 | from typing_extensions import TypeVar 4 | 5 | import numpy as np 6 | import optype.numpy as onp 7 | 8 | from scipy.sparse._base import _spbase 9 | from scipy.sparse._typing import Numeric 10 | from scipy.sparse.linalg import LinearOperator 11 | 12 | __all__ = ["minres"] 13 | 14 | _FloatT = TypeVar("_FloatT", bound=np.float32 | np.float64, default=np.float64) 15 | _ScalarT = TypeVar("_ScalarT", bound=Numeric) 16 | 17 | _Ignored: TypeAlias = object 18 | _ToInt: TypeAlias = np.integer[Any] | np.bool_ 19 | _ToLinearOperator: TypeAlias = onp.CanArrayND[_ScalarT] | _spbase[_ScalarT] | LinearOperator[_ScalarT] 20 | 21 | ### 22 | 23 | def minres( 24 | A: _ToLinearOperator[_FloatT | _ToInt], 25 | b: onp.ToFloat1D, 26 | x0: onp.ToFloat1D | None = None, 27 | *, 28 | rtol: onp.ToFloat = 1e-5, 29 | shift: onp.ToFloat = 0.0, 30 | maxiter: int | None = None, 31 | M: _ToLinearOperator[_FloatT | _ToInt] | None = None, 32 | callback: Callable[[onp.Array1D[_FloatT]], _Ignored] | None = None, 33 | show: onp.ToBool = False, 34 | check: onp.ToBool = False, 35 | ) -> tuple[onp.Array1D[_FloatT], int]: ... 36 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/linalg/_isolve/tfqmr.pyi: -------------------------------------------------------------------------------- 1 | from collections.abc import Callable 2 | from typing import Any, TypeAlias, overload 3 | from typing_extensions import TypeVar 4 | 5 | import numpy as np 6 | import optype.numpy as onp 7 | 8 | from scipy.sparse._base import _spbase 9 | from scipy.sparse._typing import Numeric 10 | from scipy.sparse.linalg import LinearOperator 11 | 12 | __all__ = ["tfqmr"] 13 | 14 | _FloatT = TypeVar("_FloatT", bound=np.float32 | np.float64, default=np.float64) 15 | _ComplexT = TypeVar("_ComplexT", bound=np.complex64 | np.complex128, default=np.complex128) 16 | _ScalarT = TypeVar("_ScalarT", bound=Numeric) 17 | 18 | _ToLinearOperator: TypeAlias = onp.CanArrayND[_ScalarT] | _spbase[_ScalarT] | LinearOperator[_ScalarT] 19 | 20 | _Ignored: TypeAlias = object 21 | _Callback: TypeAlias = Callable[[onp.Array1D[_ScalarT]], _Ignored] 22 | 23 | ### 24 | 25 | @overload # real 26 | def tfqmr( 27 | A: _ToLinearOperator[_FloatT | np.integer[Any] | np.bool_], 28 | b: onp.ToFloat1D, 29 | x0: onp.ToFloat1D | None = None, 30 | *, 31 | rtol: onp.ToFloat = 1e-5, 32 | atol: onp.ToFloat = 0.0, 33 | maxiter: int | None = None, 34 | M: _ToLinearOperator[_FloatT] | None = None, 35 | callback: _Callback[_FloatT] | None = None, 36 | show: onp.ToBool = False, 37 | ) -> tuple[onp.Array1D[_FloatT], int]: ... 38 | @overload # complex 39 | def tfqmr( 40 | A: _ToLinearOperator[_ComplexT], 41 | b: onp.ToComplex1D, 42 | x0: onp.ToComplex1D | None = None, 43 | *, 44 | rtol: onp.ToFloat = 1e-5, 45 | atol: onp.ToFloat = 0.0, 46 | maxiter: int | None = None, 47 | M: _ToLinearOperator[_ComplexT] | None = None, 48 | callback: _Callback[_ComplexT] | None = None, 49 | show: onp.ToBool = False, 50 | ) -> tuple[onp.Array1D[_ComplexT], int]: ... 51 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/linalg/_isolve/utils.pyi: -------------------------------------------------------------------------------- 1 | from _typeshed import IdentityFunction 2 | from typing import Final, Literal, TypeAlias, TypeVar 3 | 4 | import numpy as np 5 | import optype.numpy as onp 6 | 7 | from scipy.sparse._base import _spbase 8 | from scipy.sparse._typing import Numeric 9 | from scipy.sparse.linalg import LinearOperator 10 | 11 | __all__: list[str] = [] 12 | 13 | _T = TypeVar("_T") 14 | _Char: TypeAlias = Literal["f", "d", "F", "D"] 15 | _ToLinearOperator: TypeAlias = onp.CanArrayND[Numeric] | _spbase[Numeric] | LinearOperator[Numeric] 16 | _Inexact: TypeAlias = np.float32 | np.float64 | np.complex64 | np.complex128 17 | 18 | ### 19 | 20 | __docformat__: Final = "restructuredtext en" 21 | _coerce_rules: Final[dict[tuple[_Char, _Char], _Char]] 22 | 23 | def id(x: _T) -> _T: ... 24 | def coerce(x: str, y: str) -> _Char: ... 25 | def make_system( 26 | A: _ToLinearOperator, M: _ToLinearOperator | None, x0: onp.ToComplex1D | Literal["Mb"] | None, b: onp.ToComplex1D 27 | ) -> tuple[ 28 | LinearOperator, # A 29 | LinearOperator, # M 30 | onp.Array1D[_Inexact], # x 31 | onp.Array1D[_Inexact], # b 32 | IdentityFunction, # postprocess 33 | ]: ... 34 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/linalg/_matfuncs.pyi: -------------------------------------------------------------------------------- 1 | # mypy: disable-error-code="override" 2 | # pyright: reportIncompatibleMethodOverride=false 3 | 4 | from typing import Final, Generic, Literal, Self, TypeAlias 5 | from typing_extensions import TypeVar, override 6 | 7 | import optype as op 8 | import optype.numpy as onp 9 | 10 | from scipy.sparse._base import _spbase 11 | from scipy.sparse._typing import CFloating, Floating, Numeric 12 | 13 | from ._interface import LinearOperator 14 | 15 | __all__ = ["expm", "inv", "matrix_power"] 16 | 17 | _SCT_co = TypeVar("_SCT_co", covariant=True, bound=Numeric, default=Floating | CFloating) 18 | _SparseT = TypeVar("_SparseT", bound=_spbase) 19 | 20 | _Structure: TypeAlias = Literal["upper_triangular"] 21 | 22 | ### 23 | 24 | UPPER_TRIANGULAR: Final[_Structure] = "upper_triangular" 25 | 26 | class MatrixPowerOperator(LinearOperator[_SCT_co], Generic[_SCT_co]): 27 | @property 28 | @override 29 | def T(self, /) -> Self: ... 30 | def __init__(self, /, A: onp.Array2D[_SCT_co] | _spbase, p: int, structure: _Structure | None = None) -> None: ... 31 | 32 | class ProductOperator(LinearOperator[_SCT_co], Generic[_SCT_co]): 33 | @property 34 | @override 35 | def T(self, /) -> Self: ... 36 | def __init__(self, /, *args: onp.Array2D[_SCT_co] | _spbase, structure: _Structure | None = None) -> None: ... 37 | 38 | def inv(A: _SparseT) -> _SparseT: ... 39 | def expm(A: _SparseT) -> _SparseT: ... 40 | def matrix_power(A: _SparseT, power: op.CanIndex) -> _SparseT: ... 41 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/linalg/_norm.pyi: -------------------------------------------------------------------------------- 1 | from typing import Literal, TypeAlias, overload 2 | 3 | import numpy as np 4 | import optype as op 5 | import optype.numpy as onp 6 | 7 | from scipy.sparse._base import _spbase 8 | 9 | __all__ = ["norm"] 10 | 11 | _Ord: TypeAlias = Literal["fro", 0, 1, 2, -1] | float 12 | _Real: TypeAlias = np.int32 | np.int64 | np.float64 13 | 14 | ### 15 | 16 | @overload # no axis, two axes 17 | def norm(x: _spbase, ord: _Ord | None = None, axis: tuple[op.CanIndex, op.CanIndex] | None = None) -> _Real: ... 18 | @overload # single axis (positional) 19 | def norm(x: _spbase, ord: _Ord | None, axis: op.CanIndex) -> onp.Array1D[_Real]: ... 20 | @overload # single axis (keyword) 21 | def norm(x: _spbase, ord: _Ord | None = None, *, axis: op.CanIndex) -> onp.Array1D[_Real]: ... 22 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/linalg/interface.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | from typing_extensions import deprecated 3 | 4 | from . import _interface 5 | 6 | __all__ = ["LinearOperator", "aslinearoperator"] 7 | 8 | @deprecated("will be removed in SciPy v2.0.0") 9 | class LinearOperator(_interface.LinearOperator): ... 10 | 11 | @deprecated("will be removed in SciPy v2.0.0") 12 | def aslinearoperator(A: object) -> object: ... 13 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/linalg/matfuncs.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | from typing_extensions import deprecated 3 | 4 | from . import _interface 5 | 6 | __all__ = ["LinearOperator", "expm", "inv", "spsolve"] 7 | 8 | @deprecated("will be removed in SciPy v2.0.0") 9 | class LinearOperator(_interface.LinearOperator): ... 10 | 11 | @deprecated("will be removed in SciPy v2.0.0") 12 | def spsolve(A: object, b: object, permc_spec: object = ..., use_umfpack: object = ...) -> object: ... 13 | @deprecated("will be removed in SciPy v2.0.0") 14 | def expm(A: object) -> object: ... 15 | @deprecated("will be removed in SciPy v2.0.0") 16 | def inv(A: object) -> object: ... 17 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/sparsetools.pyi: -------------------------------------------------------------------------------- 1 | __all__: list[str] = [] 2 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/spfuncs.pyi: -------------------------------------------------------------------------------- 1 | __all__: list[str] = [] 2 | -------------------------------------------------------------------------------- /scipy-stubs/sparse/sputils.pyi: -------------------------------------------------------------------------------- 1 | __all__: list[str] = [] 2 | -------------------------------------------------------------------------------- /scipy-stubs/spatial/__init__.pyi: -------------------------------------------------------------------------------- 1 | from . import ckdtree, distance, kdtree, qhull, transform 2 | from ._ckdtree import cKDTree 3 | from ._geometric_slerp import geometric_slerp 4 | from ._kdtree import KDTree, Rectangle, distance_matrix, minkowski_distance, minkowski_distance_p 5 | from ._plotutils import convex_hull_plot_2d, delaunay_plot_2d, voronoi_plot_2d 6 | from ._procrustes import procrustes 7 | from ._qhull import ConvexHull, Delaunay, HalfspaceIntersection, QhullError, Voronoi, tsearch 8 | from ._spherical_voronoi import SphericalVoronoi 9 | 10 | __all__ = [ 11 | "ConvexHull", 12 | "Delaunay", 13 | "HalfspaceIntersection", 14 | "KDTree", 15 | "QhullError", 16 | "Rectangle", 17 | "SphericalVoronoi", 18 | "Voronoi", 19 | "cKDTree", 20 | "ckdtree", 21 | "convex_hull_plot_2d", 22 | "delaunay_plot_2d", 23 | "distance", 24 | "distance", 25 | "distance_matrix", 26 | "geometric_slerp", 27 | "kdtree", 28 | "minkowski_distance", 29 | "minkowski_distance_p", 30 | "procrustes", 31 | "qhull", 32 | "transform", 33 | "tsearch", 34 | "voronoi_plot_2d", 35 | ] 36 | -------------------------------------------------------------------------------- /scipy-stubs/spatial/_geometric_slerp.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, overload 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | __all__ = ["geometric_slerp"] 7 | 8 | @overload 9 | def geometric_slerp( 10 | start: onp.ToFloat1D, end: onp.ToFloat1D, t: float | np.floating[Any], tol: onp.ToFloat = 1e-07 11 | ) -> onp.Array1D[np.float64]: ... 12 | @overload 13 | def geometric_slerp( 14 | start: onp.ToFloat1D, end: onp.ToFloat1D, t: onp.ArrayND[np.floating[Any]], tol: onp.ToFloat = 1e-07 15 | ) -> onp.Array2D[np.float64]: ... 16 | @overload 17 | def geometric_slerp( 18 | start: onp.ToFloat1D, end: onp.ToFloat1D, t: onp.ToFloat1D, tol: onp.ToFloat = 1e-07 19 | ) -> onp.Array1D[np.float64] | onp.Array2D[np.float64]: ... 20 | -------------------------------------------------------------------------------- /scipy-stubs/spatial/_plotutils.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, TypeAlias, TypedDict 2 | from typing_extensions import Unpack 3 | 4 | from ._qhull import ConvexHull, Delaunay, Voronoi 5 | 6 | __all__ = ["convex_hull_plot_2d", "delaunay_plot_2d", "voronoi_plot_2d"] 7 | 8 | _Axes: TypeAlias = object 9 | _Figure: TypeAlias = Any 10 | 11 | class _VoronoiPlotKwargs(TypedDict, total=False): 12 | show_points: bool 13 | show_vertices: bool 14 | line_colors: str 15 | line_width: float 16 | line_alpha: float 17 | point_size: float 18 | 19 | def delaunay_plot_2d(tri: Delaunay, ax: _Axes | None = None) -> _Figure: ... 20 | def convex_hull_plot_2d(hull: ConvexHull, ax: _Axes | None = None) -> _Figure: ... 21 | def voronoi_plot_2d(vor: Voronoi, ax: _Axes | None = None, **kwargs: Unpack[_VoronoiPlotKwargs]) -> _Figure: ... 22 | -------------------------------------------------------------------------------- /scipy-stubs/spatial/_procrustes.pyi: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import optype.numpy as onp 3 | 4 | __all__ = ["procrustes"] 5 | 6 | def procrustes( 7 | data1: onp.ToFloat2D, data2: onp.ToFloat2D 8 | ) -> tuple[onp.ArrayND[np.float64], onp.ArrayND[np.float64], np.float64]: ... 9 | -------------------------------------------------------------------------------- /scipy-stubs/spatial/_spherical_voronoi.pyi: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import optype.numpy as onp 3 | 4 | __all__ = ["SphericalVoronoi"] 5 | 6 | def calculate_solid_angles(R: onp.ToComplexND) -> onp.ArrayND[np.float64]: ... 7 | 8 | class SphericalVoronoi: 9 | points: onp.Array2D[np.float64] 10 | center: onp.Array1D[np.float64] 11 | radius: float 12 | 13 | def __init__( 14 | self, /, points: onp.ToFloat2D, radius: float = 1, center: onp.ToFloat1D | None = None, threshold: float = 1e-06 15 | ) -> None: ... 16 | def sort_vertices_of_regions(self, /) -> None: ... 17 | def calculate_areas(self, /) -> onp.Array1D[np.float64]: ... 18 | -------------------------------------------------------------------------------- /scipy-stubs/spatial/_voronoi.pyi: -------------------------------------------------------------------------------- 1 | import optype.numpy as onp 2 | 3 | __all__ = ["sort_vertices_of_regions"] 4 | 5 | def sort_vertices_of_regions(simplices: onp.ArrayND, regions: list[list[int]]) -> None: ... 6 | -------------------------------------------------------------------------------- /scipy-stubs/spatial/ckdtree.pyi: -------------------------------------------------------------------------------- 1 | # This file is not meant for public use and will be removed in SciPy v2.0.0. 2 | # Use the `scipy.spatial` namespace for importing the functions 3 | # included below. 4 | from typing_extensions import deprecated 5 | 6 | from ._ckdtree import cKDTree as _cKDTree 7 | 8 | __all__ = ["cKDTree"] 9 | 10 | @deprecated("will be removed in SciPy v2.0.0") 11 | class cKDTree(_cKDTree): ... 12 | -------------------------------------------------------------------------------- /scipy-stubs/spatial/kdtree.pyi: -------------------------------------------------------------------------------- 1 | # This file is not meant for public use and will be removed in SciPy v2.0.0. 2 | # Use the `scipy.spatial` namespace for importing the functions 3 | # included below. 4 | from typing_extensions import deprecated 5 | 6 | from ._ckdtree import cKDTree as _cKDTree 7 | from ._kdtree import KDTree as _KDTree, Rectangle as _Rectangle 8 | 9 | __all__ = ["KDTree", "Rectangle", "cKDTree", "distance_matrix", "minkowski_distance", "minkowski_distance_p"] 10 | 11 | @deprecated("will be removed in SciPy v2.0.0") 12 | class cKDTree(_cKDTree): ... 13 | 14 | @deprecated("will be removed in SciPy v2.0.0") 15 | class KDTree(_KDTree): ... 16 | 17 | @deprecated("will be removed in SciPy v2.0.0") 18 | class Rectangle(_Rectangle): ... 19 | 20 | def minkowski_distance_p(x: object, y: object, p: object = ...) -> object: ... 21 | def minkowski_distance(x: object, y: object, p: object = ...) -> object: ... 22 | def distance_matrix(x: object, y: object, p: object = ..., threshold: object = ...) -> object: ... 23 | -------------------------------------------------------------------------------- /scipy-stubs/spatial/qhull.pyi: -------------------------------------------------------------------------------- 1 | # This file is not meant for public use and will be removed in SciPy v2.0.0. 2 | # Use the `scipy.spatial` namespace for importing the functions 3 | # included below. 4 | from typing_extensions import deprecated 5 | 6 | from ._qhull import ( 7 | ConvexHull as _ConvexHull, 8 | Delaunay as _Delaunay, 9 | HalfspaceIntersection as _HalfspaceIntersection, 10 | QhullError as _QhullError, 11 | Voronoi as _Voronoi, 12 | ) 13 | 14 | __all__ = ["ConvexHull", "Delaunay", "HalfspaceIntersection", "QhullError", "Voronoi", "tsearch"] 15 | 16 | @deprecated("will be removed in SciPy v2.0.0") 17 | class QhullError(_QhullError): ... 18 | 19 | @deprecated("will be removed in SciPy v2.0.0") 20 | class ConvexHull(_ConvexHull): ... 21 | 22 | @deprecated("will be removed in SciPy v2.0.0") 23 | class Delaunay(_Delaunay): ... 24 | 25 | @deprecated("will be removed in SciPy v2.0.0") 26 | class HalfspaceIntersection(_HalfspaceIntersection): ... 27 | 28 | @deprecated("will be removed in SciPy v2.0.0") 29 | class Voronoi(_Voronoi): ... 30 | 31 | @deprecated("will be removed in SciPy v2.0.0") 32 | def tsearch(tri: _Delaunay, xi: object) -> object: ... 33 | -------------------------------------------------------------------------------- /scipy-stubs/spatial/transform/__init__.pyi: -------------------------------------------------------------------------------- 1 | from . import rotation as rotation # deprecated namespace, to be removed in v2.0.0 2 | from ._rigid_transform import RigidTransform 3 | from ._rotation import Rotation, Slerp 4 | from ._rotation_spline import RotationSpline 5 | 6 | __all__ = ["RigidTransform", "Rotation", "RotationSpline", "Slerp"] 7 | -------------------------------------------------------------------------------- /scipy-stubs/spatial/transform/_rotation_spline.pyi: -------------------------------------------------------------------------------- 1 | from typing import ClassVar, Final, Literal, overload 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | from scipy.interpolate import PPoly 7 | 8 | from ._rotation import Rotation 9 | 10 | class RotationSpline: 11 | MAX_ITER: ClassVar[int] = 10 12 | TOL: ClassVar[float] = 1e-9 13 | 14 | times: Final[onp.Array1D[np.int32 | np.int64 | np.float32 | np.float64]] 15 | rotations: Final[Rotation] 16 | interpolator: Final[PPoly] 17 | 18 | def __init__(self, /, times: onp.ToFloat1D, rotations: Rotation) -> None: ... 19 | # 20 | @overload 21 | def __call__(self, /, times: onp.ToFloat1D, order: Literal[0] = 0) -> Rotation | onp.ArrayND[np.float64]: ... 22 | @overload 23 | def __call__(self, /, times: onp.ToFloat1D, order: Literal[1, 2]) -> onp.ArrayND[np.float64]: ... 24 | -------------------------------------------------------------------------------- /scipy-stubs/spatial/transform/rotation.pyi: -------------------------------------------------------------------------------- 1 | from typing_extensions import deprecated 2 | 3 | from . import _rotation 4 | 5 | __all__ = ["Rotation", "Slerp"] 6 | 7 | @deprecated("will be removed in SciPy v2.0.0") 8 | class Rotation(_rotation.Rotation): ... 9 | 10 | @deprecated("will be removed in SciPy v2.0.0") 11 | class Slerp(_rotation.Slerp): ... 12 | -------------------------------------------------------------------------------- /scipy-stubs/special/_add_newdocs.pyi: -------------------------------------------------------------------------------- 1 | from typing import Final, LiteralString 2 | 3 | docdict: Final[dict[str, str]] 4 | 5 | def get(name: LiteralString) -> str: ... 6 | def add_newdoc(name: LiteralString, doc: str) -> None: ... 7 | -------------------------------------------------------------------------------- /scipy-stubs/special/_ellip_harm.pyi: -------------------------------------------------------------------------------- 1 | from typing import Literal 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | def ellip_harm( 7 | h2: onp.ToFloat, 8 | k2: onp.ToFloat, 9 | n: onp.ToInt, 10 | p: onp.ToFloat, 11 | s: onp.ToFloat, 12 | signm: Literal[-1, 1] = 1, 13 | signn: Literal[-1, 1] = 1, 14 | ) -> np.float64: ... 15 | def ellip_harm_2(h2: onp.ToFloat, k2: onp.ToFloat, n: onp.ToInt, p: onp.ToInt, s: onp.ToFloat) -> onp.Array0D[np.float64]: ... 16 | def ellip_normal(h2: onp.ToFloat, k2: onp.ToFloat, n: onp.ToFloat, p: onp.ToFloat) -> onp.Array0D[np.float64]: ... 17 | -------------------------------------------------------------------------------- /scipy-stubs/special/_lambertw.pyi: -------------------------------------------------------------------------------- 1 | from typing import overload 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | @overload 7 | def lambertw(z: onp.ToComplex, k: onp.ToInt = 0, tol: float | np.float64 = 1e-8) -> np.complex128: ... 8 | @overload 9 | def lambertw(z: onp.ToComplex, k: onp.ToIntND, tol: float | np.float64 = 1e-8) -> onp.ArrayND[np.complex128]: ... 10 | @overload 11 | def lambertw(z: onp.ToComplexND, k: onp.ToInt | onp.ToIntND, tol: float | np.float64 = 1e-8) -> onp.ArrayND[np.complex128]: ... 12 | -------------------------------------------------------------------------------- /scipy-stubs/special/_sf_error.pyi: -------------------------------------------------------------------------------- 1 | class SpecialFunctionWarning(Warning): ... 2 | class SpecialFunctionError(Exception): ... 3 | -------------------------------------------------------------------------------- /scipy-stubs/special/_spfun_stats.pyi: -------------------------------------------------------------------------------- 1 | from typing import overload 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | __all__ = ["multigammaln"] 7 | 8 | @overload 9 | def multigammaln(a: onp.ToFloat, d: onp.ToInt) -> np.float64: ... 10 | @overload 11 | def multigammaln(a: onp.ToFloatND, d: onp.ToInt) -> onp.ArrayND[np.float64]: ... 12 | -------------------------------------------------------------------------------- /scipy-stubs/special/_support_alternative_backends.pyi: -------------------------------------------------------------------------------- 1 | from ._ufuncs import ( 2 | betainc, 3 | betaincc, 4 | chdtr, 5 | chdtrc, 6 | entr, 7 | erf, 8 | erfc, 9 | expit, 10 | gammainc, 11 | gammaincc, 12 | gammaln, 13 | i0, 14 | i0e, 15 | i1, 16 | i1e, 17 | log_ndtr, 18 | logit, 19 | ndtr, 20 | ndtri, 21 | rel_entr, 22 | stdtr, 23 | stdtrit, 24 | xlogy, 25 | ) 26 | 27 | __all__ = [ 28 | "betainc", 29 | "betaincc", 30 | "chdtr", 31 | "chdtrc", 32 | "entr", 33 | "erf", 34 | "erfc", 35 | "expit", 36 | "gammainc", 37 | "gammaincc", 38 | "gammaln", 39 | "i0", 40 | "i0e", 41 | "i1", 42 | "i1e", 43 | "log_ndtr", 44 | "logit", 45 | "ndtr", 46 | "ndtri", 47 | "rel_entr", 48 | "stdtr", 49 | "stdtrit", 50 | "xlogy", 51 | ] 52 | -------------------------------------------------------------------------------- /scipy-stubs/special/add_newdocs.pyi: -------------------------------------------------------------------------------- 1 | # Nothing to see here. 2 | 3 | __all__: list[str] = [] 4 | -------------------------------------------------------------------------------- /scipy-stubs/special/sf_error.pyi: -------------------------------------------------------------------------------- 1 | # This file is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | from typing_extensions import deprecated 4 | 5 | __all__ = ["SpecialFunctionError", "SpecialFunctionWarning"] 6 | 7 | @deprecated("will be removed in SciPy v2.0.0") 8 | class SpecialFunctionWarning(Warning): ... 9 | 10 | @deprecated("will be removed in SciPy v2.0.0") 11 | class SpecialFunctionError(Exception): ... 12 | -------------------------------------------------------------------------------- /scipy-stubs/special/specfun.pyi: -------------------------------------------------------------------------------- 1 | # This file is not meant for public use and will be removed in SciPy v2.0.0. 2 | 3 | from typing_extensions import deprecated 4 | 5 | __all__ = ["clpmn", "lpmn", "lpn", "lqmn", "pbdv"] 6 | 7 | # originally defined in scipy/special/_specfun.pyx 8 | @deprecated("will be removed in SciPy v2.0.0") 9 | def pbdv(v: object, x: object) -> object: ... 10 | @deprecated("will be removed in SciPy v2.0.0") 11 | def clpmn(m: object, n: object, z: object, type: object = ...) -> object: ... 12 | @deprecated("will be removed in SciPy v2.0.0") 13 | def lpmn(m: object, n: object, z: object) -> object: ... 14 | @deprecated("will be removed in SciPy v2.0.0") 15 | def lpn(n: object, z: object) -> object: ... 16 | @deprecated("will be removed in SciPy v2.0.0") 17 | def lqmn(m: object, n: object, z: object) -> object: ... 18 | -------------------------------------------------------------------------------- /scipy-stubs/special/spfun_stats.pyi: -------------------------------------------------------------------------------- 1 | # This file is not meant for public use and will be removed in SciPy v2.0.0. 2 | from typing_extensions import deprecated 3 | 4 | __all__ = ["multigammaln"] 5 | 6 | @deprecated("will be removed in SciPy v2.0.0") 7 | def multigammaln(a: object, d: object) -> object: ... 8 | -------------------------------------------------------------------------------- /scipy-stubs/stats/_axis_nan_policy.pyi: -------------------------------------------------------------------------------- 1 | too_small_1d_not_omit: str = ... 2 | too_small_1d_omit: str = ... 3 | too_small_nd_not_omit: str = ... 4 | too_small_nd_omit: str = ... 5 | 6 | class SmallSampleWarning(RuntimeWarning): ... 7 | -------------------------------------------------------------------------------- /scipy-stubs/stats/_binomtest.pyi: -------------------------------------------------------------------------------- 1 | from typing import Literal, TypeAlias 2 | 3 | from ._common import ConfidenceInterval 4 | 5 | _Alternative: TypeAlias = Literal["two-sided", "less", "greater"] 6 | 7 | class BinomTestResult: 8 | k: int 9 | n: int 10 | alternative: _Alternative 11 | statistic: float 12 | pvalue: float 13 | 14 | def __init__(self, /, k: int, n: int, alternative: _Alternative, statistic: float, pvalue: float) -> None: ... 15 | def proportion_ci( 16 | self, /, confidence_level: float = 0.95, method: Literal["exact", "wilson", "wilsoncc"] = "exact" 17 | ) -> ConfidenceInterval: ... 18 | 19 | def binomtest(k: int, n: int, p: float = 0.5, alternative: _Alternative = "two-sided") -> BinomTestResult: ... 20 | -------------------------------------------------------------------------------- /scipy-stubs/stats/_bws_test.pyi: -------------------------------------------------------------------------------- 1 | from typing import Literal 2 | 3 | import optype.numpy as onp 4 | 5 | from ._resampling import PermutationMethod, PermutationTestResult 6 | 7 | def bws_test( 8 | x: onp.ToComplex1D, 9 | y: onp.ToComplex1D, 10 | *, 11 | alternative: Literal["two-sided", "less", "greater"] = "two-sided", 12 | method: PermutationMethod | None = None, 13 | ) -> PermutationTestResult: ... 14 | -------------------------------------------------------------------------------- /scipy-stubs/stats/_censored_data.pyi: -------------------------------------------------------------------------------- 1 | from typing import Self 2 | 3 | import optype.numpy as onp 4 | 5 | class CensoredData: 6 | def __init__( 7 | self, 8 | /, 9 | uncensored: onp.ToComplex1D | None = None, 10 | *, 11 | left: onp.ToComplex1D | None = None, 12 | right: onp.ToComplex1D | None = None, 13 | interval: onp.ToFloat2D | None = None, 14 | ) -> None: ... 15 | def __sub__(self, other: object, /) -> CensoredData: ... 16 | def __truediv__(self, other: object, /) -> CensoredData: ... 17 | def __len__(self, /) -> int: ... 18 | def num_censored(self, /) -> int: ... 19 | @classmethod 20 | def right_censored(cls, x: onp.ToComplex1D, censored: onp.ToBool1D) -> Self: ... 21 | @classmethod 22 | def left_censored(cls, x: onp.ToComplex1D, censored: onp.ToBool1D) -> Self: ... 23 | @classmethod 24 | def interval_censored(cls, low: onp.ToComplex1D, high: onp.ToComplex1D) -> Self: ... 25 | -------------------------------------------------------------------------------- /scipy-stubs/stats/_common.pyi: -------------------------------------------------------------------------------- 1 | from typing import NamedTuple 2 | 3 | class ConfidenceInterval(NamedTuple): 4 | low: float 5 | high: float 6 | -------------------------------------------------------------------------------- /scipy-stubs/stats/_distr_params.pyi: -------------------------------------------------------------------------------- 1 | # 0 - 4 parameters (`'gausshyper'`) 2 | distcont: list[ 3 | tuple[str, tuple[()] | tuple[float] | tuple[float, float] | tuple[float, float, float] | tuple[float, float, float, float]] 4 | ] 5 | 6 | # 0 - 4 parameters (`'gausshyper'`) 7 | invdistcont: list[ 8 | tuple[str, tuple[()] | tuple[float] | tuple[float, float] | tuple[float, float, float] | tuple[float, float, float, float]] 9 | ] 10 | 11 | # 1 - 4 parameters (`'nchypergeom_fisher'` and `'nchypergeom_wallenius'`) 12 | distdiscrete: list[tuple[str, tuple[float] | tuple[float, float] | tuple[int, float, float] | tuple[int, int, int, float]]] 13 | # 1 - 4 parameters (`'nchypergeom_fisher'` and `'nchypergeom_wallenius'`) 14 | invdistdiscrete: list[tuple[str, tuple[float] | tuple[float, float] | tuple[int, float, float] | tuple[int, int, int, float]]] 15 | -------------------------------------------------------------------------------- /scipy-stubs/stats/_entropy.pyi: -------------------------------------------------------------------------------- 1 | # These stubs won't be used, because the implementation has type annotations, which unfortunately are incorrect. 2 | # This again shows that "no type annotations than wrong ones". 3 | # Anyway, these stubs are just for show, and perhaps could be used as an example of how to correctly annotate `_entropy.py`. 4 | from typing import Any, Literal 5 | 6 | import numpy as np 7 | import optype as op 8 | import optype.numpy as onp 9 | 10 | import scipy._typing as spt 11 | 12 | __all__ = ["differential_entropy", "entropy"] 13 | 14 | def entropy( 15 | pk: onp.ToFloatND, 16 | qk: onp.ToFloatND | None = None, 17 | base: onp.ToFloat | None = None, 18 | axis: int = 0, 19 | *, 20 | nan_policy: spt.NanPolicy = "propagate", 21 | keepdims: onp.ToBool = False, 22 | ) -> float | np.floating[Any] | onp.ArrayND[np.floating[Any]]: ... 23 | def differential_entropy( 24 | values: onp.ToFloatND, 25 | *, 26 | window_length: onp.ToInt | None = None, 27 | base: onp.ToFloat | None = None, 28 | axis: op.CanIndex = 0, 29 | method: Literal["vasicek", "van es", "ebrahimi", "correa", "auto"] = "auto", 30 | nan_policy: spt.NanPolicy = "propagate", 31 | keepdims: onp.ToBool = False, 32 | ) -> float | np.floating[Any] | onp.ArrayND[np.floating[Any]]: ... 33 | -------------------------------------------------------------------------------- /scipy-stubs/stats/_ksstats.pyi: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import optype as op 3 | import optype.numpy as onp 4 | 5 | def kolmogn(n: onp.ToInt | onp.ToIntND, x: onp.ToFloat | onp.ToFloatND, cdf: op.CanBool = True) -> onp.ArrayND[np.float64]: ... 6 | def kolmogni(n: onp.ToInt | onp.ToIntND, q: onp.ToFloat | onp.ToFloatND, cdf: op.CanBool = True) -> onp.ArrayND[np.float64]: ... 7 | def kolmognp(n: onp.ToInt | onp.ToIntND, x: onp.ToFloat | onp.ToFloatND) -> onp.ArrayND[np.float64]: ... 8 | -------------------------------------------------------------------------------- /scipy-stubs/stats/_levy_stable/__init__.pyi: -------------------------------------------------------------------------------- 1 | from collections.abc import Callable 2 | from typing import Final, Literal 3 | 4 | import numpy as np 5 | import optype.numpy as onp 6 | 7 | from scipy.stats.distributions import rv_continuous 8 | 9 | __all__ = ["levy_stable", "levy_stable_gen", "pdf_from_cf_with_fft"] 10 | 11 | Cotes: Final[onp.Array2D[np.float64]] = ... 12 | Cotes_table: Final[onp.Array1D[np.object_]] = ... 13 | levy_stable: Final[levy_stable_gen] = ... 14 | 15 | class levy_stable_gen(rv_continuous): 16 | parameterization: Literal["S0", "S1"] 17 | pdf_default_method: Literal["piecewise", "best", "zolotarev", "dni", "quadrature", "fft-simpson"] 18 | cdf_default_method: Literal["piecewise", "fft-simpson"] 19 | quad_eps: float 20 | piecewise_x_tol_near_zeta: float 21 | piecewise_alpha_tol_near_one: float 22 | pdf_fft_min_points_threshold: float | None 23 | pdf_fft_grid_spacing: float 24 | pdf_fft_n_points_two_power: float | None 25 | pdf_fft_interpolation_level: int 26 | pdf_fft_interpolation_degree: int 27 | 28 | def pdf_from_cf_with_fft( 29 | cf: Callable[[float], complex], h: float = 0.01, q: int = 9, level: int = 3 30 | ) -> tuple[onp.Array1D[np.float64], onp.Array1D[np.float64]]: ... 31 | -------------------------------------------------------------------------------- /scipy-stubs/stats/_levy_stable/levyst.pyi: -------------------------------------------------------------------------------- 1 | class Nolan: 2 | def __init__(self, /, alpha: float, beta: float, x0: float) -> None: ... 3 | def g(self, /, theta: float) -> float: ... 4 | @property 5 | def zeta(self, /) -> float: ... 6 | @property 7 | def xi(self, /) -> float: ... 8 | @property 9 | def c1(self, /) -> float: ... 10 | @property 11 | def c2(self, /) -> float: ... 12 | @property 13 | def c3(self, /) -> float: ... 14 | 15 | def __setstate_cython__(self: object, pyx_state: object, /) -> None: ... 16 | def __reduce_cython__(self: object) -> None: ... 17 | -------------------------------------------------------------------------------- /scipy-stubs/stats/_mannwhitneyu.pyi: -------------------------------------------------------------------------------- 1 | from typing import Generic, Literal, NamedTuple, TypeAlias 2 | from typing_extensions import TypeVar 3 | 4 | import numpy as np 5 | import optype.numpy as onp 6 | 7 | from scipy._typing import Alternative 8 | 9 | from ._resampling import PermutationMethod 10 | 11 | _FloatOrArray: TypeAlias = float | np.float64 | onp.ArrayND[np.float64] 12 | _FloatOrArrayT = TypeVar("_FloatOrArrayT", bound=_FloatOrArray, default=_FloatOrArray) 13 | 14 | class MannwhitneyuResult(NamedTuple, Generic[_FloatOrArrayT]): 15 | statistic: _FloatOrArrayT 16 | pvalue: _FloatOrArrayT 17 | 18 | def mannwhitneyu( 19 | x: onp.ToFloatND, 20 | y: onp.ToFloatND, 21 | use_continuity: bool = True, 22 | alternative: Alternative = "two-sided", 23 | axis: int = 0, 24 | method: Literal["auto", "asymptotic", "exact"] | PermutationMethod = "auto", 25 | *, 26 | nan_policy: Literal["propagate", "raise", "coerce", "omit"] = "propagate", 27 | keepdims: bool = False, 28 | ) -> MannwhitneyuResult: ... 29 | -------------------------------------------------------------------------------- /scipy-stubs/stats/_mgc.pyi: -------------------------------------------------------------------------------- 1 | from collections.abc import Callable, Iterable, Sequence 2 | from typing import Any, Self, TypedDict, type_check_only 3 | from typing_extensions import TypeVar 4 | 5 | import numpy as np 6 | import optype.numpy as onp 7 | 8 | from scipy._typing import ToRNG 9 | 10 | from ._typing import BaseBunch 11 | 12 | __all__ = ["multiscale_graphcorr"] 13 | 14 | ### 15 | 16 | _T = TypeVar("_T") 17 | _R = TypeVar("_R") 18 | 19 | @type_check_only 20 | class _MGCDict(TypedDict): 21 | mgc_map: onp.Array2D[np.float64] 22 | opt_scale: Sequence[int | np.intp] # list of size 2 23 | null_dist: onp.Array1D[np.float64] 24 | 25 | ### 26 | 27 | class MGCResult(BaseBunch[np.float64, np.float64, _MGCDict]): 28 | @property 29 | def statistic(self, /) -> np.float64: ... 30 | @property 31 | def pvalue(self, /) -> np.float64: ... 32 | @property 33 | def mgc_dict(self, /) -> _MGCDict: ... 34 | 35 | # 36 | def __new__(_cls, statistic: np.float64, pvalue: np.float64, mgc_dict: _MGCDict) -> Self: ... 37 | def __init__(self, /, statistic: np.float64, pvalue: np.float64, mgc_dict: _MGCDict) -> None: ... 38 | 39 | def multiscale_graphcorr( 40 | x: onp.ArrayND[np.floating[Any] | np.integer[Any] | np.bool_], 41 | y: onp.ArrayND[np.floating[Any] | np.integer[Any] | np.bool_], 42 | compute_distance: Callable[[onp.ArrayND[np.float64]], onp.ArrayND[np.floating[Any]]] = ..., 43 | reps: int = 1000, 44 | workers: int | Callable[[Callable[[_T], _R], Iterable[_T]], Sequence[_R]] = 1, 45 | is_twosamp: bool = False, 46 | random_state: ToRNG = None, 47 | ) -> MGCResult: ... 48 | -------------------------------------------------------------------------------- /scipy-stubs/stats/_multicomp.pyi: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | from typing import Any 3 | 4 | import numpy as np 5 | import optype.numpy as onp 6 | 7 | from scipy._typing import Alternative, ToRNG 8 | 9 | from ._common import ConfidenceInterval 10 | 11 | __all__ = ["dunnett"] 12 | 13 | @dataclass 14 | class DunnettResult: 15 | statistic: onp.Array1D[np.float64] 16 | pvalue: onp.Array1D[np.float64] 17 | 18 | _alternative: Alternative 19 | _rho: onp.Array2D[np.float64] 20 | _df: int 21 | _std: np.float64 22 | _mean_samples: onp.Array1D[np.float64] 23 | _mean_control: np.float64 # incorrectly annotated as `ndarray` at runtime 24 | _n_samples: onp.Array1D[np.int_] 25 | _n_control: int 26 | _rng: np.random.Generator | np.random.RandomState 27 | 28 | _ci: ConfidenceInterval | None = None 29 | _ci_cl: float | np.floating[Any] | None = None 30 | 31 | def confidence_interval(self, /, confidence_level: float | np.floating[Any] = 0.95) -> ConfidenceInterval: ... 32 | 33 | def dunnett( 34 | *samples: onp.ToFloat1D, control: onp.ToFloat1D, alternative: Alternative = "two-sided", rng: ToRNG = None 35 | ) -> DunnettResult: ... 36 | -------------------------------------------------------------------------------- /scipy-stubs/stats/_odds_ratio.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, Literal, TypeAlias 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | from ._common import ConfidenceInterval 7 | 8 | _Kind: TypeAlias = Literal["conditional", "sample"] 9 | 10 | class OddsRatioResult: 11 | statistic: float 12 | def __init__(self, /, _table: onp.Array2D[np.integer[Any]], _kind: _Kind, statistic: float) -> None: ... 13 | def confidence_interval(self, /, confidence_level: float = 0.95, alternative: str = "two-sided") -> ConfidenceInterval: ... 14 | 15 | def odds_ratio(table: onp.ToInt2D, *, kind: _Kind = "conditional") -> OddsRatioResult: ... 16 | -------------------------------------------------------------------------------- /scipy-stubs/stats/_page_trend_test.pyi: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | from typing import Literal 3 | 4 | import numpy as np 5 | import optype as op 6 | import optype.numpy as onp 7 | 8 | @dataclass 9 | class PageTrendTestResult: 10 | statistic: np.float64 11 | pvalue: np.float64 12 | method: Literal["asymptotic", "exact"] 13 | 14 | def page_trend_test( 15 | data: onp.ToFloatND, 16 | ranked: op.CanBool = False, 17 | predicted_ranks: onp.ToIntND | None = None, 18 | method: Literal["auto", "asymptotic", "exact"] = "auto", 19 | ) -> PageTrendTestResult: ... 20 | -------------------------------------------------------------------------------- /scipy-stubs/stats/_qmc_cy.pyi: -------------------------------------------------------------------------------- 1 | from typing import TypeAlias 2 | 3 | import numpy as np 4 | import optype as op 5 | import optype.numpy as onp 6 | import optype.typing as opt 7 | 8 | _Vector_i8: TypeAlias = onp.Array2D[np.int64] 9 | _Vector_f8: TypeAlias = onp.Array1D[np.float64] 10 | _Matrix_f8: TypeAlias = onp.Array2D[np.float64] 11 | 12 | def _cy_wrapper_centered_discrepancy(sample: _Matrix_f8, iterative: op.CanBool, workers: opt.AnyInt) -> float: ... 13 | def _cy_wrapper_wrap_around_discrepancy(sample: _Matrix_f8, iterative: op.CanBool, workers: opt.AnyInt) -> float: ... 14 | def _cy_wrapper_mixture_discrepancy(sample: _Matrix_f8, iterative: op.CanBool, workers: opt.AnyInt) -> float: ... 15 | def _cy_wrapper_l2_star_discrepancy(sample: _Matrix_f8, iterative: op.CanBool, workers: opt.AnyInt) -> float: ... 16 | def _cy_wrapper_update_discrepancy(x_new_view: _Vector_f8, sample_view: _Matrix_f8, initial_disc: opt.AnyFloat) -> float: ... 17 | def _cy_van_der_corput(n: opt.AnyInt, base: opt.AnyInt, start_index: opt.AnyInt, workers: opt.AnyInt) -> _Vector_f8: ... 18 | def _cy_van_der_corput_scrambled( 19 | n: opt.AnyInt, base: opt.AnyInt, start_index: opt.AnyInt, permutations: _Vector_i8, workers: opt.AnyInt 20 | ) -> _Vector_f8: ... 21 | -------------------------------------------------------------------------------- /scipy-stubs/stats/_qmvnt.pyi: -------------------------------------------------------------------------------- 1 | from scipy.special import ndtr, ndtri 2 | 3 | phi = ndtr 4 | phinv = ndtri 5 | -------------------------------------------------------------------------------- /scipy-stubs/stats/_rcont/__init__.pyi: -------------------------------------------------------------------------------- 1 | from .rcont import rvs_rcont1, rvs_rcont2 2 | 3 | __all__ = ["rvs_rcont1", "rvs_rcont2"] 4 | -------------------------------------------------------------------------------- /scipy-stubs/stats/_rcont/rcont.pyi: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import optype.numpy as onp 3 | 4 | def rvs_rcont1( 5 | row: onp.Array1D[np.int64], col: onp.Array1D[np.int64], ntot: int | np.int64, size: int, random_state: onp.random.ToRNG 6 | ) -> onp.Array3D[np.int64]: ... 7 | def rvs_rcont2( 8 | row: onp.Array1D[np.int64], col: onp.Array1D[np.int64], ntot: int | np.int64, size: int, random_state: onp.random.ToRNG 9 | ) -> onp.Array3D[np.int64]: ... 10 | -------------------------------------------------------------------------------- /scipy-stubs/stats/_relative_risk.pyi: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | from ._common import ConfidenceInterval 4 | 5 | @dataclass 6 | class RelativeRiskResult: 7 | relative_risk: float 8 | exposed_cases: int 9 | exposed_total: int 10 | control_cases: int 11 | control_total: int 12 | def confidence_interval(self, /, confidence_level: float = 0.95) -> ConfidenceInterval: ... 13 | 14 | def relative_risk(exposed_cases: int, exposed_total: int, control_cases: int, control_total: int) -> RelativeRiskResult: ... 15 | -------------------------------------------------------------------------------- /scipy-stubs/stats/_result_classes.pyi: -------------------------------------------------------------------------------- 1 | from ._binomtest import BinomTestResult 2 | from ._fit import FitResult 3 | from ._hypotests import TukeyHSDResult 4 | from ._multicomp import DunnettResult 5 | from ._odds_ratio import OddsRatioResult 6 | from ._relative_risk import RelativeRiskResult 7 | from ._stats_py import PearsonRResult, TtestResult 8 | from ._survival import ECDFResult, EmpiricalDistributionFunction 9 | 10 | __all__ = [ 11 | "BinomTestResult", 12 | "DunnettResult", 13 | "ECDFResult", 14 | "EmpiricalDistributionFunction", 15 | "FitResult", 16 | "OddsRatioResult", 17 | "PearsonRResult", 18 | "RelativeRiskResult", 19 | "TtestResult", 20 | "TukeyHSDResult", 21 | ] 22 | -------------------------------------------------------------------------------- /scipy-stubs/stats/_sobol.pyi: -------------------------------------------------------------------------------- 1 | from typing import Literal 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | def get_poly_vinit(kind: Literal["poly", "vinit"], dtype: type[np.uint32 | np.uint64]) -> onp.Array2D[np.uint32 | np.uint64]: ... 7 | -------------------------------------------------------------------------------- /scipy-stubs/stats/_stats_pythran.pyi: -------------------------------------------------------------------------------- 1 | from typing import Final, Literal, TypeAlias 2 | 3 | import optype.numpy as onp 4 | 5 | from ._stats_mstats_common import SiegelslopesResult 6 | 7 | _Method: TypeAlias = Literal["hierarchical", "separate"] 8 | 9 | ### 10 | 11 | __pythran__: Final[tuple[str, str]] = ... 12 | 13 | def siegelslopes(y: onp.ToFloatND, x: onp.ToFloatND | None = None, method: _Method = "hierarchical") -> SiegelslopesResult: ... 14 | -------------------------------------------------------------------------------- /scipy-stubs/stats/_tukeylambda_stats.pyi: -------------------------------------------------------------------------------- 1 | from typing import TypeVar, overload 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | import optype.numpy.compat as npc 6 | 7 | _ShapeT = TypeVar("_ShapeT", bound=tuple[int, ...]) 8 | 9 | @overload 10 | def tukeylambda_variance(lam: onp.ToFloat) -> onp.Array0D[np.float64]: ... 11 | @overload 12 | def tukeylambda_variance(lam: onp.CanArrayND[npc.floating | npc.integer | np.bool_]) -> onp.Array[_ShapeT, np.float64]: ... 13 | @overload 14 | def tukeylambda_variance(lam: onp.ToFloatND) -> onp.ArrayND[np.float64]: ... 15 | 16 | # 17 | @overload 18 | def tukeylambda_kurtosis(lam: onp.ToFloat) -> onp.Array0D[np.float64]: ... 19 | @overload 20 | def tukeylambda_kurtosis(lam: onp.CanArrayND[npc.floating | npc.integer | np.bool_]) -> onp.Array[_ShapeT, np.float64]: ... 21 | @overload 22 | def tukeylambda_kurtosis(lam: onp.ToFloatND) -> onp.ArrayND[np.float64]: ... 23 | -------------------------------------------------------------------------------- /scipy-stubs/stats/_unuran/__init__.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scipy/scipy-stubs/c8048cf7848b5fdbf88f5ebfa71d7450c20dd67d/scipy-stubs/stats/_unuran/__init__.pyi -------------------------------------------------------------------------------- /scipy-stubs/stats/_warnings_errors.pyi: -------------------------------------------------------------------------------- 1 | class DegenerateDataWarning(RuntimeWarning): 2 | args: tuple[str] 3 | def __init__(self, /, msg: str | None = None) -> None: ... 4 | 5 | class ConstantInputWarning(DegenerateDataWarning): ... 6 | class NearConstantInputWarning(DegenerateDataWarning): ... 7 | 8 | class FitError(RuntimeError): 9 | args: tuple[str] 10 | def __init__(self, /, msg: str | None = None) -> None: ... 11 | -------------------------------------------------------------------------------- /scipy-stubs/stats/_wilcoxon.pyi: -------------------------------------------------------------------------------- 1 | from typing import Final 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | class WilcoxonDistribution: 7 | n: Final[onp.ArrayND[np.int_]] 8 | 9 | def __init__(self, /, n: onp.ToInt | onp.ToIntND) -> None: ... 10 | def mean(self, /) -> onp.ArrayND[np.float64]: ... 11 | def cdf(self, /, k: onp.ToInt | onp.ToIntND) -> onp.ArrayND[np.float64]: ... 12 | def sf(self, /, k: onp.ToInt | onp.ToIntND) -> onp.ArrayND[np.float64]: ... 13 | -------------------------------------------------------------------------------- /scipy-stubs/stats/biasedurn.pyi: -------------------------------------------------------------------------------- 1 | __all__: list[str] = [] 2 | -------------------------------------------------------------------------------- /scipy-stubs/stats/kde.pyi: -------------------------------------------------------------------------------- 1 | # This module is not meant for public use and will be removed in SciPy v2.0.0. 2 | from typing_extensions import deprecated 3 | 4 | from ._kde import gaussian_kde as _gaussian_kde 5 | 6 | __all__ = ["gaussian_kde"] 7 | 8 | @deprecated("will be removed in SciPy v2.0.0") 9 | class gaussian_kde(_gaussian_kde): ... 10 | -------------------------------------------------------------------------------- /scipy-stubs/stats/mstats.pyi: -------------------------------------------------------------------------------- 1 | from scipy.stats import chisquare, gmean, hmean, zmap, zscore 2 | 3 | from ._mstats_basic import * 4 | from ._mstats_extras import * 5 | 6 | __all__ = [ 7 | "argstoarray", 8 | "brunnermunzel", 9 | "chisquare", 10 | "compare_medians_ms", 11 | "count_tied_groups", 12 | "describe", 13 | "f_oneway", 14 | "find_repeats", 15 | "friedmanchisquare", 16 | "gmean", 17 | "hdmedian", 18 | "hdquantiles", 19 | "hdquantiles_sd", 20 | "hmean", 21 | "idealfourths", 22 | "kendalltau", 23 | "kendalltau_seasonal", 24 | "kruskal", 25 | "kruskalwallis", 26 | "ks_1samp", 27 | "ks_2samp", 28 | "ks_twosamp", 29 | "kstest", 30 | "kurtosis", 31 | "kurtosistest", 32 | "linregress", 33 | "mannwhitneyu", 34 | "median_cihs", 35 | "meppf", 36 | "mjci", 37 | "mode", 38 | "moment", 39 | "mquantiles", 40 | "mquantiles_cimj", 41 | "msign", 42 | "normaltest", 43 | "obrientransform", 44 | "pearsonr", 45 | "plotting_positions", 46 | "pointbiserialr", 47 | "rankdata", 48 | "rsh", 49 | "scoreatpercentile", 50 | "sem", 51 | "sen_seasonal_slopes", 52 | "siegelslopes", 53 | "skew", 54 | "skewtest", 55 | "spearmanr", 56 | "theilslopes", 57 | "tmax", 58 | "tmean", 59 | "tmin", 60 | "trim", 61 | "trima", 62 | "trimboth", 63 | "trimmed_mean", 64 | "trimmed_mean_ci", 65 | "trimmed_std", 66 | "trimmed_stde", 67 | "trimmed_var", 68 | "trimr", 69 | "trimtail", 70 | "tsem", 71 | "ttest_1samp", 72 | "ttest_ind", 73 | "ttest_onesamp", 74 | "ttest_rel", 75 | "tvar", 76 | "variation", 77 | "winsorize", 78 | "zmap", 79 | "zscore", 80 | ] 81 | -------------------------------------------------------------------------------- /scipy-stubs/stats/mvn.pyi: -------------------------------------------------------------------------------- 1 | __all__: list[str] = [] 2 | -------------------------------------------------------------------------------- /scipy-stubs/stats/qmc.pyi: -------------------------------------------------------------------------------- 1 | from ._qmc import * 2 | 3 | __all__ = [ 4 | "Halton", 5 | "LatinHypercube", 6 | "MultinomialQMC", 7 | "MultivariateNormalQMC", 8 | "PoissonDisk", 9 | "QMCEngine", 10 | "Sobol", 11 | "discrepancy", 12 | "geometric_discrepancy", 13 | "scale", 14 | "update_discrepancy", 15 | ] 16 | -------------------------------------------------------------------------------- /scipy-stubs/stats/sampling.pyi: -------------------------------------------------------------------------------- 1 | from ._sampling import FastGeneratorInversion, RatioUniforms 2 | from ._unuran.unuran_wrapper import ( 3 | DiscreteAliasUrn, 4 | DiscreteGuideTable, 5 | NumericalInverseHermite, 6 | NumericalInversePolynomial, 7 | SimpleRatioUniforms, 8 | TransformedDensityRejection, 9 | UNURANError, 10 | ) 11 | 12 | __all__ = [ 13 | "DiscreteAliasUrn", 14 | "DiscreteGuideTable", 15 | "FastGeneratorInversion", 16 | "NumericalInverseHermite", 17 | "NumericalInversePolynomial", 18 | "RatioUniforms", 19 | "SimpleRatioUniforms", 20 | "TransformedDensityRejection", 21 | "UNURANError", 22 | ] 23 | -------------------------------------------------------------------------------- /scipy-stubs/version.pyi: -------------------------------------------------------------------------------- 1 | import typing as _t 2 | 3 | version: _t.Final[_t.LiteralString] = ... 4 | full_version: _t.Final[_t.LiteralString] = ... 5 | short_version: _t.Final[_t.Literal["1.16.0rc1", "1.16.0rc2", "1.16.0"]] = ... 6 | git_revision: _t.Final[_t.LiteralString] = ... 7 | release: _t.Final[bool] = ... 8 | -------------------------------------------------------------------------------- /tests/.ruff.toml: -------------------------------------------------------------------------------- 1 | extend = "../pyproject.toml" 2 | 3 | [lint] 4 | extend-ignore = ["PYI015"] 5 | -------------------------------------------------------------------------------- /tests/integrate/test_quad.pyi: -------------------------------------------------------------------------------- 1 | from collections.abc import Callable 2 | from typing import Literal, assert_type 3 | 4 | import numpy as np 5 | 6 | from scipy.integrate import quad 7 | from scipy.integrate._quadpack_py import _QuadExplain 8 | from scipy.integrate._typing import QuadInfoDict 9 | 10 | TRUE: Literal[True] = True 11 | 12 | # ufunc 13 | assert_type(quad(np.exp, 0, 1), tuple[float, float]) 14 | 15 | # (float) -> float 16 | f0_float_float: Callable[[float], float] 17 | assert_type(quad(f0_float_float, 0, 1), tuple[float, float]) 18 | 19 | # (float) -> np.float64 20 | f0_float_f8: Callable[[float], np.float64] 21 | assert_type(quad(f0_float_f8, 0, 1), tuple[float, float]) 22 | 23 | # (np.float64) -> float 24 | f0_f8_float: Callable[[np.float64], float] 25 | assert_type(quad(f0_f8_float, 0, 1), tuple[float, float]) 26 | 27 | # (float, str) -> float 28 | f1_float_float: Callable[[float, str], float] 29 | assert_type(quad(f1_float_float, 0, 1, args=("",)), tuple[float, float]) 30 | 31 | # (float, str, str) -> float 32 | f2_float_float: Callable[[float, str, str], float] 33 | assert_type(quad(f2_float_float, 0, 1, args=("", "")), tuple[float, float]) 34 | 35 | # (float) -> float, full output 36 | # NOTE: this test fails (only) in mypy due to some mypy bug 37 | assert_type( 38 | quad(f0_float_float, 0, 1, full_output=TRUE), 39 | tuple[float, float, QuadInfoDict] 40 | | tuple[float, float, QuadInfoDict, str] 41 | | tuple[float, float, QuadInfoDict, str, _QuadExplain], 42 | ) 43 | 44 | # (float) -> complex 45 | # NOTE: this test fails (only) in mypy due to some mypy bug 46 | z0_float_complex: Callable[[float], complex] 47 | assert_type(quad(z0_float_complex, 0, 1, complex_func=TRUE), tuple[complex, complex]) 48 | -------------------------------------------------------------------------------- /tests/interpolate/_dfitpack.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scipy/scipy-stubs/c8048cf7848b5fdbf88f5ebfa71d7450c20dd67d/tests/interpolate/_dfitpack.pyi -------------------------------------------------------------------------------- /tests/interpolate/_rgi.pyi: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | from scipy.interpolate import RegularGridInterpolator 4 | 5 | # regression test for https://github.com/scipy/scipy-stubs/issues/497 6 | RegularGridInterpolator(np.array([], dtype=np.float64), np.array([], dtype=np.float64)) 7 | -------------------------------------------------------------------------------- /tests/interpolate/bsplines.pyi: -------------------------------------------------------------------------------- 1 | from typing import assert_type 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | from scipy.interpolate import BSpline 7 | 8 | # based on the example from 9 | # https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.BSpline.html 10 | 11 | k: int 12 | t: list[int] 13 | c: list[int] 14 | spl = BSpline(t, c, k) 15 | assert_type(spl, BSpline[np.float64]) 16 | assert_type(spl(2.5), onp.ArrayND[np.float64]) 17 | 18 | c_complex: list[complex] 19 | spl_complex = BSpline(t, c_complex, k) 20 | assert_type(spl_complex, BSpline[np.complex128]) 21 | assert_type(spl_complex(2.5), onp.ArrayND[np.complex128]) 22 | -------------------------------------------------------------------------------- /tests/interpolate/dfitpack.pyi: -------------------------------------------------------------------------------- 1 | # test the deprecations of the "fortran functions" of the deprecated `scipy.interpolate.dfitpack` namespace 2 | 3 | from scipy.interpolate import dfitpack 4 | 5 | dfitpack.spalde(1, 1, 1, 1) # pyright: ignore[reportDeprecated] 6 | -------------------------------------------------------------------------------- /tests/linalg/test_special_matrices.pyi: -------------------------------------------------------------------------------- 1 | from typing import assert_type 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | from scipy.linalg import kron, toeplitz 7 | 8 | arr_f8_1d: onp.Array1D[np.float64] 9 | arr_f8_2d: onp.Array2D[np.float64] 10 | arr_f8_nd: onp.Array[tuple[int, ...], np.float64] 11 | 12 | ### 13 | # kron 14 | # > deprecated 15 | f_kron_f8_2d = kron(arr_f8_2d, arr_f8_2d) # pyright: ignore[reportDeprecated] 16 | f_kron_f8_nd = kron(arr_f8_nd, arr_f8_nd) # pyright: ignore[reportDeprecated] 17 | assert_type(f_kron_f8_2d, onp.Array2D[np.float64]) 18 | assert_type(f_kron_f8_nd, onp.Array[onp.AtLeast2D, np.float64]) 19 | ### 20 | 21 | ### 22 | # toeplitz 23 | # > non-deprecated overloads 24 | assert_type(toeplitz([0]), onp.Array2D[np.int_]) 25 | assert_type(toeplitz([0.0]), onp.Array2D[np.float64]) 26 | assert_type(toeplitz([0j]), onp.Array2D[np.complex128]) 27 | assert_type(toeplitz(arr_f8_1d), onp.Array2D[np.float64]) 28 | assert_type(toeplitz(arr_f8_nd), onp.Array2D[np.float64]) 29 | assert_type(toeplitz(arr_f8_1d, arr_f8_1d), onp.Array2D[np.float64]) 30 | assert_type(toeplitz(arr_f8_1d, arr_f8_nd), onp.Array2D[np.float64]) 31 | assert_type(toeplitz(arr_f8_nd, arr_f8_nd), onp.Array2D[np.float64]) 32 | # > deprecated (raveled input) 33 | assert_type(toeplitz([[0], [1]]), onp.Array2D[np.int_]) # pyright: ignore[reportDeprecated] 34 | assert_type(toeplitz([[[0], [1]], [[2], [3]]]), onp.Array2D[np.int_]) # pyright: ignore[reportDeprecated] 35 | ### 36 | -------------------------------------------------------------------------------- /tests/optimize/minimize.pyi: -------------------------------------------------------------------------------- 1 | from typing import TypeAlias 2 | 3 | import numpy as np 4 | import numpy.typing as npt 5 | 6 | from scipy.optimize import minimize 7 | 8 | NDArrayFloat: TypeAlias = npt.NDArray[np.float16 | np.float32 | np.float64] 9 | 10 | def objective_function(CCT: NDArrayFloat, uv_: NDArrayFloat) -> np.float64: ... 11 | 12 | uv = np.atleast_1d([0.1978, 0.3124]) 13 | 14 | minimize(objective_function, x0=6400, args=(uv,), method="Nelder-Mead", options={"fatol": 1e-10}) 15 | -------------------------------------------------------------------------------- /tests/optimize/minimize_scalar.pyi: -------------------------------------------------------------------------------- 1 | from typing import assert_type 2 | 3 | import numpy.polynomial as npp 4 | 5 | from scipy.optimize import minimize_scalar 6 | 7 | def f(x: float, /) -> float: ... 8 | 9 | res = minimize_scalar(f) 10 | assert_type(res.success, bool) 11 | assert_type(res.nit, int) 12 | assert_type(res.nfev, int) 13 | 14 | # https://github.com/scipy/scipy-stubs/issues/465 15 | p = npp.Polynomial([3, -2, 1, 1, 0.2]) 16 | res_poly = minimize_scalar(p) 17 | assert_type(res.success, bool) 18 | -------------------------------------------------------------------------------- /tests/signal/windows/test_windows.pyi: -------------------------------------------------------------------------------- 1 | from typing import assert_type 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | from scipy.signal.windows import dpss 7 | 8 | # test dpss function overloads 9 | assert_type(dpss(64, 3), onp.Array1D[np.float64]) 10 | assert_type(dpss(64, 3, 2), onp.Array2D[np.float64]) 11 | assert_type(dpss(64, 3, return_ratios=True), tuple[onp.Array1D[np.float64], np.float64]) 12 | assert_type(dpss(64, 3, 2, return_ratios=True), tuple[onp.Array2D[np.float64], onp.Array1D[np.float64]]) 13 | -------------------------------------------------------------------------------- /tests/stats/qmc/test_scale.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | from scipy.stats import qmc 7 | 8 | _f8_xd: np.ndarray[Any, np.dtype[np.float64]] 9 | qmc.scale(_f8_xd, 0, 1) 10 | 11 | _f8_nd: onp.ArrayND[np.float64] 12 | qmc.scale(_f8_nd, 0, 1) 13 | 14 | _f8_2d: onp.Array2D[np.float64] 15 | qmc.scale(_f8_2d, 0, 1) 16 | -------------------------------------------------------------------------------- /tests/stats/test_make_distribution.pyi: -------------------------------------------------------------------------------- 1 | from typing import Literal 2 | 3 | import numpy as np 4 | 5 | from scipy.stats import distributions, make_distribution 6 | from scipy.stats._distribution_infrastructure import ContinuousDistribution 7 | 8 | LogUniform: type[ContinuousDistribution] = make_distribution(distributions.loguniform) 9 | 10 | class _DuckRV: 11 | @property 12 | def __make_distribution_version__(self) -> Literal["1.16.0"]: ... 13 | @property 14 | def parameters(self) -> dict[str, tuple[float, float]]: ... 15 | @property 16 | def support(self) -> tuple[float, float]: ... 17 | def pdf(self, x: float, /, *, quack: float) -> float: ... 18 | 19 | class _MultiDuckRV: 20 | @property 21 | def __make_distribution_version__(self) -> Literal["1.16.0"]: ... 22 | @property 23 | def parameters(self) -> tuple[dict[str, tuple[float, float]], dict[str, tuple[float, float]]]: ... 24 | def process_parameters(self, quack: float | None = None, swim: float | None = None) -> dict[str, float]: ... 25 | @property 26 | def support(self) -> dict[str, tuple[float, float]]: ... 27 | def pdf(self, x: float, /, *, quack: float, swim: float) -> np.float64: ... 28 | 29 | DuckRV: type[ContinuousDistribution] = make_distribution(_DuckRV) 30 | MultiDuckRV: type[ContinuousDistribution] = make_distribution(_MultiDuckRV) 31 | -------------------------------------------------------------------------------- /tests/stats/test_rv_sample.pyi: -------------------------------------------------------------------------------- 1 | from typing import assert_type 2 | 3 | import numpy as np 4 | import optype.numpy as onp 5 | 6 | from scipy.stats._distn_infrastructure import rv_discrete, rv_sample 7 | 8 | xk: onp.Array1D[np.int_] 9 | pk: tuple[float, ...] 10 | 11 | # mypy fails because it (still) doesn't support __new__ returning something that isn't `Self` 12 | assert_type(rv_discrete(values=(xk, pk)), rv_sample) # type: ignore[assert-type] 13 | -------------------------------------------------------------------------------- /tox.toml: -------------------------------------------------------------------------------- 1 | min_version = "4" 2 | requires = ["tox-uv>=1"] 3 | env_list = ["lint", "pyright", "mypy", "3.13", "3.12", "3.11"] 4 | 5 | [env_run_base] 6 | description = "stubtest with {base_python}" 7 | runner = "uv-venv-lock-runner" 8 | dependency_groups = ["type"] 9 | uv_sync_flags = ["--no-editable"] 10 | commands = [ 11 | [ 12 | "stubtest", 13 | "--allowlist=.mypyignore", 14 | "--mypy-config-file=pyproject.toml", 15 | "--concise", 16 | {replace = "posargs", default = ["scipy"], extend = true}, 17 | ], 18 | ] 19 | 20 | [env.lint] 21 | description = "lint" 22 | runner = "uv-venv-lock-runner" 23 | dependency_groups = ["lint"] 24 | commands = [ 25 | ["repo-review", "."], 26 | ["ruff", "check", "--show-fixes"], 27 | ["ruff", "format", "--check"], 28 | ] 29 | 30 | [env.pyright] 31 | description = "basedpyright" 32 | runner = "uv-venv-lock-runner" 33 | dependency_groups = ["type"] 34 | commands = [["basedpyright"]] 35 | 36 | [env.mypy] 37 | description = "mypy" 38 | runner = "uv-venv-lock-runner" 39 | dependency_groups = ["type"] 40 | commands = [ 41 | [ 42 | "mypy", 43 | "--tb", 44 | "--hide-error-context", 45 | "--hide-error-code-links", 46 | "--no-pretty", 47 | {replace = "posargs", default = ["."], extend = true}, 48 | ], 49 | ] 50 | --------------------------------------------------------------------------------