diff --git a/doc/release/1.7.3-notes.rst b/doc/release/1.7.3-notes.rst new file mode 100644 index 000000000000..3ed63f0bf357 --- /dev/null +++ b/doc/release/1.7.3-notes.rst @@ -0,0 +1,41 @@ +========================== +SciPy 1.7.3 Release Notes +========================== + +.. contents:: + +SciPy 1.7.3 is a bug-fix release that provides binary wheels +for MacOS arm64 with Python 3.8, 3.9, and 3.10. The MacOS arm64 wheels +are only available for MacOS version 12.0 and greater, as explained +in Issue 14688, linked below. + +Authors +======= + +* Anirudh Dagar +* Ralf Gommers +* Tyler Reddy +* Pamphile Roy +* Olivier Grisel +* Isuru Fernando + +A total of 6 people contributed to this release. +People with a "+" by their names contributed a patch for the first time. +This list of names is automatically generated, and may not be fully complete. + +Issues closed for 1.7.3 +----------------------- + +* `#13364 `__: Segmentation fault on import of scipy.integrate on Apple M1 ARM... +* `#14688 `__: BUG: ARPACK's eigsh & OpenBLAS from Apple Silicon M1 (arm64)... +* `#14991 `__: four CI failures on pre-release job +* `#15077 `__: Remaining test failures for macOS arm64 wheel +* `#15081 `__: BUG: Segmentation fault caused by scipy.stats.qmc.qmc.update_discrepancy + + +Pull requests for 1.7.3 +----------------------- + +* `#14990 `__: BLD: update pyproject.toml for Python 3.10 changes +* `#15086 `__: BUG: out of bounds indexing in stats.qmc.update_discrepancy +* `#15090 `__: MAINT: skip a few failing tests in \`1.7.x\` for macOS arm64 diff --git a/doc/source/release.1.7.3.rst b/doc/source/release.1.7.3.rst new file mode 100644 index 000000000000..d9a1edb29c5c --- /dev/null +++ b/doc/source/release.1.7.3.rst @@ -0,0 +1 @@ +.. include:: ../release/1.7.3-notes.rst diff --git a/doc/source/release.rst b/doc/source/release.rst index b8ce55b17fed..08658ab0bd81 100644 --- a/doc/source/release.rst +++ b/doc/source/release.rst @@ -8,6 +8,7 @@ see the `commit logs `_. .. toctree:: :maxdepth: 1 + release.1.7.3 release.1.7.2 release.1.7.1 release.1.7.0 diff --git a/pavement.py b/pavement.py index 9f9d70f5e6d0..3f3f9d982562 100644 --- a/pavement.py +++ b/pavement.py @@ -69,10 +69,10 @@ #----------------------------------- # Source of the release notes -RELEASE = 'doc/release/1.7.2-notes.rst' +RELEASE = 'doc/release/1.7.3-notes.rst' # Start/end of the log (from git) -LOG_START = 'v1.7.1' +LOG_START = 'v1.7.2' LOG_END = 'maintenance/1.7.x' diff --git a/scipy/stats/_qmc_cy.pyx b/scipy/stats/_qmc_cy.pyx index 1607af63ab44..e6f396930cb1 100644 --- a/scipy/stats/_qmc_cy.pyx +++ b/scipy/stats/_qmc_cy.pyx @@ -246,15 +246,15 @@ cdef double c_update_discrepancy(double[::1] x_new_view, double initial_disc): cdef: Py_ssize_t n = sample_view.shape[0] + 1 - Py_ssize_t xnew_nlines = x_new_view.shape[0] + Py_ssize_t d = sample_view.shape[1] Py_ssize_t i = 0, j = 0, k = 0 double prod = 1, tmp_sum= 0 double disc1 = 0, disc2 = 0, disc3 = 0 - double[::1] abs_ = np.zeros(n, dtype=np.float64) + double[::1] abs_ = np.empty(d, dtype=np.float64) # derivation from P.T. Roy (@tupui) - for i in range(xnew_nlines): + for i in range(d): abs_[i] = fabs(x_new_view[i] - 0.5) prod *= ( 1 + 0.5 * abs_[i] @@ -265,7 +265,7 @@ cdef double c_update_discrepancy(double[::1] x_new_view, prod = 1 for i in range(n - 1): - for j in range(xnew_nlines): + for j in range(d): prod *= ( 1 + 0.5 * abs_[j] + 0.5 * fabs(sample_view[i, j] - 0.5) @@ -276,7 +276,7 @@ cdef double c_update_discrepancy(double[::1] x_new_view, disc2 *= 2 / pow(n, 2) - for i in range(xnew_nlines): + for i in range(d): prod *= 1 + abs_[i] disc3 = 1 / pow(n, 2) * prod diff --git a/scipy/stats/tests/test_qmc.py b/scipy/stats/tests/test_qmc.py index b11a50b992db..68b8ca9625ad 100644 --- a/scipy/stats/tests/test_qmc.py +++ b/scipy/stats/tests/test_qmc.py @@ -12,6 +12,7 @@ from scipy.stats import qmc from scipy.stats._qmc import (van_der_corput, n_primes, primes_from_2_to, update_discrepancy, QMCEngine) +from scipy._lib._pep440 import Version class TestUtils: @@ -177,16 +178,28 @@ def test_discrepancy_parallel(self, monkeypatch): with pytest.raises(ValueError, match="Invalid number of workers..."): qmc.discrepancy(sample, workers=-2) + @pytest.mark.skipif(Version(np.__version__) < Version('1.17'), + reason='default_rng not available for numpy, < 1.17') def test_update_discrepancy(self): + # From Fang et al. Design and modeling for computer experiments, 2006 space_1 = np.array([[1, 3], [2, 6], [3, 2], [4, 5], [5, 1], [6, 4]]) space_1 = (2.0 * space_1 - 1.0) / (2.0 * 6.0) disc_init = qmc.discrepancy(space_1[:-1], iterative=True) - disc_iter = update_discrepancy(space_1[-1], space_1[:-1], - disc_init) + disc_iter = update_discrepancy(space_1[-1], space_1[:-1], disc_init) assert_allclose(disc_iter, 0.0081, atol=1e-4) + # n