diff --git a/.github/workflows/linux_meson.yml b/.github/workflows/linux_meson.yml index df2bdf694184..a61b2b45d136 100644 --- a/.github/workflows/linux_meson.yml +++ b/.github/workflows/linux_meson.yml @@ -101,6 +101,7 @@ jobs: - name: Test SciPy run: | export OMP_NUM_THREADS=2 + export SCIPY_USE_PROPACK=1 python dev.py -n -j 2 test_venv_install: diff --git a/.github/workflows/macos_meson.yml b/.github/workflows/macos_meson.yml index a4006e279b16..37fcb1ef0919 100644 --- a/.github/workflows/macos_meson.yml +++ b/.github/workflows/macos_meson.yml @@ -112,6 +112,7 @@ jobs: run: | conda activate scipy-dev export OMP_NUM_THREADS=2 + export SCIPY_USE_PROPACK=1 python dev.py -n -j 2 - name: Ccache statistics diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d3b9221fb723..6439cbd0c7ed 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -79,6 +79,7 @@ jobs: - name: prep-test run: | echo "PYTHONPATH=${env:installed_path}" >> $env:GITHUB_ENV + echo "SCIPY_USE_PROPACK=1" >> $env:GITHUB_ENV - name: test run: | mkdir tmp diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2fa95b3a3b7c..b59c6e2fb160 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -182,7 +182,7 @@ stages: curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \ python3.8 get-pip.py && \ pip3 --version && \ - pip3 install setuptools==59.6.0 wheel numpy==1.18.5 cython==0.29.21 pybind11 pytest pytest-timeout pytest-xdist pytest-env pytest-cov Pillow mpmath pythran==0.10.0 && \ + pip3 install setuptools==59.6.0 wheel numpy==1.18.5 cython==0.29.21 pybind11 pytest pytest-timeout pytest-xdist pytest-env pytest-cov Pillow mpmath pythran==0.11.0 && \ apt-get -y install gcc-5 g++-5 gfortran-8 wget && \ cd .. && \ mkdir openblas && cd openblas && \ @@ -295,7 +295,7 @@ stages: numpy==1.21.4 Pillow pybind11 - pythran==0.10.0 + pythran==0.11.0 pytest pytest-cov pytest-env diff --git a/doc/release/1.9.0-notes.rst b/doc/release/1.9.0-notes.rst index 3928b1693af7..21feb65d6dc5 100644 --- a/doc/release/1.9.0-notes.rst +++ b/doc/release/1.9.0-notes.rst @@ -334,6 +334,10 @@ Other changes ``FITPACK`` routines in `scipy.interpolate`, which power ``splrep``, ``splev`` etc., and ``*UnivariateSpline`` and ``*BivariateSpline`` classes. +- the ``USE_PROPACK`` environment variable has been renamed to + ``SCIPY_USE_PROPACK``; setting to a non-zero value will enable + the usage of the ``PROPACK`` library as before + Lazy access to subpackages ========================== @@ -417,7 +421,7 @@ Authors * bobcatCA (2) + * boussoffara (2) + * Islem BOUZENIA (1) + -* Jake Bowhay (40) + +* Jake Bowhay (41) + * Matthew Brett (11) * Dietrich Brunn (2) + * Michael Burkhart (2) + @@ -446,11 +450,11 @@ Authors * Isuru Fernando (3) * Joseph Fox-Rabinovitz (1) * Ryan Gibson (4) + -* Ralf Gommers (302) +* Ralf Gommers (304) * Srinivas Gorur-Shandilya (1) + * Alex Griffing (2) * h-vetinari (3) -* Matt Haberland (435) +* Matt Haberland (440) * Tristan Hearn (1) + * Jonathan Helgert (1) + * Samuel Hinton (1) + @@ -499,8 +503,8 @@ Authors * Amit Portnoy (1) + * Quentin Barthélemy (9) * Patrick N. Raanes (1) + -* Tyler Reddy (93) -* Pamphile Roy (192) +* Tyler Reddy (108) +* Pamphile Roy (196) * Vivek Roy (2) + * Niyas Sait (2) + * Atsushi Sakai (25) @@ -531,7 +535,7 @@ Authors * Arthur Volant (1) * Samuel Wallan (5) * Stefan van der Walt (8) -* Warren Weckesser (81) +* Warren Weckesser (82) * Anreas Weh (1) * Nils Werner (1) * Aviv Yaish (1) + @@ -585,23 +589,43 @@ Issues closed for 1.9.0 * `#11828 `__: UnivariateSpline gives varying results when multithreaded on... * `#12456 `__: Add generalized mean calculation * `#12480 `__: RectBivariateSpline derivative evaluator is slow +* `#12485 `__: linprog returns an incorrect message +* `#12633 `__: Offer simpler development workflow? * `#12658 `__: scipy.stats.levy_stable.pdf can be inaccurate and return nan * `#12838 `__: Accept multiple matrices in \`scipy.linalg.expm\` +* `#12848 `__: DOC: stats: multivariate distribution documentation issues * `#12870 `__: Levy Stable Random Variates Code has a typo * `#12871 `__: Levy Stable distribution uses parameterisation that is not location... +* `#13200 `__: Errors made by scipy.optimize.linprog * `#13462 `__: Too many warnings and results objects in public API for scipy.stats * `#13615 `__: RFC: switch to Meson as a build system +* `#13632 `__: stats.rv_discrete is not checking that xk values are integers * `#13655 `__: MAINT: stats.rv_generic: \`moment\` method falls back to \`_munp\`... +* `#13689 `__: Wilcoxon does not appropriately detect ties when mode=exact. +* `#13835 `__: Change name of \`alpha\` parameter in \`interval()\` method +* `#13872 `__: Add method details or reference to \`scipy.integrate.dblquad\` * `#13912 `__: Adding Poisson Disc sampling to QMC +* `#13996 `__: Fisk distribution documentation typo * `#14035 `__: \`roots_jacobi\` support for large parameter values +* `#14081 `__: \`scipy.optimize._linprog_simplex._apply_pivot\` relies on asymmetric... * `#14162 `__: Thread safety RectBivariateSpline * `#14267 `__: BUG: online doc returns 404 - wrong \`reference\` in url +* `#14313 `__: ks_2samp: example description does not match example output +* `#14418 `__: \`ttest_ind\` for two sampled distributions with the same single... +* `#14455 `__: Adds Mixed Integer Linear Programming from highs * `#14462 `__: Shapiro test returning negative p-value +* `#14471 `__: methods 'revised simplex' and 'interior-point' are extremely... +* `#14505 `__: \`Optimization converged to parameters that are outside the range\`... * `#14548 `__: Add convention flag to quanternion in \`Scipy.spatial.transform.rotation.Rotation\` +* `#14565 `__: optimize.minimize: Presence of callback causes method TNC to... +* `#14622 `__: BUG: (sort of) mannwhitneyu hits max recursion limit with imbalanced... +* `#14645 `__: ENH: MemoryError when trying to bootstrap with large amounts... * `#14716 `__: BUG: stats: The \`loguniform\` distribution is overparametrized. * `#14731 `__: BUG: Incorrect residual graph in scipy.sparse.csgraph.maximum_flow * `#14745 `__: BUG: scipy.ndimage.convolve documentation is incorrect +* `#14750 `__: ENH: Add one more derivative-free optimization method * `#14777 `__: BUG: Wrong limit and no warning in stats.t for df=np.inf +* `#14861 `__: BUG: unclear error message when all bounds are all equal for... * `#14889 `__: BUG: NumPy's \`random\` module should not be in the \`scipy\`... * `#14914 `__: CI job with code coverage is failing (yet again) * `#14926 `__: RegularGridInterpolator should be called RectilinearGridInterpolator @@ -617,7 +641,9 @@ Issues closed for 1.9.0 * `#15199 `__: BUG: Error occured \`spsolve_triangular\` * `#15245 `__: MAINT: scipy.stats._levy_stable should be treated as subpackage... * `#15252 `__: DOC: Multivariate normal CDF docstring typo +* `#15296 `__: BUG: SciPy 1.7.x build failure on Cygwin * `#15308 `__: BUG: OpenBLAS 0.3.18 support +* `#15338 `__: DOC: Rename \`\*args\` param in \`f_oneway\` to \`\*samples\` * `#15345 `__: BUG: boschloo_exact gives pvalue > 1 (and sometimes nan) * `#15368 `__: build warnings for \`unuran_wrapper.pyx\` * `#15373 `__: BUG: Tippett’s and Pearson’s method for combine_pvalues are not... @@ -625,25 +651,33 @@ Issues closed for 1.9.0 * `#15456 `__: Segfault in HiGHS code when building with Mingw-w64 on Windows * `#15458 `__: DOC: Documentation inaccuracy of scipy.interpolate.bisplev * `#15488 `__: ENH: missing examples for scipy.optimize in docs +* `#15507 `__: BUG: scipy.optimize.linprog: the algorithm determines the problem... +* `#15508 `__: BUG: Incorrect error message in multivariate_normal * `#15541 `__: BUG: scipy.stats.powerlaw, why should x ∈ (0,1)? x can exceed... +* `#15551 `__: MAINT: stats: deprecating non-numeric array support in \`stats.mode\` * `#15568 `__: BENCH/CI: Benchmark timeout * `#15572 `__: BUG: \`scipy.spatial.transform.rotation\`, wrong deprecation... * `#15575 `__: BUG: Tests failing for initial build [arm64 machine] * `#15589 `__: BUG: scipy.special.factorialk docstring inconsistent with behaviour * `#15601 `__: BUG: Scalefactors for \`signal.csd\` with \`average=='median'\`... +* `#15617 `__: ENH: stats: all multivariate distributions should be freezable +* `#15631 `__: BUG: stats.fit: intermittent failure in doctest * `#15635 `__: CI:ASK: Remove LaTeX doc builds? * `#15638 `__: DEV: \`dev.py\` missing PYTHONPATH when building doc * `#15644 `__: DOC: stats.ks_1samp: incorrect commentary in examples * `#15666 `__: CI: CircleCI build_docs failure on main * `#15670 `__: BUG: AssertionError in test__dual_annealing.py in test_bounds_class +* `#15689 `__: BUG: default value of shape parameter in fit method of rv_continuous... * `#15692 `__: CI: scipy.scipy (Main refguide_asv_check) failure in main * `#15696 `__: DOC: False information in docs - scipy.stats.ttest_1samp * `#15700 `__: BUG: AssertionError in test_propack.py +* `#15730 `__: BUG: "terminate called after throwing an instance of 'std::out_of_range'"... * `#15732 `__: DEP: execute deprecation of inexact indices into sparse matrices * `#15734 `__: DEP: deal with deprecation of ndim >1 in bspline * `#15735 `__: DEP: add actual DeprecationWarning for sym_pos-keyword of scipy.linalg.solve * `#15736 `__: DEP: Remove \`debug\` keyword from \`scipy.linalg.solve_\*\` * `#15737 `__: DEP: Execute deprecation of pinv2 +* `#15739 `__: DEP: sharpen deprecation for >1-dim inputs in optimize.minimize * `#15740 `__: DEP: Execute deprecation for squeezing input vectors in spatial.distance * `#15741 `__: DEP: remove spatial.distance.matching * `#15742 `__: DEP: raise if fillvalue cannot be cast to output type in \`signal.convolve2d\` @@ -665,6 +699,7 @@ Issues closed for 1.9.0 * `#15762 `__: DEP: remove stats.median_absolute_deviation * `#15773 `__: BUG: iirfilter allows Wn[1] < Wn[0] for band-pass and band-stop... * `#15780 `__: BUG: CI on Azure broken with PyTest 7.1 +* `#15843 `__: BUG: scipy.stats.brunnermunzel incorrectly returns nan for undocumented... * `#15854 `__: CI: Windows Meson job failing sometimes on OpenBLAS binary download * `#15866 `__: BUG/CI: Wrong python version used for tests labeled "Linux Tests... * `#15899 `__: BUG: _calc_uniform_order_statistic_medians documentation example... @@ -674,6 +709,7 @@ Issues closed for 1.9.0 * `#15961 `__: BUG: scipy.stats.beta and bernoulli fails with float32 inputs * `#15962 `__: Race condition in macOS Meson build between \`_matfuncs_expm\`... * `#15987 `__: CI: \`np.matrix\` deprecation warning +* `#16007 `__: BUG: Confusing documentation in \`ttest_ind_from_stats\` * `#16011 `__: BUG: typo in documentation for scipy.optimize.basinhopping * `#16020 `__: BUG: dev.py FileNotFoundError * `#16027 `__: jc should be (n-1)/2 @@ -689,6 +725,12 @@ Issues closed for 1.9.0 * `#16219 `__: \`TestSobol.test_0dim\` failure on 32-bit Linux job * `#16233 `__: BUG: Memory leak in function \`sf_error\` due to new reference... * `#16254 `__: DEP: add deprecation warning to \`maxiter\` kwarg in \`_minimize_tnc\` +* `#16292 `__: BUG: compilation error: no matching constructor for initialization... +* `#16337 `__: TST: stats/tests/test_axis_nan_policy.py::test_axis_nan_policy_full... +* `#16347 `__: TST, MAINT: 32-bit Linux test failures in wheels repo +* `#16358 `__: TST, MAINT: test_theilslopes_warnings fails on 32-bit Windows +* `#16378 `__: DOC: pydata-sphinx-theme v0.9 defaults to darkmode... +* `#16409 `__: BUG: SIGSEGV in qhull when array type is wrong *********************** Pull requests for 1.9.0 @@ -707,6 +749,7 @@ Pull requests for 1.9.0 * `#14300 `__: ENH: Adding DIRECT algorithm to \`\`scipy.optimize\`\` * `#14576 `__: ENH: stats: add one-sample Monte Carlo hypothesis test * `#14642 `__: ENH: add Lloyd's algorithm to \`scipy.spatial\` to improve a... +* `#14718 `__: DOC: stats: adjust bootstrap doc to emphasize that batch controls... * `#14781 `__: BUG: stats: handle infinite \`df\` in \`t\` distribution * `#14847 `__: ENH: BLD: enable building SciPy with Meson * `#14877 `__: DOC: ndimage convolve origin documentation (#14745) @@ -749,6 +792,7 @@ Pull requests for 1.9.0 * `#15286 `__: MAINT: Highs submodule CI issue - use shallow cloning * `#15289 `__: DOC: Misc numpydoc formatting. * `#15291 `__: DOC: some more docstring/numpydoc formatting. +* `#15294 `__: ENH: add integrality constraints for linprog * `#15300 `__: DOC: Misc manual docs updates. * `#15302 `__: DOC: More docstring reformatting. * `#15304 `__: CI: fix Gitpod build by adding HiGHS submodule checkout @@ -887,6 +931,7 @@ Pull requests for 1.9.0 * `#15775 `__: DOC: stats.lognorm: rephrase note about parameterization * `#15776 `__: DOC: stats.powerlaw: more explicit explanation of support * `#15777 `__: MAINT: stats.shapiro: subtract median from shapiro input +* `#15778 `__: MAINT: stats: more specific error type from \`rv_continuous.fit\` * `#15779 `__: CI: don't run meson tests on forks and remove skip flags * `#15782 `__: DEPR: remove k=None in KDTree.query * `#15783 `__: CI:Pin pytest version to 7.0.1 on Azure @@ -923,6 +968,7 @@ Pull requests for 1.9.0 * `#15840 `__: DOC: special: Add 'Examples' for wrightomega. * `#15842 `__: DOC: Add examples for \`CGS\`, \`GCROTMK\` and \`BiCGSTAB\` iterative... * `#15846 `__: DOC: Add efficiency condition for CSC sparse matrix and remove... +* `#15847 `__: BUG: adds warning to scipy.stats.brunnermunzel * `#15848 `__: DOC: fix interp2d docs showing wrong Z array ordering. * `#15850 `__: MAINT: sparse.linalg: Missing tfqmr in the re-entrancy test * `#15853 `__: DEP: remove the keyword debug from linalg.solve @@ -940,6 +986,7 @@ Pull requests for 1.9.0 * `#15887 `__: DEP: remove ftol/xtol from neldermead * `#15894 `__: [BUG] make p-values consistent with the literature * `#15895 `__: CI: remove pin on Jinja2 +* `#15898 `__: DOC: stats: correct documentation of \`wilcoxon\`'s behavior... * `#15900 `__: DOC: fix import in example in _morestats * `#15905 `__: MAINT: stats._moment: warn when catastrophic cancellation occurs * `#15909 `__: DEP: deal with deprecation of ndim >1 in bspline @@ -947,6 +994,7 @@ Pull requests for 1.9.0 * `#15914 `__: MAINT: special: Clean up C style in ndtr.c * `#15916 `__: MAINT: stats: adjust tolerance of failing TestTruncnorm * `#15917 `__: MAINT: stats: remove support for \`_rvs\` without \`size\` parameter +* `#15920 `__: ENH: stats.mannwhitneyu: add iterative implementation * `#15923 `__: MAINT: stats: attempt to consolidate warnings and errors * `#15932 `__: MAINT: stats: fix and thoroughly test \`rv_sample\` at non-integer... * `#15933 `__: TST: test_nodata respect endianness @@ -957,6 +1005,7 @@ Pull requests for 1.9.0 * `#15947 `__: DOC: Revamp contributor setup guides * `#15953 `__: DOC: Add meson docs to use gcc, clang build in parallel and optimization... * `#15959 `__: ENH: Developer CLI for SciPy +* `#15965 `__: MAINT: stats: ensure that \`rv_continuous._fitstart\` shapes... * `#15968 `__: BUG: Fix debug and coverage arguments with dev.py * `#15970 `__: BLD: specify \`cython_lapack\` dependency for \`matfuncs_expm\` * `#15973 `__: DOC: Add formula renderings to integrate.nquad. @@ -977,6 +1026,7 @@ Pull requests for 1.9.0 * `#16024 `__: CI: unpin pytest and pytest-xdist * `#16026 `__: BUG: Allow \`spsolve_triangular\` to work with matrices with... * `#16029 `__: BUG: Fix meson-info file errors and add more informative exception +* `#16030 `__: MAINT: stats: more accurate error message for \`multivariate_normal\` * `#16032 `__: FIX: show warning when passing NAN into input of convolve method * `#16037 `__: MAINT: fix missing \`f\` prefix on f-strings * `#16042 `__: MAINT: stats.dirichlet: fix interface inconsistency @@ -984,6 +1034,7 @@ Pull requests for 1.9.0 * `#16045 `__: ENH: Use circleci-artifacts-redirector-action * `#16051 `__: MAINT: Miscellaneous small changes to filter_design * `#16053 `__: Mark fitpack sources as \`recursive\` +* `#16055 `__: MAINT: stats: replace \`np.var\` with \`_moment(..., 2)\` to... * `#16058 `__: DEV: Fix meson debian python build * `#16060 `__: MAINT: Allow all Latin-1 Unicode letters in the source code. * `#16062 `__: DOC: Document QUADPACK routines used in \`\*quad\` @@ -1041,6 +1092,7 @@ Pull requests for 1.9.0 * `#16241 `__: DOC: stats: update roadmap * `#16245 `__: DEP: Execute deprecation of pinv2 * `#16247 `__: DOC:linalg: Remove references to removed pinv2 function +* `#16248 `__: DOC: prep 1.9.0 release notes * `#16249 `__: Refguide check verbosity abs names * `#16257 `__: DEP: Deprecation follow-ups * `#16259 `__: Revert "CI: pin Pip to 22.0.4 to avoid issues with \`--no-build-isolation\`" @@ -1062,3 +1114,15 @@ Pull requests for 1.9.0 * `#16304 `__: MAINT: add a more informative error message for broken installs * `#16309 `__: BLD: CI: fix issue in wheel metadata, and add basic "build in... * `#16316 `__: REL: update version switcher for 1.8.1 +* `#16321 `__: DOC: fix incorrect formatting of deprecation tags +* `#16326 `__: REL: update version switcher for 1.9 +* `#16329 `__: MAINT: git security shim for 1.9.x +* `#16339 `__: MAINT, TST: bump tol for _axis_nan_policy_test +* `#16341 `__: BLD: update Pythran requirement to 0.11.0, to support Clang >=13 +* `#16360 `__: MAINT, TST: sup warning for theilslopes +* `#16361 `__: MAINT: SCIPY_USE_PROPACK +* `#16370 `__: MAINT: update Boost submodule to include Cygwin fix +* `#16374 `__: MAINT: update pydata-sphinx-theme +* `#16379 `__: DOC: dark theme css adjustments +* `#16390 `__: TST, MAINT: adjust 32-bit xfails for HiGHS +* `#16414 `__: BUG: spatial: Handle integer arrays in HalfspaceIntersection. diff --git a/doc/source/_static/scipy.css b/doc/source/_static/scipy.css index bd3b12308561..56e2821f9126 100644 --- a/doc/source/_static/scipy.css +++ b/doc/source/_static/scipy.css @@ -38,18 +38,21 @@ Nat Methods 8, 441 (2011). https://doi.org/10.1038/nmeth.1618 #version_switcher_button[data-active-version-name*="dev"] { background-color: #E69F00; border-color: #E69F00; + color: white; } /* green for `stable` */ #version_switcher_button[data-active-version-name*="stable"] { background-color: #009E73; border-color: #009E73; + color: white; } /* red for `old` */ #version_switcher_button:not([data-active-version-name*="stable"]):not([data-active-version-name*="dev"]):not([data-active-version-name*="pull"]) { background-color: #980F0F; border-color: #980F0F; + color: white; } /* Taken from NumPy */ @@ -159,3 +162,40 @@ h3 { margin-bottom: 0rem; color: #484848; } + + +/* Dark theme tweaking + +Matplotlib images are in png and inverted while other output +types are assumed to be normal images. + +*/ +html[data-theme=dark] img[src*='.png'] { + filter: invert(0.82) brightness(0.8) contrast(1.2); +} + +html[data-theme=dark] .MathJax_SVG * { + fill: var(--pst-color-text-base); +} + +/* Main index page overview cards */ +html[data-theme=dark] .shadow { + box-shadow: 0 .5rem 1rem rgba(250, 250, 250, .6) !important +} + +html[data-theme=dark] .intro-card .card-header { + background-color:var(--pst-color-background); + color: #150458 !important; +} + +html[data-theme=dark] .intro-card .card-footer { + background-color:var(--pst-color-background); +} + +html[data-theme=dark] h1 { + color: var(--pst-color-primary); +} + +html[data-theme=dark] h3 { + color: #0a6774; +} diff --git a/doc/source/conf.py b/doc/source/conf.py index 257aa0438de1..578a9e3e482e 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -185,9 +185,9 @@ html_favicon = '_static/favicon.ico' html_theme_options = { - "logo_link": "index", "github_url": "https://github.com/scipy/scipy", - "navbar_end": ["version-switcher", "navbar-icon-links"], + "twitter_url": "https://twitter.com/SciPy_team", + "navbar_end": ["theme-switcher", "version-switcher", "navbar-icon-links"], "switcher": { "json_url": "https://scipy.github.io/devdocs/_static/version_switcher.json", "version_match": version, diff --git a/doc_requirements.txt b/doc_requirements.txt index 3cfb2dc0a427..12ddccf5241a 100644 --- a/doc_requirements.txt +++ b/doc_requirements.txt @@ -1,7 +1,7 @@ # Note: this should disappear at some point. For now, please keep it # in sync with the doc dependencies in pyproject.toml -Sphinx!=3.1.0, !=4.1.0 -pydata-sphinx-theme>=0.8.1 +Sphinx!=4.1.0 +pydata-sphinx-theme>=0.9.0 sphinx-panels>=0.5.2 sphinx-tabs numpydoc diff --git a/environment.yml b/environment.yml index 734fb8396017..a99f32a5cc93 100644 --- a/environment.yml +++ b/environment.yml @@ -18,7 +18,7 @@ dependencies: - pkg-config # note: not available on Windows - libblas=*=*openblas # helps avoid pulling in MKL - pybind11 - - pythran>=0.9.12 + - pythran>=0.11.0 # For testing and benchmarking - pytest - pytest-cov @@ -32,7 +32,7 @@ dependencies: - numpydoc - ipython - matplotlib - - pydata-sphinx-theme>=0.8.1 + - pydata-sphinx-theme>=0.9.0 - sphinx-panels - sphinx-tabs # For linting diff --git a/pyproject.toml b/pyproject.toml index 33b56f82b5fe..60ec3d9a5683 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ requires = [ "meson-python>=0.5.0", "Cython>=0.29.21", "pybind11>=2.4.3", - "pythran>=0.9.12", + "pythran>=0.11.0", # `wheel` is needed for non-isolated builds, given that `meson-python` # doesn't list it as a runtime requirement (at least in 0.5.0) "wheel", @@ -101,8 +101,8 @@ test = [ "scikit-umfpack", ] doc = [ - "sphinx!=3.1.0, !=4.1.0", - "pydata-sphinx-theme>=0.8.1", + "sphinx!=4.1.0", + "pydata-sphinx-theme>=0.9.0", "sphinx-panels>=0.5.2", "matplotlib>2", "numpydoc", diff --git a/scipy/_lib/boost b/scipy/_lib/boost index d8626c9d2d93..2a1a7e920f39 160000 --- a/scipy/_lib/boost +++ b/scipy/_lib/boost @@ -1 +1 @@ -Subproject commit d8626c9d2d937abf6a38a844522714ad72e63281 +Subproject commit 2a1a7e920f39c44440d6908a080810abe9510f42 diff --git a/scipy/optimize/tests/test_linprog.py b/scipy/optimize/tests/test_linprog.py index 7df473e16cf2..b5979f86f931 100644 --- a/scipy/optimize/tests/test_linprog.py +++ b/scipy/optimize/tests/test_linprog.py @@ -2,6 +2,7 @@ Unit test for Linear Programming """ import sys +import platform import numpy as np from numpy.testing import (assert_, assert_allclose, assert_equal, @@ -2199,6 +2200,10 @@ class TestLinprogHiGHSMIP(): method = "highs" options = {} + @pytest.mark.xfail(condition=(sys.maxsize < 2 ** 32 and + platform.system() == "Linux"), + run=False, + reason="gh-16347") def test_mip1(self): # solve non-relaxed magic square problem (finally!) # also check that values are all integers - they don't always diff --git a/scipy/optimize/tests/test_milp.py b/scipy/optimize/tests/test_milp.py index 9744c9ad0c84..fecb5dd6c901 100644 --- a/scipy/optimize/tests/test_milp.py +++ b/scipy/optimize/tests/test_milp.py @@ -57,8 +57,10 @@ def test_milp_iv(): milp([1, 2, 3], bounds=([1, 2, 3], [set(), 4, 5])) -@pytest.mark.xfail(strict=True, reason="Needs to be fixed in `_highs_wrapper`") +@pytest.mark.xfail(run=False, + reason="Needs to be fixed in `_highs_wrapper`") def test_milp_options(capsys): + # run=False now because of gh-16347 message = "Unrecognized options detected: {'ekki'}..." options = {'ekki': True} with pytest.warns(RuntimeWarning, match=message): diff --git a/scipy/sparse/linalg/_eigen/_svds.py b/scipy/sparse/linalg/_eigen/_svds.py index 19544e234956..34fe33e3002a 100644 --- a/scipy/sparse/linalg/_eigen/_svds.py +++ b/scipy/sparse/linalg/_eigen/_svds.py @@ -1,3 +1,4 @@ +import os import numpy as np from .arpack import _arpack # type: ignore[attr-defined] @@ -6,7 +7,11 @@ from scipy._lib._util import check_random_state from scipy.sparse.linalg._interface import LinearOperator, aslinearoperator from scipy.sparse.linalg._eigen.lobpcg import lobpcg # type: ignore[no-redef] -from scipy.sparse.linalg._svdp import _svdp +if os.environ.get("SCIPY_USE_PROPACK"): + from scipy.sparse.linalg._svdp import _svdp + HAS_PROPACK = True +else: + HAS_PROPACK = False from scipy.linalg import svd arpack_int = _arpack.timing.nbx.dtype @@ -297,6 +302,12 @@ def matmat_XH_X(x): eigvec, _ = np.linalg.qr(eigvec) elif solver == 'propack': + if not HAS_PROPACK: + raise ValueError("`solver='propack'` is opt-in due " + "to potential issues on Windows, " + "it can be enabled by setting the " + "`SCIPY_USE_PROPACK` environment " + "variable before importing scipy") jobu = return_singular_vectors in {True, 'u'} jobv = return_singular_vectors in {True, 'vh'} irl_mode = (which == 'SM') diff --git a/scipy/sparse/linalg/_eigen/tests/test_svds.py b/scipy/sparse/linalg/_eigen/tests/test_svds.py index de816c033736..9d3b3f5e9455 100644 --- a/scipy/sparse/linalg/_eigen/tests/test_svds.py +++ b/scipy/sparse/linalg/_eigen/tests/test_svds.py @@ -1,3 +1,4 @@ +import os import re import copy import numpy as np @@ -8,6 +9,10 @@ from scipy.linalg import hilbert, svd, null_space from scipy.sparse import csc_matrix, isspmatrix, spdiags, random from scipy.sparse.linalg import LinearOperator, aslinearoperator +if os.environ.get("SCIPY_USE_PROPACK"): + has_propack = True +else: + has_propack = False from scipy.sparse.linalg import svds from scipy.sparse.linalg._eigen.arpack import ArpackNoConvergence @@ -157,6 +162,8 @@ def test_svds_input_validation_k_1(self, k): # propack can do complete SVD if self.solver == 'propack' and k == 3: + if not has_propack: + pytest.skip("PROPACK not enabled") res = svds(A, k=k, solver=self.solver) _check_svds(A, k, *res, check_usvh_A=True, check_svd=True) return @@ -257,6 +264,9 @@ def test_svds_input_validation_return_singular_vectors(self, rsv): @pytest.mark.parametrize("k", [3, 5]) @pytest.mark.parametrize("which", ["LM", "SM"]) def test_svds_parameter_k_which(self, k, which): + if self.solver == 'propack': + if not has_propack: + pytest.skip("PROPACK not available") # check that the `k` parameter sets the number of eigenvalues/ # eigenvectors returned. # Also check that the `which` parameter sets whether the largest or @@ -274,6 +284,9 @@ def test_svds_parameter_k_which(self, k, which): # loop instead of parametrize for simplicity def test_svds_parameter_tol(self): + if self.solver == 'propack': + if not has_propack: + pytest.skip("PROPACK not available") return # TODO: needs work, disabling for now # check the effect of the `tol` parameter on solver accuracy by solving # the same problem with varying `tol` and comparing the eigenvalues @@ -315,6 +328,9 @@ def err(tol): assert error > accuracy/10 def test_svd_v0(self): + if self.solver == 'propack': + if not has_propack: + pytest.skip("PROPACK not available") # check that the `v0` parameter affects the solution n = 100 k = 1 @@ -347,6 +363,9 @@ def test_svd_v0(self): assert_equal(res1a, res1b) def test_svd_random_state(self): + if self.solver == 'propack': + if not has_propack: + pytest.skip("PROPACK not available") # check that the `random_state` parameter affects the solution # Admittedly, `n` and `k` are chosen so that all solver pass all # these checks. That's a tall order, since LOBPCG doesn't want to @@ -379,6 +398,10 @@ def test_svd_random_state(self): np.random.RandomState(0), np.random.default_rng(0))) def test_svd_random_state_2(self, random_state): + if self.solver == 'propack': + if not has_propack: + pytest.skip("PROPACK not available") + n = 100 k = 1 @@ -397,6 +420,10 @@ def test_svd_random_state_2(self, random_state): np.random.RandomState(0), np.random.default_rng(0))) def test_svd_random_state_3(self, random_state): + if self.solver == 'propack': + if not has_propack: + pytest.skip("PROPACK not available") + n = 100 k = 5 @@ -417,6 +444,9 @@ def test_svd_random_state_3(self, random_state): def test_svd_maxiter(self): # check that maxiter works as expected: should not return accurate # solution after 1 iteration, but should with default `maxiter` + if self.solver == 'propack': + if not has_propack: + pytest.skip("PROPACK not available") A = hilbert(6) k = 1 u, s, vh = sorted_svd(A, k) @@ -443,6 +473,10 @@ def test_svd_maxiter(self): @pytest.mark.parametrize("shape", ((5, 7), (6, 6), (7, 5))) def test_svd_return_singular_vectors(self, rsv, shape): # check that the return_singular_vectors parameter works as expected + if self.solver == 'propack': + if not has_propack: + pytest.skip("PROPACK not available") + rng = np.random.default_rng(0) A = rng.random(shape) k = 2 @@ -521,6 +555,10 @@ def test_svd_return_singular_vectors(self, rsv, shape): aslinearoperator)) def test_svd_simple(self, A, k, real, transpose, lo_type): + if self.solver == 'propack': + if not has_propack: + pytest.skip("PROPACK not available") + A = np.asarray(A) A = np.real(A) if real else A A = A.T if transpose else A @@ -547,6 +585,9 @@ def test_svd_simple(self, A, k, real, transpose, lo_type): def test_svd_linop(self): solver = self.solver + if self.solver == 'propack': + if not has_propack: + pytest.skip("PROPACK not available") nmks = [(6, 7, 3), (9, 5, 4), @@ -720,6 +761,8 @@ def test_svd_LM_zeros_matrix(self, shape, dtype): # ARPACK supports only dtype float, complex, or np.float32 @pytest.mark.parametrize("dtype", (float, complex, np.float32)) def test_small_sigma(self, shape, dtype): + if not has_propack: + pytest.skip("PROPACK not enabled") # https://github.com/scipy/scipy/pull/11829 if dtype == complex and self.solver == 'propack': pytest.skip("PROPACK unsupported for complex dtype") @@ -743,6 +786,8 @@ def test_small_sigma(self, shape, dtype): @pytest.mark.filterwarnings("ignore:The problem size") @pytest.mark.parametrize("dtype", (float, complex, np.float32)) def test_small_sigma2(self, dtype): + if not has_propack: + pytest.skip("PROPACK not enabled") # https://github.com/scipy/scipy/issues/11406 if dtype == complex and self.solver == 'propack': pytest.skip("PROPACK unsupported for complex dtype") diff --git a/scipy/spatial/_qhull.pyx b/scipy/spatial/_qhull.pyx index 9ed3b41b2153..8c9135adcf90 100644 --- a/scipy/spatial/_qhull.pyx +++ b/scipy/spatial/_qhull.pyx @@ -2822,8 +2822,9 @@ class HalfspaceIntersection(_QhullUser): # Run qhull mode_option = "H" - qhull = _Qhull(mode_option.encode(), halfspaces, qhull_options, required_options=None, - incremental=incremental, interior_point=interior_point) + qhull = _Qhull(mode_option.encode(), halfspaces, qhull_options, + required_options=None, incremental=incremental, + interior_point=self.interior_point) _QhullUser.__init__(self, qhull, incremental=incremental) diff --git a/scipy/spatial/tests/test_qhull.py b/scipy/spatial/tests/test_qhull.py index de38994499a0..597837297355 100644 --- a/scipy/spatial/tests/test_qhull.py +++ b/scipy/spatial/tests/test_qhull.py @@ -1008,14 +1008,15 @@ def assert_unordered_allclose(self, arr1, arr2, rtol=1e-7): truths[indexes[0]] = True assert_(truths.all()) - def test_cube_halfspace_intersection(self): - halfspaces = np.array([[-1.0, 0.0, 0.0], - [0.0, -1.0, 0.0], - [1.0, 0.0, -1.0], - [0.0, 1.0, -1.0]]) - feasible_point = np.array([0.5, 0.5]) - - points = np.array([[0.0, 0.0], [1.0, 0.0], [0.0, 1.0], [1.0, 1.0]]) + @pytest.mark.parametrize("dt", [np.float64, int]) + def test_cube_halfspace_intersection(self, dt): + halfspaces = np.array([[-1, 0, 0], + [0, -1, 0], + [1, 0, -2], + [0, 1, -2]], dtype=dt) + feasible_point = np.array([1, 1], dtype=dt) + + points = np.array([[0.0, 0.0], [2.0, 0.0], [0.0, 2.0], [2.0, 2.0]]) hull = qhull.HalfspaceIntersection(halfspaces, feasible_point) diff --git a/scipy/stats/tests/test_axis_nan_policy.py b/scipy/stats/tests/test_axis_nan_policy.py index 8384047fde47..dff380911b61 100644 --- a/scipy/stats/tests/test_axis_nan_policy.py +++ b/scipy/stats/tests/test_axis_nan_policy.py @@ -291,7 +291,11 @@ def unpacker(res): res = unpacker(hypotest(*data, axis=axis, nan_policy=nan_policy, *args, **kwds)) - assert_equal(res[0], statistics) + if hypotest.__name__ in {"gmean"}: + assert_allclose(res[0], statistics, rtol=2e-16) + else: + assert_equal(res[0], statistics) + assert_equal(res[0].dtype, statistics.dtype) if len(res) == 2: assert_equal(res[1], pvalues) diff --git a/scipy/stats/tests/test_mstats_basic.py b/scipy/stats/tests/test_mstats_basic.py index eaca35426b43..284470d31208 100644 --- a/scipy/stats/tests/test_mstats_basic.py +++ b/scipy/stats/tests/test_mstats_basic.py @@ -947,7 +947,8 @@ def test_theilslopes_warnings(): with pytest.warns(RuntimeWarning, match="All `x` coordinates are..."): res = mstats.theilslopes([0, 1], [0, 0]) assert np.all(np.isnan(res)) - with pytest.warns(RuntimeWarning, match="invalid value encountered..."): + with suppress_warnings() as sup: + sup.filter(RuntimeWarning, "invalid value encountered...") res = mstats.theilslopes([0, 0, 0], [0, 1, 0]) assert_allclose(res, (0, 0, np.nan, np.nan)) diff --git a/setup.py b/setup.py index 3f1c01ee6174..fe83f5bae8ae 100755 --- a/setup.py +++ b/setup.py @@ -143,9 +143,9 @@ def get_build_ext_override(): else: BaseBuildExt = PythranBuildExt[npy_build_ext] _pep440 = importlib.import_module('scipy._lib._pep440') - if _pep440.parse(pythran.__version__) < _pep440.Version('0.9.12'): + if _pep440.parse(pythran.__version__) < _pep440.Version('0.11.0'): raise RuntimeError("The installed `pythran` is too old, >= " - "0.9.12 is needed, {} detected. Please " + "0.11.0 is needed, {} detected. Please " "upgrade Pythran, or use `export " "SCIPY_USE_PYTHRAN=0`.".format( pythran.__version__))