Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: 1.9.3 backports #17239

Merged
merged 50 commits into from Oct 19, 2022

Commits on Oct 16, 2022

  1. BUG: multivariate_normal returns a pdf for values outside its support…

    … when covariance is singular (scipy#5288)
    
    Co-authored-by: Matt Haberland <mhaberla@calpoly.edu>
    Co-authored-by: Tirth Patel <tirthasheshpatel@gmail.com>
    3 people authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    3725829 View commit details
    Browse the repository at this point in the history
  2. Bug: setting iprint=0 hides all output from fmin_l_bfgs_b, but it sho…

    …uld print convergence info from final iteration. (scipy#13322)
    
    * BUG: optimize: fixed 13321
    A bug in the way the `iprint` and `disp` arguments were handled
    made it impossible to run the code with `iprint=0`, since it was
    overwritten from the `disp` handling.
    
    Co-authored-by: Matt Haberland <mhaberla@calpoly.edu>
    2 people authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    dc2e755 View commit details
    Browse the repository at this point in the history
  3. BUG: stats: Reformulate loggamma._rvs to handle c << 1. (scipy#13349)

    * BUG: stats: Reformulate loggamma._rvs to handle c << 1.
    
    Closes scipygh-11094.
    
    Several tests in test_morestats.py call loggamma.rvs to generate
    test data.  These tests have hardcoded expected results that
    depend on the values in the input data.  Because the stream
    of variates generated by loggamma.rvs has changed, those tests
    will fail if the input data is generated by loggamma.rvs.  Instead,
    the data that was generated by a new function that takes the log of random variates from `stats.gamma.rvs`.
    
    Co-authored-by: Matt Haberland <mhaberla@calpoly.edu>
    2 people authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    e5cd7d1 View commit details
    Browse the repository at this point in the history
  4. BUG: fix powell evaluated outside limits (scipy#15363)

    * BUG: fix powell evaluated outside limits
    
    Co-authored-by: Joseph T. Iosue <jtiosue@gmail.com>
    2 people authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    e9bbd4c View commit details
    Browse the repository at this point in the history
  5. BUG: stats.rv_histogram: address issue with non-uniform bins (scipy#1…

    …5381)
    
    The documentation of `rv_histogram` was ambiguous about what it expected as input when bin sizes vary: counts or density? Adding to the confusion, the default behavior of `rv_histogram` was to assume that the input was a density, whereas the default of `np.histogram` is to produce bin counts. To resolve this, this PR adds a parameter `density` so that the user can specify whether the input is to be treated as counts or probability density. Because the default is different from that of `np.histogram`, this also warns the user to pass `density` explicitly.
    
    Co-authored-by: Matt Haberland <mhaberla@calpoly.edu>
    2 people authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    a578d35 View commit details
    Browse the repository at this point in the history
  6. Copy the full SHA
    5d811d9 View commit details
    Browse the repository at this point in the history
  7. BUG: fix a crash in fpknot

    Caused by an OOB access due to uninitialized local variables.
    
    Fixes scipy#3691.
    nkaretnikov authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    1772419 View commit details
    Browse the repository at this point in the history
  8. Copy the full SHA
    7dda8a2 View commit details
    Browse the repository at this point in the history
  9. MAINT: stats.ttest_ind: randomized permutation pvalue should not be z…

    …ero (scipy#16460)
    
    MAINT: stats.ttest_ind: randomized permutation pvalue should not be zero  
    
    Co-authored-by: Matt Haberland <mhaberla@calpoly.edu>
    2 people authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    c71ef7f View commit details
    Browse the repository at this point in the history
  10. MAINT: fix SHGO extra arguments (scipy#16506)

    * Fix bug scipy#14589 where arguments to objective function aren't passed properly
    
    Co-authored-by: J. J. Ramsey <jjramsey@pobox.com>
    2 people authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    c37710c View commit details
    Browse the repository at this point in the history
  11. Copy the full SHA
    9e4cfe1 View commit details
    Browse the repository at this point in the history
  12. Copy the full SHA
    ef309d1 View commit details
    Browse the repository at this point in the history
  13. Copy the full SHA
    21c3355 View commit details
    Browse the repository at this point in the history
  14. BUG: fix syevr series segfault by explicitly specifying operator prio…

    …rity
    
    With numpy 1.22.x f2py, dimension of isuppz in syevr is mistranslated.
    Avoid this by explicitly specifying operator priority with parenthesis.
    
    Fixes scipy#16527
    mtasaka authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    8499d8a View commit details
    Browse the repository at this point in the history
  15. Copy the full SHA
    417686c View commit details
    Browse the repository at this point in the history
  16. Copy the full SHA
    dcd6f45 View commit details
    Browse the repository at this point in the history
  17. Copy the full SHA
    8d16545 View commit details
    Browse the repository at this point in the history
  18. Copy the full SHA
    b45f0fd View commit details
    Browse the repository at this point in the history
  19. TST: stats.vonmises: fix rvs test

    mdhaber authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    862088c View commit details
    Browse the repository at this point in the history
  20. Copy the full SHA
    22207e4 View commit details
    Browse the repository at this point in the history
  21. BUG: eps param no effect fixed (scipy#16630)

    Co-authored-by: Pamphile Roy <roy.pamphile@gmail.com>
    2 people authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    05c4908 View commit details
    Browse the repository at this point in the history
  22. Copy the full SHA
    42bd049 View commit details
    Browse the repository at this point in the history
  23. fix_integer_overflow_check

    Lechnio authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    589731f View commit details
    Browse the repository at this point in the history
  24. BUG: interpolate: use INTPTR_MAX

    to guard against /detect the integer overflow
    
    Co-authored-by: peterbell10 <peterbell10@live.co.uk>
    2 people authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    b3a8cfa View commit details
    Browse the repository at this point in the history
  25. BUG: interpolate/fitpackmodule: use INT_MAX for the overflow threshold

    Also cast integers to npy_intp, because cannot use size_t in
    PyArray_SimpleNew et al (it expects signed integers)
    
    Co-authored-by: Matthew Brett <matthew.brett@gmail.com>
    2 people authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    f238b2b View commit details
    Browse the repository at this point in the history
  26. MAINT: interpolate: remove an obsolete comment in fitpackmodule.c

    The file maybe used to be autogenerated, but has since been updated manually
    many times over by several people on several occasions. The autogeneration
    script is also long gone, too.
    
    For completeness, the original version (or a close approximation to it)
    is now available at https://github.com/matthew-brett/multipack ---
    this repository content is from a Waybackmachine archive of Travis Oliphant's
    website, found by Matthew Brett. The archive was trawled on September 29 2000.
    (https://web.archive.org/web/20000929143650/http://oliphant.netpedia.net/packages/multipack-0.7.tar.gz)
    
    Co-authored-by: Matthew Brett <matthew.brett@gmail.com>
    2 people authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    d24f4f2 View commit details
    Browse the repository at this point in the history
  27. BUG: interpolate: improve the logic for catching the overflow

    Make sure that the product mx*my is <= min(max NPY_INTP, fortan int)
    to avoid an overflow on both C and Fortran sides on 32- and 64-bit
    systems with and without HAVE_ILP64 (which make Fortran ints 32- or 64-bit, too)
    matthew-brett authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    ea79559 View commit details
    Browse the repository at this point in the history
  28. Copy the full SHA
    63b0a35 View commit details
    Browse the repository at this point in the history
  29. BUG: sparse: Fix indexing sparse matrix with empty index arguments.

    When a sparse matrix was indexed with an argument that was effectively
    empty (e.g. `0:0:2`, `[]`, `[False, False]`), the dtype of the matrix
    was lost and the result became float64.
    
    Closes scipygh-16656.
    WarrenWeckesser authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    5a5df44 View commit details
    Browse the repository at this point in the history
  30. Copy the full SHA
    2d0edd5 View commit details
    Browse the repository at this point in the history
  31. Copy the full SHA
    1bf753c View commit details
    Browse the repository at this point in the history
  32. MAINT: stats.boltzmann: correct _shape_info typo (scipy#16752)

    * MAINT: stats.boltzmann: correct _shape_info typo
    mdhaber authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    76d02b2 View commit details
    Browse the repository at this point in the history
  33. BUG: interpolate: sanity check x and y in make_interp_spline(x, y, k=…

    …0) and k=1 (scipy#16780)
    
    Co-authored-by: Jake Bowhay <60778417+j-bowhay@users.noreply.github.com>
    2 people authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    1745d9b View commit details
    Browse the repository at this point in the history
  34. DEV: support IBM i system

    GavinGZhang authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    b35393a View commit details
    Browse the repository at this point in the history
  35. BUG: interpolate: work array sizes for RectSphereBivariateSpline (sci…

    …py#16872)
    
    Make sure that `nuest` parameter is large enough when `s=0` and
    `pole_continuity=(True, True)`. This value translates to
    `iopt(2) = iopt(3) = 1` in the FITPACK routine `spgrid.f`.
    This routine contains the following comment:
    
    c  nuest : integer. unchanged on exit.
    c  nvest : integer. unchanged on exit.
    c          on entry, nuest and nvest must specify an upper bound for the
    c          number of knots required in the u- and v-directions respect.
    c          these numbers will also determine the storage space needed by
    c          the routine. nuest >= 8, nvest >= 8.
    c          in most practical situation nuest = mu/2, nvest=mv/2, will
    c          be sufficient. always large enough are nuest=mu+6+iopt(2)+
    c          iopt(3), nvest = mv+7, the number of knots needed for
    c          interpolation (s=0).
    
    Therefore, we set in the f2py wrappers `nuest = mu+6+2`, which is
    the maximum possible value, since each `iopt` array element is at most
    one.
    ev-br authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    a131701 View commit details
    Browse the repository at this point in the history
  36. BUG: linalg: Simplify test_sgesdd_lwork_bug_workaround() (scipy#16965)

    The test of the _compute_lwork() work-around for a bug in
    LAPACK versions older than 3.10.1 is simplified.  Instead
    of calling svd() in a subprocess with a large input array
    and checking that it doesn't crash Python, we check that
    the function sgesdd_lwork() returns the correct value.  It
    is the incorrect value that resulted in the Python crash,
    so this is a simpler test of the same issue.
    WarrenWeckesser authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    9e170fe View commit details
    Browse the repository at this point in the history
  37. MAINT: fix small LSMR problem (scipy#17043)

    [skip ci]
    mreineck authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    99bb5ab View commit details
    Browse the repository at this point in the history
  38. Copy the full SHA
    29330da View commit details
    Browse the repository at this point in the history
  39. FIX: special: use intended branching for lamv implementation

    Change `lamv` implementation to use intended branching for assignment
    to variable `cs` and avoid useless assignment to implicitly typed
    variable `elsecs`.
    
    See scipy#17104
    See lfortran/lfortran#779
    
    Signed-off-by: Sebastian Ehlert <28669218+awvwgk@users.noreply.github.com>
    awvwgk authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    176143a View commit details
    Browse the repository at this point in the history
  40. Copy the full SHA
    9f0588b View commit details
    Browse the repository at this point in the history
  41. Update scipy/stats/tests/test_discrete_basic.py

    [skip ci]
    mdhaber authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    6c3514f View commit details
    Browse the repository at this point in the history
  42. BUG: special: Fix two XSLOW test failures. (scipy#17190)

    When SCIPY_XSLOW is defined, the tests `test_riemann_zeta` and `test_zetac`
    (that compare the results of `zeta` and `zetac` to the results computed
    with `mpmath`) are run with 5000 points, and it turns out that the input
    value 1 is included in that case.  The SciPy functions returns `inf`, but
    `mpmath.zeta(1)` raises an exception, and that caused the tests to fail.
    
    The fix is to wrap the `mpmath` function to return `mpmath.inf` when the
    input is 1.  After fixing that, both tests then failed because some inputs
    result in a relative error of roughly 2e-13, so I bumped the tolerance up
    to 5e-13.
    WarrenWeckesser authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    95cdfed View commit details
    Browse the repository at this point in the history
  43. MAINT: update meson.build to make it work on IBM i system (scipy#17193)

    [ci skip]
    
    Co-authored-by: GavinZhang <zhanggan@cn.ibm.com>
    Co-authored-by: Ralf Gommers <ralf.gommers@gmail.com>
    3 people authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    5370f15 View commit details
    Browse the repository at this point in the history
  44. BLD: fix issue with incomplete threads dependency handling (scipy#17200)

    All could using `#include <thread>` needs to have this `thread_dep`
    dependency. HiGHS code was missing it, and for `stats/_qmc_cy.pyx`
    it was incorrectly specified.
    
    It's wrong in the distutils build as well, but let's ignore that
    since it's much harder to change and we'll get rid of that build
    soon.
    
    See scipygh-17193 for the type of compile error this causes.
    
    [ci skip]
    rgommers authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    f473888 View commit details
    Browse the repository at this point in the history
  45. DOC: stats.mode: add versionadded tag and correct order of keepdims d…

    …escription (scipy#17204)
    
    DOC: stats.mode: add versionadded tag and correct order of keepdims description
    Lakshayainani authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    a9a6582 View commit details
    Browse the repository at this point in the history
  46. BLD: fix invalid shebang for build helper script

    Shebangs do not work this way, but Meson could usually paper over the
    differences by noticing that the last element is "python3" and rewiring
    it to use its own sys.executable. However, this failed on WSL, likely
    because platform quirks meant the script was directly executable, while
    simultaneously having a shebang that was a fatal error.
    
    Use a standard shebang indicating this script would like to run with
    some form of python3 (which is exactly what it needs).
    
    Fixes scipy#17020
    eli-schwartz authored and tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    2db3440 View commit details
    Browse the repository at this point in the history
  47. Copy the full SHA
    381089e View commit details
    Browse the repository at this point in the history
  48. MAINT: PR 17239 revisions

    * fix missing import from cherry-picked patch
    tylerjereddy committed Oct 16, 2022
    Copy the full SHA
    ba5f6da View commit details
    Browse the repository at this point in the history

Commits on Oct 17, 2022

  1. MAINT: Handle numpy's deprecation of accepting out-of-bound integers.

    After the change in numpy/numpy#22385, numpy
    raises a deprecation warning with calls such as np.int8(5000) and
    np.uint32(-1).  This change avoids such calls in the tests.
    WarrenWeckesser authored and tylerjereddy committed Oct 17, 2022
    Copy the full SHA
    92d892e View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    ba33e43 View commit details
    Browse the repository at this point in the history