Skip to content

Conversation

@swallan
Copy link
Owner

@swallan swallan commented May 31, 2022

Reference issue

What does this implement/fix?

Additional information

eytanadler and others added 30 commits February 15, 2022 15:56
MAINT: better/corrected UNU.RAN licensing information
MAINT: integrate: add `recursive` to QUADPACK Fortran sources
Add typing info for Rotation.concatenate
* ENH: Tweak theilslopes and siegelslopes to return a tuple_bunch

This makes their behavior consistent with stats.linregress
To handle the `boundary` arguments "wrap" and "symm", the `convolve2d`
code computes indices into the first argument that might be negative or
larger than the size of the image.  The code adjusts negative or big
values so that the adjusted index refers to the correct data element
within the array.  The problem was that this adjustment code assumed
that it would only require that the data be extended *once*. E.g. if
an axis had length 100, it assumed that the extended index would be
in [-100, 200].  This is not true in general; the kernel (i.e. the
second argument of `convolve2d`) can be any size, and so the required
extension could be any size.  If the kernel was too big, the adjusted
indices might still be negative or too big, resulting in attempts to
access memory outside of input array's data.  That could result in
reading garbage, or a segmentation fault.

The fix is to use a couple helper functions that can handle arbitrarily
large kernel dimensions when computing the extended data.

Closes gh-8684.
Closes gh-8814.
Closes gh-12686.
Provide comments for the C functions reflect_symm_index(j, m)
and circular_wrap_index(j, m).

Remove some repeated C code that can be covered in a
single code block.
tylerjereddy and others added 29 commits May 28, 2022 11:15
* don't merge until the `1.9.0` release notes have been
finalized + merged & the `maintenance/1.9.x` branch
has been pushed

* this PR is a bit different than in the past because
of the build system modernizations (for what I did
last time see: gh-15168)

* bump version number in `tools/version_utils.py` (used
to be in `setup.py`) and in the new `meson.build`

* `pavement.py` has NOT been updated this time, since it
has been purged from all release docs as far as I can tell
(and so have references to `paver` it seems)

* early draft of `1.10.0` release notes infra (usual procedure
here I think)
BUG/ENH: `lsq_linear`: fixed incorrect `lsmr_tol` in first call to `lsmr`; added `lsmr_max_iter` option and unbounded output
The line:
```
ImportError: cannot import name '_ccallback_c' from 'scipy._lib'
```
can be found in a lot of bug reports floating around on Stack Overflow
and in other places. It has nothing to do with `_ccallback_c` in
all cases I looked at, it's always a generic problem with extension
modules. The solution is typically to reinstall, and the problem
goes away. So say that in the `ImportError` message.

Also seen in gh-16300 just now.
It must be a single line, otherwise the generated metadata is invalid.
See https://github.com/FFY00/meson-python/issues/67
BLD: CI: fix issue in wheel metadata, and add basic "build in Ubuntu venv" CI job
MAINT: add a more informative error message for broken installs
MAINT: revert addition of multivariate_beta
#16117)

* MAINT: stats.wilcoxon: return zstatistic only when method='approx'

Co-authored-by: Matt Haberland <[email protected]>
* REL: update version switcher for 1.8.1

* DOC/REL: update switcher for new version.

[skip ci]

* Update doc/source/dev/core-dev/releasing.rst.inc

Co-authored-by: Tyler Reddy <[email protected]>
[skip azp] [skip actions]
* MAINT: stats: more specific error type from rv_continuous.fit

* MAINT: stats: even more specific error type from rv_continuous.fit

* TST: stats: update tests

* STY: stats: PEP8 indentation correction

[skip ci]

* Start cleaning up stats warnings/errors

* MAINT: stats: begin to collect stats warnings and errors

* MAINT: stats: continue to collect stats warnings and errors

* MAINT: stats: separate warnings and errors from result classes

* Apply suggestions from code review

* DOC: stats: try to render FitError

[skip actions] [skip azp]

* MAINT: stats: tweaks to try to fix doc build issues

[skip actions] [skip azp]

* MAINT: stats: trying something else

* MAINT: stats: fix doc build and refguide issues

* MAINT: stats: remove stats._warnings_errors.rst

* MAINT: stats: revert changes to _binomtest/_hypotest

* MAINT: stats: _warnings_errors does not need to render in docs

* MAINT: stats: link additional custom warnings

[skip azp] [skip actions]

* Apply suggestions from code review

* MAINT: stats: replace boostrap-specific warning with superclass warning

* MAINT: stats: replace ag-specific warning with superclass warning

* MAINT: stats: remove unnecessary parentheses, noqa, space

[skip ci]

* MAINT: stats: replace other test-specific warnings with superclass
* Add Hutch++ estimate for trace

* Allow linear operators in expm_multiply

3 changes are necessary for linear operators:
- the identity matrix has to be replaced by the identity operator
- the trace is not available, we estimate it or let the user provide it
- the 1-norm is not available, we estimate it

* Move trace estimation into expm_multiply module

* Make changes PEP8 compliant

* TST: test expm_multiply interval for given traces

* FIX import names

* Warn if expm_multiply estimates trace of operators

* TST: check expm_multipy for different data types

* TST: test against imprecise data types

* TST: check different combinations of data types

* TST: make test for int harder

* STY: fix line length

* TST: fix order of data type tests

* MAINT: apply ilayn's changes

* Change default parameter for trace estimation

Trace estimation is quite costly, so for a single time step it is typically
hardly worth it. Thus we reduced it to `m3=1`, the correct order of magnitude
is sufficient.

For large number of time steps, the overhead of the trace estimation becomes
less relevant, and the algorithm might benefit more from an accurate estimate.
We choose `m3=5` which is quite arbitrary.

* STY: remove blank line

* Update scipy/sparse/linalg/_expm_multiply.py

Co-authored-by: Ilhan Polat <[email protected]>
Co-authored-by: Tyler Reddy <[email protected]>
* Fixes safe handling of small singular values in svds.

The way to safeguard the computation of singular vectors in the presence
of small singular values currently adopted carries substantial risks of
discarding valid (and valuable) singular values and vectors.

This commit implements alternative way, adopted by scikit-learn's and
raleigh's PCA and truncated SVD solvers, whereby all singular values
(no matter how small) and singular vectors are computed in a stable and
accurate manner.

* BUG: Fixes safe handling of small singular values in scipy.sparse.linalg.svds.

The way to safeguard the computation of singular vectors in the presence
of small singular values currently adopted carries substantial risks of
discarding valid (and valuable) singular values and vectors.

This commit implements alternative way, adopted by scikit-learn's and
raleigh's PCA and truncated SVD solvers, whereby all singular values
(no matter how small) and singular vectors are computed in a stable and
accurate manner.

* added missing partial return handling

* BUG: fixed two bugs in test_arpack.py

* BUG: fixed a bug in test_svd_LM_ones_matrix()

* BUG: another attempt to fix a bug in test_svd_LM_ones_matrix()

* BUG: fixed E261 in arpack.py

* Implemented code optimizations suggested by Olivier Gauthe.

Had to remove 'const' in definitions of xx, vxx and vrr in
spatial/ckdtree.pyx (would not build otherwise).

Added myself to THANKS.txt.

* restored spatial/ckdtree.pyx (spatial/tests/test_kdtree.py failed)

* restored THANKS.txt to avoid conflicts

* corrected the order of singular values and vectors

* updated _svds.py

* added missing imports in _svds.py

* added missing imports in _sdvs.py

* reverted the change in eigensolvers tolerance

* trying to fix this PR mess

* added missing import svd

* added forgotten definition of transpose in _svds.py

* corrected test_svd_LM_ones_matrix and test_svd_return_singular_vectors

* corrected test_svd_LM_ones_matrix

* covered the case return_singular_vectors=True in svds

* corrected a small mistake in _svds.py

* corrected the case return_singular_vectors=True in svds

* added a test that would fail on master but should work on fix-svds

* made small amendments to eliminate checks errors

* restored accidentally deleted line in test_small_sigma

* test_small_sigma to skip propack if matrix is complex

* simplified post-processing of singular vectors

* STY: sparse.linalg: PEP8 newline at end of file

[skip ci]

* renamed unused eigenval variables

* Apply suggestions from code review

Co-authored-by: Pamphile Roy <[email protected]>

* error fixed

* swap the ij order as proposed in review

* docstring update and error fix

adding the reference https://bit.ly/3LprcUa

* lint fix

* added a link to the PR in the test

* changes requested by reviewer

* added unit test sparse small singular values

* temp remove complex dtypes

* filtering out some unrelated failures

* type fix

* typo fix

* multiple edits

* error fix

* disable new tests temporary

* remove back which="SM"

* trying to test vectors

* drop the tol to 1e-6 for vectors

* typo fix, comment out singular vector check temporary

* increase maxiter for lobpcg to converge

* LOBPCG needs larger atol and rtol to pass

* remove test for unsupported dtypes in ARPACK

* docsting updated with info input dtypes

* the new test goes back

* np.abs(s) in sorting singular values

* Revert "np.abs(s) in sorting singular values"

This reverts commit 87bbc40.

* run qr on eigenvectors before RR

* qr mistake fixed

* another qr error fixed

* lint fixes

* new _check_svds_n testing

* ty[ps fixed

* typo fixed

* error fix

* errors fixed

* error fixed

* tol adjustments

* lint fix

* remove ARPACK from check_svd

ARPACK often misses nearly multiple singular values

* lint fix + trying PROPACK

* PROPACK removed from tests as unrelated to PR

* lint fix

* test overwrite_a=True in svd

* another test added

#11406

* errors fixed

* tol adjustment + ignore warning

* to adjust

* tol adjust

* comment out 1 failing assert

* atol and rtol adjusted to pass np.float32

* comment in a modified assert

#11829 (comment)

* trying to fix test_small_sigma_sparse

* implemented singular vectors refining necessary for very small singular values

* minor edit just to run the tests

* fixed most test failures

* fixed res_tol and final RR procedure in _svds.py

* fixed a bug in computing singular vectors as eigenvectors of X_XH

* added missing import randn

* dropped singular vectors refinement as arpack and lobpcg fail to deal with X_XH

* 2 lint fixes

* Update scipy/sparse/linalg/_eigen/_svds.py

Co-authored-by: Pamphile Roy <[email protected]>

* unused removed as suggested + formatting in 1 line

* removed no longer used functions

* extra empty line removed

* run extra qr for lobpcg only + comment

    # solver lobpcg does not guarantee exactly orthonormal eigenvectors
    if solver == 'lobpcg':
        eigvec, _ = np.linalg.qr(eigvec)

* move qr to the right place as proposed

Co-authored-by: Evgueni Ovtchinnikov <eeo@CCPPETMR>
Co-authored-by: Matt Haberland <[email protected]>
Co-authored-by: Andrew Knyazev <[email protected]>
Co-authored-by: Pamphile Roy <[email protected]>
Co-authored-by: lobpcg <[email protected]>
* DOC: prep 1.9.0 release notes

* transcribe entries from the wiki page (the history of this page
will be used to update again before branching)
* draft in results from author/list scripts
* some initial manual curation of the author list via `.mailmap` adjustments
* manually update the notes based on merged PRs with `enhancement` label (for
those cases where it struck me as pertinent to mention)
* the "highlights" are still open to adjustment of course; simply
copied from the wiki for now--`meson` comes to mind depending on where
we land near the end of the week?

[skip azurepipelines] [skip github]

* MAINT, DOC: PR 16248 revisions

* release note formatting adjustments that allow `make html-scipyorg`
to pass locally

* fuse the two `Other ..` themed sections

* deal with some `interpolate` comments from Evgeni

* deal with some `stats` comments from Pamphile

* move the "lazy import" description to the `Other ..` section
and modify the description based on feedback from Ralf

* add a highlight for `meson` build system adoption

* various RST formatting/style fixes from code review

* apply some suggestions from Matt Haberland

* fixed a bug where `gh_lists.py` would include milestoned PRs
that were closed instead of genuinely merged (and updated the
lists in release notes while I was at it)

* Update doc/release/1.9.0-notes.rst [ci skip]

Co-authored-by: Matt Haberland <[email protected]>

* MAINT, DOC: PR 16248 revisions

* fix up the formatting of the `Expired Deprecations`
and `Lazy access to subpackages` sections

* update the lists of `1.9.0` authors, issues, and PRs

* transfer over any last-minute updates to the wiki
version of the relnotes

* remove the titles of some empty sections in the relnotes

* Update doc/release/1.9.0-notes.rst

Co-authored-by: Matt Haberland <[email protected]>

* DOC: add more PR/issue

* DOC: fix some single/double backtick issues

Co-authored-by: Matt Haberland <[email protected]>
The answer speaks about working with the Meson maintainers to make the
warnings less scary. This has happened, so the guidance is outdated.

Keep the FAQ entry, because it is still relevant as long as the oldest
supported Meson build requirement is less than the version in which the
warning disappeared. Instead, amend the guidance to state that upgrading
Meson will, in fact, make it disappear.

[ci skip]
@swallan swallan merged commit 9457571 into swallan:main May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.