From cd29a9016c9404e6dcb7b823fe939398865f0327 Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Wed, 6 Dec 2023 10:10:31 -0400 Subject: [PATCH 01/25] Restore missing asstr import The user of this import was removed in the cleanup in #25111, post-2.26. --- numpy/f2py/tests/util.py | 1 + 1 file changed, 1 insertion(+) diff --git a/numpy/f2py/tests/util.py b/numpy/f2py/tests/util.py index 75b257cdb825..6ed6c0855fb8 100644 --- a/numpy/f2py/tests/util.py +++ b/numpy/f2py/tests/util.py @@ -20,6 +20,7 @@ import numpy from pathlib import Path +from numpy.compat import asstr from numpy._utils import asunicode from numpy.testing import temppath, IS_WASM from importlib import import_module From 864f50380f8220dfc36b762310c567f071ac6d99 Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Tue, 2 Jan 2024 16:07:42 -0700 Subject: [PATCH 02/25] MAINT: prepare 1.26.x for further development --- doc/source/release.rst | 1 + doc/source/release/1.26.4-notes.rst | 18 ++++++++++++++++++ pavement.py | 2 +- pyproject.toml | 2 +- pyproject.toml.setuppy | 2 +- 5 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 doc/source/release/1.26.4-notes.rst diff --git a/doc/source/release.rst b/doc/source/release.rst index 0af815c16a46..69ff5b7777e6 100644 --- a/doc/source/release.rst +++ b/doc/source/release.rst @@ -5,6 +5,7 @@ Release notes .. toctree:: :maxdepth: 3 + 1.26.4 1.26.3 1.26.2 1.26.1 diff --git a/doc/source/release/1.26.4-notes.rst b/doc/source/release/1.26.4-notes.rst new file mode 100644 index 000000000000..f8d46cb12673 --- /dev/null +++ b/doc/source/release/1.26.4-notes.rst @@ -0,0 +1,18 @@ +.. currentmodule:: numpy + +========================== +NumPy 1.26.4 Release Notes +========================== + +NumPy 1.26.4 is a maintenance release that fixes bugs and regressions +discovered after the 1.26.3 release. The most notable changes are the f2py bug +fixes. The Python versions supported by this release are 3.9-3.12. + + +Contributors +============ + + +Pull requests merged +==================== + diff --git a/pavement.py b/pavement.py index 649e19d1fd1f..fac0955a7892 100644 --- a/pavement.py +++ b/pavement.py @@ -38,7 +38,7 @@ #----------------------------------- # Path to the release notes -RELEASE_NOTES = 'doc/source/release/1.26.3-notes.rst' +RELEASE_NOTES = 'doc/source/release/1.26.4-notes.rst' #------------------------------------------------------- diff --git a/pyproject.toml b/pyproject.toml index 9ba86eb13486..2b047e5fe816 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ requires = [ [project] name = "numpy" -version = "1.26.3" +version = "1.26.4" # TODO: add `license-files` once PEP 639 is accepted (see meson-python#88) license = {file = "LICENSE.txt"} diff --git a/pyproject.toml.setuppy b/pyproject.toml.setuppy index dd97279fa503..c9bd3e2208e5 100644 --- a/pyproject.toml.setuppy +++ b/pyproject.toml.setuppy @@ -3,7 +3,7 @@ # to avoid building with Meson (e.g., in the Emscripten/Pyodide CI job) [project] name = "numpy" -version = "1.26.3" +version = "1.26.4" [build-system] requires = [ From 999f530cb8b9e8433c46417601fee2d176829154 Mon Sep 17 00:00:00 2001 From: Lucas Colley Date: Fri, 22 Sep 2023 13:19:11 +0100 Subject: [PATCH 03/25] BUG: array_api: fix cholesky upper decomp for complex dtypes [skip travis] [skip azp] [skip circle] [skip cirrus] --- numpy/array_api/linalg.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/numpy/array_api/linalg.py b/numpy/array_api/linalg.py index 09af9dfc3ae2..c18360f6e6f9 100644 --- a/numpy/array_api/linalg.py +++ b/numpy/array_api/linalg.py @@ -9,6 +9,7 @@ complex128 ) from ._manipulation_functions import reshape +from ._elementwise_functions import conj from ._array_object import Array from ..core.numeric import normalize_axis_tuple @@ -53,7 +54,10 @@ def cholesky(x: Array, /, *, upper: bool = False) -> Array: raise TypeError('Only floating-point dtypes are allowed in cholesky') L = np.linalg.cholesky(x._array) if upper: - return Array._new(L).mT + U = Array._new(L).mT + if U.dtype in [complex64, complex128]: + U = conj(U) + return U return Array._new(L) # Note: cross is the numpy top-level namespace, not np.linalg From 209be151ed42b7b840360de7ecf15a4c359315c9 Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Sun, 14 Jan 2024 16:54:46 +0100 Subject: [PATCH 04/25] CI: Bump azure pipeline timeout to 120 minutes Not sure if this will work, but maybe the default of 60minutes is just suddenly (correctly?) enforced. I didn't see any note that it changed with a quick google. --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ce78d07777fa..e0b4b1f3c8bc 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -85,6 +85,7 @@ stages: displayName: 'Run 32-bit manylinux2014 Docker Build / Tests' - job: Windows + timeoutInMinutes: 120 pool: vmImage: 'windows-2019' strategy: From 6630f0f3fff3ef56d75d65801db1e4a08808e959 Mon Sep 17 00:00:00 2001 From: Sayed Adel Date: Tue, 9 Jan 2024 16:16:39 +0400 Subject: [PATCH 05/25] MAINT, BLD: Fix unused inline functions warnings on clang --- .../src/umath/loops_arithmetic.dispatch.c.src | 14 +++++++++-- .../umath/loops_exponent_log.dispatch.c.src | 24 ------------------- .../src/umath/loops_minmax.dispatch.c.src | 3 ++- .../umath/loops_trigonometric.dispatch.c.src | 9 ++++--- .../core/src/umath/loops_unary.dispatch.c.src | 7 ++++-- 5 files changed, 25 insertions(+), 32 deletions(-) diff --git a/numpy/core/src/umath/loops_arithmetic.dispatch.c.src b/numpy/core/src/umath/loops_arithmetic.dispatch.c.src index e07bb79808af..d056046e054a 100644 --- a/numpy/core/src/umath/loops_arithmetic.dispatch.c.src +++ b/numpy/core/src/umath/loops_arithmetic.dispatch.c.src @@ -36,12 +36,20 @@ * q = TRUNC((n - (-dsign ) + (-nsign))/d) - (-qsign); ********************************************************************************/ +#if (defined(NPY_HAVE_VSX) && !defined(NPY_HAVE_VSX4)) || defined(NPY_HAVE_NEON) + // Due to integer 128-bit multiplication emulation, SIMD 64-bit division + // may not perform well on both neon and up to VSX3 compared to scalar + // division. + #define SIMD_DISABLE_DIV64_OPT +#endif + #if NPY_SIMD /**begin repeat * Signed types * #sfx = s8, s16, s32, s64# * #len = 8, 16, 32, 64# */ +#if @len@ < 64 || (@len@ == 64 && !defined(SIMD_DISABLE_DIV64_OPT)) static inline void simd_divide_by_scalar_contig_@sfx@(char **args, npy_intp len) { @@ -101,6 +109,7 @@ simd_divide_by_scalar_contig_@sfx@(char **args, npy_intp len) } npyv_cleanup(); } +#endif /**end repeat**/ /**begin repeat @@ -108,6 +117,7 @@ simd_divide_by_scalar_contig_@sfx@(char **args, npy_intp len) * #sfx = u8, u16, u32, u64# * #len = 8, 16, 32, 64# */ +#if @len@ < 64 || (@len@ == 64 && !defined(SIMD_DISABLE_DIV64_OPT)) static inline void simd_divide_by_scalar_contig_@sfx@(char **args, npy_intp len) { @@ -129,6 +139,7 @@ simd_divide_by_scalar_contig_@sfx@(char **args, npy_intp len) } npyv_cleanup(); } +#endif /**end repeat**/ #if defined(NPY_HAVE_VSX4) @@ -335,8 +346,7 @@ vsx4_simd_divide_contig_@sfx@(char **args, npy_intp len) #define TO_SIMD_SFX(X) X##_s@len@ /**end repeat1**/ #endif - -#if NPY_BITSOF_@TYPE@ == 64 && !defined(NPY_HAVE_VSX4) && (defined(NPY_HAVE_VSX) || defined(NPY_HAVE_NEON)) +#if NPY_BITSOF_@TYPE@ == 64 && defined(SIMD_DISABLE_DIV64_OPT) #undef TO_SIMD_SFX #endif diff --git a/numpy/core/src/umath/loops_exponent_log.dispatch.c.src b/numpy/core/src/umath/loops_exponent_log.dispatch.c.src index 1fac3c150c73..85dac9c20dd8 100644 --- a/numpy/core/src/umath/loops_exponent_log.dispatch.c.src +++ b/numpy/core/src/umath/loops_exponent_log.dispatch.c.src @@ -123,18 +123,6 @@ fma_blend(__m256 x, __m256 y, __m256 ymask) return _mm256_blendv_ps(x, y, ymask); } -NPY_FINLINE __m256 -fma_invert_mask_ps(__m256 ymask) -{ - return _mm256_andnot_ps(ymask, _mm256_set1_ps(-1.0)); -} - -NPY_FINLINE __m256i -fma_invert_mask_pd(__m256i ymask) -{ - return _mm256_andnot_si256(ymask, _mm256_set1_epi32(0xFFFFFFFF)); -} - NPY_FINLINE __m256 fma_get_exponent(__m256 x) { @@ -311,18 +299,6 @@ avx512_blend(__m512 x, __m512 y, __mmask16 ymask) return _mm512_mask_mov_ps(x, ymask, y); } -NPY_FINLINE __mmask16 -avx512_invert_mask_ps(__mmask16 ymask) -{ - return _mm512_knot(ymask); -} - -NPY_FINLINE __mmask8 -avx512_invert_mask_pd(__mmask8 ymask) -{ - return _mm512_knot(ymask); -} - NPY_FINLINE __m512 avx512_get_exponent(__m512 x) { diff --git a/numpy/core/src/umath/loops_minmax.dispatch.c.src b/numpy/core/src/umath/loops_minmax.dispatch.c.src index 236e2e2eb760..319072c01fbe 100644 --- a/numpy/core/src/umath/loops_minmax.dispatch.c.src +++ b/numpy/core/src/umath/loops_minmax.dispatch.c.src @@ -225,7 +225,8 @@ simd_binary_ccc_@intrin@_@sfx@(const npyv_lanetype_@sfx@ *ip1, const npyv_lanety } } // non-contiguous for float 32/64-bit memory access -#if @is_fp@ +#if @is_fp@ && !defined(NPY_HAVE_NEON) +// unroll scalars faster than non-contiguous vector load/store on Arm static inline void simd_binary_@intrin@_@sfx@(const npyv_lanetype_@sfx@ *ip1, npy_intp sip1, const npyv_lanetype_@sfx@ *ip2, npy_intp sip2, diff --git a/numpy/core/src/umath/loops_trigonometric.dispatch.c.src b/numpy/core/src/umath/loops_trigonometric.dispatch.c.src index f07cb70f3977..31de906098e3 100644 --- a/numpy/core/src/umath/loops_trigonometric.dispatch.c.src +++ b/numpy/core/src/umath/loops_trigonometric.dispatch.c.src @@ -19,8 +19,9 @@ /**begin repeat * #check = F64, F32# * #sfx = f64, f32# + * #enable = 0, 1# */ -#if NPY_SIMD_@check@ +#if NPY_SIMD_@check@ && @enable@ /* * Vectorized Cody-Waite range reduction technique * Performs the reduction step x* = x - y*C in three steps: @@ -39,8 +40,10 @@ simd_range_reduction_@sfx@(npyv_@sfx@ x, npyv_@sfx@ y, npyv_@sfx@ c1, npyv_@sfx@ } #endif /**end repeat**/ - -#if NPY_SIMD_F64 +/* Disable SIMD code and revert to libm: see + * https://mail.python.org/archives/list/numpy-discussion@python.org/thread/C6EYZZSR4EWGVKHAZXLE7IBILRMNVK7L/ + * for detailed discussion on this*/ +#if 0 // NPY_SIMD_F64 /**begin repeat * #op = cos, sin# */ diff --git a/numpy/core/src/umath/loops_unary.dispatch.c.src b/numpy/core/src/umath/loops_unary.dispatch.c.src index 1e2a81d20b24..bfe4d892d0c9 100644 --- a/numpy/core/src/umath/loops_unary.dispatch.c.src +++ b/numpy/core/src/umath/loops_unary.dispatch.c.src @@ -195,6 +195,8 @@ simd_unary_nc_@intrin@_@sfx@(const npyv_lanetype_@sfx@ *ip, npy_intp istride, #undef UNROLL #define UNROLL 2 #endif +// X86 does better with unrolled scalar for heavy non-contiguous +#ifndef NPY_HAVE_SSE2 static NPY_INLINE void simd_unary_nn_@intrin@_@sfx@(const npyv_lanetype_@sfx@ *ip, npy_intp istride, npyv_lanetype_@sfx@ *op, npy_intp ostride, @@ -226,6 +228,7 @@ simd_unary_nn_@intrin@_@sfx@(const npyv_lanetype_@sfx@ *ip, npy_intp istride, *op = scalar_@intrin@(*ip); } } +#endif // NPY_HAVE_SSE2 #endif // @supports_ncontig@ #undef UNROLL #endif // @simd_chk@ @@ -314,8 +317,8 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(@TYPE@_@kind@) ); goto clear; } - // SSE2 does better with unrolled scalar for heavy non-contiguous - #if !defined(NPY_HAVE_SSE2) + // X86 does better with unrolled scalar for heavy non-contiguous + #ifndef NPY_HAVE_SSE2 else if (istride != 1 && ostride != 1) { // non-contiguous input and output TO_SIMD_SFX(simd_unary_nn_@intrin@)( From f947f41fa3f64721469493143099b993bf7c0fb9 Mon Sep 17 00:00:00 2001 From: Sayed Adel Date: Tue, 9 Jan 2024 22:29:07 +0400 Subject: [PATCH 06/25] MAINT: Comment in the unused overload of call_geev To avoid unsed warrning on clang --- numpy/linalg/umath_linalg.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/numpy/linalg/umath_linalg.cpp b/numpy/linalg/umath_linalg.cpp index b0857ab8ba1d..135e89119e17 100644 --- a/numpy/linalg/umath_linalg.cpp +++ b/numpy/linalg/umath_linalg.cpp @@ -2259,7 +2259,7 @@ process_geev_results(GEEV_PARAMS_t *params, scalar_trait) } } - +#if 0 static inline fortran_int call_geev(GEEV_PARAMS_t* params) { @@ -2275,6 +2275,8 @@ call_geev(GEEV_PARAMS_t* params) &rv); return rv; } +#endif + static inline fortran_int call_geev(GEEV_PARAMS_t* params) { From 97d1af91d230c8b628ef59d6164a641997dcb44a Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Tue, 16 Jan 2024 18:48:58 +0100 Subject: [PATCH 07/25] BLD: include fix for MinGW platform detection Closes gh-25518 --- vendored-meson/meson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendored-meson/meson b/vendored-meson/meson index e6e1bf974b25..4e370ca8ab73 160000 --- a/vendored-meson/meson +++ b/vendored-meson/meson @@ -1 +1 @@ -Subproject commit e6e1bf974b2557974c06254c2447e862a59aae7f +Subproject commit 4e370ca8ab73c07f7b84abe8a4b937caace050a4 From f4e606a379e1d14a8d1646f288291e1e3ddc9053 Mon Sep 17 00:00:00 2001 From: Mark Ryan Date: Tue, 19 Dec 2023 12:22:10 +0000 Subject: [PATCH 08/25] TST: Fix test_numeric on riscv64 Modify test_numeric so that it passes on riscv64. The subtest TestBoolCmp::test_float currently fails on riscv64 as it assumes that the sign of -np.nan is retained when stored to and read back from an array. This is not always the case on riscv64. Many RISC-V instructions that produce NaNs return a canonical NaN, as defined by the RISC-V specification. The canonical NaNs are always positive. In this particular test the negative sign of the -np.nan is lost when it is converted from a double to a float before being stored in self.signf. We disable the float32 sign tests for -np.nan on riscv64 allowing test_numeric to pass. --- numpy/core/tests/test_numeric.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/numpy/core/tests/test_numeric.py b/numpy/core/tests/test_numeric.py index d2d041f71ef2..e5edd3efce5a 100644 --- a/numpy/core/tests/test_numeric.py +++ b/numpy/core/tests/test_numeric.py @@ -477,7 +477,14 @@ def setup_method(self): self.signd[self.ed] *= -1. self.signf[1::6][self.ef[1::6]] = -np.inf self.signd[1::6][self.ed[1::6]] = -np.inf - self.signf[3::6][self.ef[3::6]] = -np.nan + # On RISC-V, many operations that produce NaNs, such as converting + # a -NaN from f64 to f32, return a canonical NaN. The canonical + # NaNs are always positive. See section 11.3 NaN Generation and + # Propagation of the RISC-V Unprivileged ISA for more details. + # We disable the float32 sign test on riscv64 for -np.nan as the sign + # of the NaN will be lost when it's converted to a float32. + if platform.processor() != 'riscv64': + self.signf[3::6][self.ef[3::6]] = -np.nan self.signd[3::6][self.ed[3::6]] = -np.nan self.signf[4::6][self.ef[4::6]] = -0. self.signd[4::6][self.ed[4::6]] = -0. From e7f6ac37699d5204a61ff03b73027d7f45d7ad67 Mon Sep 17 00:00:00 2001 From: Nathan Goldbaum Date: Thu, 18 Jan 2024 10:03:59 -0700 Subject: [PATCH 09/25] BLD: fix building for windows ARM64 --- numpy/core/src/common/npy_cpu_features.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/numpy/core/src/common/npy_cpu_features.c b/numpy/core/src/common/npy_cpu_features.c index 64a85f6fb202..bd149f8b437a 100644 --- a/numpy/core/src/common/npy_cpu_features.c +++ b/numpy/core/src/common/npy_cpu_features.c @@ -656,7 +656,7 @@ npy__cpu_init_features(void) /***************** ARM ******************/ -#elif defined(__arm__) || defined(__aarch64__) +#elif defined(__arm__) || defined(__aarch64__) || defined(_M_ARM64) static inline void npy__cpu_init_features_arm8(void) @@ -781,7 +781,7 @@ npy__cpu_init_features(void) return; #endif // We have nothing else todo -#if defined(NPY_HAVE_ASIMD) || defined(__aarch64__) || (defined(__ARM_ARCH) && __ARM_ARCH >= 8) +#if defined(NPY_HAVE_ASIMD) || defined(__aarch64__) || (defined(__ARM_ARCH) && __ARM_ARCH >= 8) || defined(_M_ARM64) #if defined(NPY_HAVE_FPHP) || defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) npy__cpu_have[NPY_CPU_FEATURE_FPHP] = 1; #endif From a1c69ef6c72b9f81d2935f1616b0e7f00d419a4a Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Thu, 18 Jan 2024 18:50:13 +0100 Subject: [PATCH 10/25] MAINT: add `newaxis` to `__all__` in `numpy.array_api` Follows up on a post-merge comment in gh-25146. [skip ci] --- numpy/array_api/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/numpy/array_api/__init__.py b/numpy/array_api/__init__.py index 77f227882e3e..edc3205fd5c4 100644 --- a/numpy/array_api/__init__.py +++ b/numpy/array_api/__init__.py @@ -127,7 +127,7 @@ from ._constants import e, inf, nan, pi, newaxis -__all__ += ["e", "inf", "nan", "pi"] +__all__ += ["e", "inf", "nan", "pi", "newaxis"] from ._creation_functions import ( asarray, From f49c6f9ea735cd7f718e74f8d637ffbbd3a7a03b Mon Sep 17 00:00:00 2001 From: Ola x Nilsson Date: Fri, 19 Jan 2024 10:26:41 +0100 Subject: [PATCH 11/25] BUG: Use large file fallocate on 32 bit linux platforms Using a local prototype for fallocate instead of the fcntl.h header meant that the redirect triggered by -D_FILE_OFFSET_BITS=64 was not triggered. The prototypes in feature_detection_stdio.h should only be used by functions in setup_common.py. If they are used by the feature discovery code they might trigger false positives. --- numpy/core/feature_detection_stdio.h | 3 +++ numpy/core/src/multiarray/convert.c | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/numpy/core/feature_detection_stdio.h b/numpy/core/feature_detection_stdio.h index bc14d16d04ff..d8bbfbd8b23c 100644 --- a/numpy/core/feature_detection_stdio.h +++ b/numpy/core/feature_detection_stdio.h @@ -1,6 +1,9 @@ +#define _GNU_SOURCE #include #include +#if 0 /* Only for setup_common.py, not the C compiler */ off_t ftello(FILE *stream); int fseeko(FILE *stream, off_t offset, int whence); int fallocate(int, int, off_t, off_t); +#endif diff --git a/numpy/core/src/multiarray/convert.c b/numpy/core/src/multiarray/convert.c index 60c1a1b9b011..8ec0aeefb7af 100644 --- a/numpy/core/src/multiarray/convert.c +++ b/numpy/core/src/multiarray/convert.c @@ -23,8 +23,9 @@ #include "array_coercion.h" #include "refcount.h" -int -fallocate(int fd, int mode, off_t offset, off_t len); +#if defined(HAVE_FALLOCATE) && defined(__linux__) +#include +#endif /* * allocate nbytes of diskspace for file fp From 7ef4843606f54fe56d3f61b674bb502ce46df79b Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 19 Jan 2024 04:52:28 -0500 Subject: [PATCH 12/25] TST: Fix test_warning_calls on Python 3.12 It currently raises a warning: ``` DeprecationWarning: Attribute s is deprecated and will be removed in Python 3.14; use value instead ``` AFAICT, the `value` attribute has always existed (at least in supported versions of Python 3.) --- numpy/tests/test_warnings.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/numpy/tests/test_warnings.py b/numpy/tests/test_warnings.py index ee5124c5d511..df90fcef8c59 100644 --- a/numpy/tests/test_warnings.py +++ b/numpy/tests/test_warnings.py @@ -5,7 +5,6 @@ import pytest from pathlib import Path -import sys import ast import tokenize import numpy @@ -33,7 +32,7 @@ def visit_Call(self, node): ast.NodeVisitor.generic_visit(self, node) if p.ls[-1] == 'simplefilter' or p.ls[-1] == 'filterwarnings': - if node.args[0].s == "ignore": + if node.args[0].value == "ignore": raise AssertionError( "warnings should have an appropriate stacklevel; found in " "{} on line {}".format(self.__filename, node.lineno)) @@ -57,8 +56,6 @@ def visit_Call(self, node): @pytest.mark.slow -@pytest.mark.skipif(sys.version_info >= (3, 12), - reason="Deprecation warning in ast") def test_warning_calls(): # combined "ignore" and stacklevel error base = Path(numpy.__file__).parent From a4f3c220a66f993f16f70502b87567ae5656c312 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 19 Jan 2024 05:02:48 -0500 Subject: [PATCH 13/25] TST: Bump pytz to 2023.3.post1 This version fixes the DeprecationWarning in Python 3.12: ``` DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC). ``` --- test_requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_requirements.txt b/test_requirements.txt index ff1ed284e37d..1eba0371e558 100644 --- a/test_requirements.txt +++ b/test_requirements.txt @@ -4,7 +4,7 @@ setuptools==59.2.0 ; python_version < '3.12' setuptools ; python_version >= '3.12' hypothesis==6.81.1 pytest==7.4.0 -pytz==2023.3 +pytz==2023.3.post1 pytest-cov==4.1.0 meson pytest-xdist From 043ff7a1d54e873e0f3a1cdc8a38c3ba44a74c74 Mon Sep 17 00:00:00 2001 From: Sayed Adel Date: Mon, 22 Jan 2024 15:51:39 +0400 Subject: [PATCH 14/25] BUG: Fix AVX512 build flags on Intel Classic Compiler --- meson_cpu/x86/meson.build | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/meson_cpu/x86/meson.build b/meson_cpu/x86/meson.build index caf6bf09c14e..598f80ff0c89 100644 --- a/meson_cpu/x86/meson.build +++ b/meson_cpu/x86/meson.build @@ -143,8 +143,8 @@ if compiler_id in ['intel', 'intel-cl'] # Intel compilers don't support the following features independently FMA3.update(implies: [F16C, AVX2]) AVX2.update(implies: [F16C, FMA3]) - AVX512F.update(implies: [AVX2, AVX512CD, AVX512_SKX]) - AVX512CD.update(implies: [AVX512F, AVX512_SKX]) + AVX512F.update(implies: [AVX2, AVX512CD]) + AVX512CD.update(implies: [AVX512F]) XOP.update(disable: 'Intel Compiler does not support it') FMA4.update(disable: 'Intel Compiler does not support it') endif @@ -170,10 +170,10 @@ endif if compiler_id == 'intel' clear_m = '^(-mcpu=|-march=)' clear_any = '^(-mcpu=|-march=|-x[A-Z0-9\-])' - FMA3.update(args: {'val': '-march=core-avx2', 'match': clear_m}) - AVX2.update(args: {'val': '-march=core-avx2', 'match': clear_m}) - AVX512F.update(args: {'val': '-march=common-avx512', 'match': clear_m}) - AVX512CD.update(args: {'val': '-march=common-avx512', 'match': clear_m}) + FMA3.update(args: {'val': '-xCORE-AVX2', 'match': clear_m}) + AVX2.update(args: {'val': '-xCORE-AVX2', 'match': clear_m}) + AVX512F.update(args: {'val': '-xCOMMON-AVX512', 'match': clear_m}) + AVX512CD.update(args: {'val': '-xCOMMON-AVX512', 'match': clear_m}) AVX512_KNL.update(args: {'val': '-xKNL', 'match': clear_any}) AVX512_KNM.update(args: {'val': '-xKNM', 'match': clear_any}) AVX512_SKX.update(args: {'val': '-xSKYLAKE-AVX512', 'match': clear_any}) From 7baac4d32c9455b88628ff1e8f14183003658ec4 Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Mon, 22 Jan 2024 11:18:33 -0700 Subject: [PATCH 15/25] MAINT: Bump actions/checkout in macos.yml --- .github/workflows/macos.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index ee9db137641d..5a7ebbecc80e 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -26,7 +26,7 @@ jobs: python-version: ["3.11"] steps: - - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: submodules: recursive fetch-depth: 0 @@ -104,7 +104,7 @@ jobs: if: "github.repository == 'numpy/numpy'" runs-on: macos-13 steps: - - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: submodules: recursive fetch-depth: 0 From cb3171c087b522c4e55657824a9e2c2698b11949 Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Tue, 23 Jan 2024 08:56:48 -0700 Subject: [PATCH 16/25] BLD: fix potential issue with escape sequences in ``__config__.py`` Backport of #25669. The current code isn't robust to backslashes (from path segments on Windows) in linker flags. No bug report for NumPy, but the same problem did show up in SciPy already. Fix is the same as scipy/scipy#19945. This actually pulls in all of `__config__.py` from main because there have been a number of other changes. [skip cirrus] [skip circle] --- numpy/__config__.py.in | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/numpy/__config__.py.in b/numpy/__config__.py.in index 6c6c21cb85d4..f3b32c28c100 100644 --- a/numpy/__config__.py.in +++ b/numpy/__config__.py.in @@ -32,21 +32,27 @@ CONFIG = _cleanup( "Compilers": { "c": { "name": "@C_COMP@", - "linker": "@C_COMP_LINKER_ID@", + "linker": r"@C_COMP_LINKER_ID@", "version": "@C_COMP_VERSION@", - "commands": "@C_COMP_CMD_ARRAY@", + "commands": r"@C_COMP_CMD_ARRAY@", + "args": r"@C_COMP_ARGS@", + "linker args": r"@C_COMP_LINK_ARGS@", }, "cython": { "name": "@CYTHON_COMP@", - "linker": "@CYTHON_COMP_LINKER_ID@", + "linker": r"@CYTHON_COMP_LINKER_ID@", "version": "@CYTHON_COMP_VERSION@", - "commands": "@CYTHON_COMP_CMD_ARRAY@", + "commands": r"@CYTHON_COMP_CMD_ARRAY@", + "args": r"@CYTHON_COMP_ARGS@", + "linker args": r"@CYTHON_COMP_LINK_ARGS@", }, "c++": { "name": "@CPP_COMP@", - "linker": "@CPP_COMP_LINKER_ID@", + "linker": r"@CPP_COMP_LINKER_ID@", "version": "@CPP_COMP_VERSION@", - "commands": "@CPP_COMP_CMD_ARRAY@", + "commands": r"@CPP_COMP_CMD_ARRAY@", + "args": r"@CPP_COMP_ARGS@", + "linker args": r"@CPP_COMP_LINK_ARGS@", }, }, "Machine Information": { @@ -72,7 +78,7 @@ CONFIG = _cleanup( "detection method": "@BLAS_TYPE_NAME@", "include directory": r"@BLAS_INCLUDEDIR@", "lib directory": r"@BLAS_LIBDIR@", - "openblas configuration": "@BLAS_OPENBLAS_CONFIG@", + "openblas configuration": r"@BLAS_OPENBLAS_CONFIG@", "pc file directory": r"@BLAS_PCFILEDIR@", }, "lapack": { @@ -82,7 +88,7 @@ CONFIG = _cleanup( "detection method": "@LAPACK_TYPE_NAME@", "include directory": r"@LAPACK_INCLUDEDIR@", "lib directory": r"@LAPACK_LIBDIR@", - "openblas configuration": "@LAPACK_OPENBLAS_CONFIG@", + "openblas configuration": r"@LAPACK_OPENBLAS_CONFIG@", "pc file directory": r"@LAPACK_PCFILEDIR@", }, }, From 76b0a2f7e4d1818508e7ef90ef5ab04b5bb45855 Mon Sep 17 00:00:00 2001 From: mattip Date: Mon, 29 Jan 2024 13:54:21 +0200 Subject: [PATCH 17/25] CI: pin cygwin python to 3.9.16-1 [skip cirrus][skip azp][skip circle] --- .github/workflows/cygwin.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cygwin.yml b/.github/workflows/cygwin.yml index e873d316f70b..b8226171db3f 100644 --- a/.github/workflows/cygwin.yml +++ b/.github/workflows/cygwin.yml @@ -25,15 +25,16 @@ jobs: submodules: recursive fetch-depth: 0 - name: Install Cygwin - uses: cygwin/cygwin-install-action@006ad0b0946ca6d0a3ea2d4437677fa767392401 # v4 + uses: egor-tensin/setup-cygwin@d2c752bab416d4b0662591bd366fc2686297c82d #v4 with: platform: x86_64 install-dir: 'C:\tools\cygwin' packages: >- - python39-devel python39-pip python-pip-wheel python-setuptools-wheel - liblapack-devel liblapack0 gcc-fortran gcc-g++ git dash cmake ninja + python39=3.9.16-1 python39-devel=3.9.16-1 python39-pip python-pip-wheel + python-setuptools-wheel liblapack-devel liblapack0 gcc-fortran + gcc-g++ git dash cmake ninja - name: Set Windows PATH - uses: egor-tensin/cleanup-path@8469525c8ee3eddabbd3487658621a6235b3c581 # v3 + uses: egor-tensin/cleanup-path@f04bc953e6823bf491cc0bdcff959c630db1b458 # v4.0.1 with: dirs: 'C:\tools\cygwin\bin;C:\tools\cygwin\lib\lapack' - name: Verify that bash is Cygwin bash @@ -63,7 +64,7 @@ jobs: cd tools /usr/bin/python3.9 -m pytest --pyargs numpy -n2 -m "not slow" - name: Upload wheel if tests fail - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 + uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 if: failure() with: name: numpy-cygwin-wheel From cb6488d0ef16b460f886b5848be6fd151063dfcd Mon Sep 17 00:00:00 2001 From: mattip Date: Sun, 28 Jan 2024 00:20:37 +0200 Subject: [PATCH 18/25] TST: marks on a fixture have no effect --- numpy/typing/tests/test_typing.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/numpy/typing/tests/test_typing.py b/numpy/typing/tests/test_typing.py index 68c6f5d03fab..6f778e551576 100644 --- a/numpy/typing/tests/test_typing.py +++ b/numpy/typing/tests/test_typing.py @@ -86,8 +86,6 @@ def strip_func(match: re.Match[str]) -> str: return match.groups()[1] -@pytest.mark.slow -@pytest.mark.skipif(NO_MYPY, reason="Mypy is not installed") @pytest.fixture(scope="module", autouse=True) def run_mypy() -> None: """Clears the cache and run mypy before running any of the typing tests. From c5ba99c3f95d6d8f9200639a4f68f598ccd36781 Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Mon, 29 Jan 2024 11:47:25 -0700 Subject: [PATCH 19/25] MAINT: Bump cibuildwheel to v2.16.4 --- .github/workflows/wheels.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 2049322173c6..5c37a69d0df4 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -118,8 +118,7 @@ jobs: python-version: "3.x" - name: Build wheels - uses: pypa/cibuildwheel@a873dd9cbf9e3c4c73a1fd11ac31cf835f6eb502 # v2.16.0 - #uses: pypa/cibuildwheel@fff9ec32ed25a9c576750c91e06b410ed0c15db7 # v2.16.2 + uses: pypa/cibuildwheel@0b04ab1040366101259658b355777e4ff2d16f83 # v2.16.4 env: CIBW_PRERELEASE_PYTHONS: True CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} From 5a0cd8efe46fafefd96b09af42893356826dd642 Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Thu, 26 Oct 2023 16:57:03 +0200 Subject: [PATCH 20/25] BLD: remove last usage of `distutils` in `_core/code_generators/` (cherry picked from commit 9b38c635b0710f59041b0816c927e03962102ca6) --- numpy/core/code_generators/genapi.py | 9 --------- numpy/core/code_generators/generate_numpy_api.py | 7 +------ numpy/core/code_generators/generate_ufunc_api.py | 7 +------ 3 files changed, 2 insertions(+), 21 deletions(-) diff --git a/numpy/core/code_generators/genapi.py b/numpy/core/code_generators/genapi.py index 2cdaba52d9e2..d9d7862b2879 100644 --- a/numpy/core/code_generators/genapi.py +++ b/numpy/core/code_generators/genapi.py @@ -304,15 +304,6 @@ def find_functions(filename, tag='API'): fo.close() return functions -def should_rebuild(targets, source_files): - from distutils.dep_util import newer_group - for t in targets: - if not os.path.exists(t): - return True - sources = API_FILES + list(source_files) + [__file__] - if newer_group(sources, targets[0], missing='newer'): - return True - return False def write_file(filename, data): """ diff --git a/numpy/core/code_generators/generate_numpy_api.py b/numpy/core/code_generators/generate_numpy_api.py index ae38c4efc2e3..640bae9e5ff4 100644 --- a/numpy/core/code_generators/generate_numpy_api.py +++ b/numpy/core/code_generators/generate_numpy_api.py @@ -148,12 +148,7 @@ def generate_api(output_dir, force=False): targets = (h_file, c_file) sources = numpy_api.multiarray_api - - if (not force and not genapi.should_rebuild(targets, [numpy_api.__file__, __file__])): - return targets - else: - do_generate_api(targets, sources) - + do_generate_api(targets, sources) return targets def do_generate_api(targets, sources): diff --git a/numpy/core/code_generators/generate_ufunc_api.py b/numpy/core/code_generators/generate_ufunc_api.py index e03299a52cf7..3734cbd6a069 100644 --- a/numpy/core/code_generators/generate_ufunc_api.py +++ b/numpy/core/code_generators/generate_ufunc_api.py @@ -125,12 +125,7 @@ def generate_api(output_dir, force=False): targets = (h_file, c_file) sources = ['ufunc_api_order.txt'] - - if (not force and not genapi.should_rebuild(targets, sources + [__file__])): - return targets - else: - do_generate_api(targets, sources) - + do_generate_api(targets, sources) return targets def do_generate_api(targets, sources): From 3548f9da61bacb0deb113d5bfdee57d857cea25b Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Thu, 26 Oct 2023 12:16:51 +0200 Subject: [PATCH 21/25] BLD: unvendor meson-python [wheel build] The meson-python 0.15.0 release added the ability to configure a custom `meson` in `pyproject.toml`. So there's no longer a need for us to vendor it. (cherry picked from commit 6544e33ac7a3a600c2fb565401c811a17ecdb3d5, adding a version range to depend on meson-python 0.15.x) --- .gitmodules | 3 --- LICENSES_bundled.txt | 5 ---- pyproject.toml | 15 +++-------- .../build-backend-wrapper/npbuild/__init__.py | 27 ------------------- vendored-meson/entrypoint/meson | 23 ---------------- vendored-meson/meson-python | 1 - 6 files changed, 4 insertions(+), 70 deletions(-) delete mode 100644 vendored-meson/build-backend-wrapper/npbuild/__init__.py delete mode 100755 vendored-meson/entrypoint/meson delete mode 160000 vendored-meson/meson-python diff --git a/.gitmodules b/.gitmodules index 27ee5e6625eb..ce025743e7c1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,6 +10,3 @@ [submodule "vendored-meson/meson"] path = vendored-meson/meson url = https://github.com/numpy/meson.git -[submodule "vendored-meson/meson-python"] - path = vendored-meson/meson-python - url = https://github.com/numpy/meson-python.git diff --git a/LICENSES_bundled.txt b/LICENSES_bundled.txt index 26faf7ff3021..aae0e774fae9 100644 --- a/LICENSES_bundled.txt +++ b/LICENSES_bundled.txt @@ -30,11 +30,6 @@ Files: vendored-meson/meson/* License: Apache 2.0 For license text, see vendored-meson/meson/COPYING -Name: meson-python -Files: vendored-meson/meson-python/* -License: MIT - For license text, see vendored-meson/meson-python/LICENSE - Name: spin Files: .spin/cmds.py License: BSD-3 diff --git a/pyproject.toml b/pyproject.toml index 2b047e5fe816..a7f47fbcd7bd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,18 +1,8 @@ [build-system] build-backend = "mesonpy" -backend-path = ['./vendored-meson/meson-python'] requires = [ "Cython>=0.29.34,<3.1", - # All dependencies of the vendored meson-python (except for meson, because - # we've got that vendored too - that's the point of this exercise). - 'pyproject-metadata >= 0.7.1', - 'tomli >= 1.0.0; python_version < "3.11"', - 'setuptools >= 60.0; python_version >= "3.12"', - 'colorama; os_name == "nt"', - # Note that `ninja` and (on Linux) `patchelf` are added dynamically by - # meson-python if those tools are not already present on the system. No - # need to worry about those unless one does a non-isolated build - in that - # case they must already be installed on the system. + "meson-python>=0.15.0,<0.16.0", ] [project] @@ -191,6 +181,9 @@ environment = {PKG_CONFIG_PATH="/opt/32/lib/pkgconfig"} config-settings = "setup-args=--vsenv setup-args=-Dallow-noblas=true" repair-wheel-command = "" +[tool.meson-python] +meson = 'vendored-meson/meson/meson.py' + [tool.spin] package = 'numpy' diff --git a/vendored-meson/build-backend-wrapper/npbuild/__init__.py b/vendored-meson/build-backend-wrapper/npbuild/__init__.py deleted file mode 100644 index 6c0711b2bd06..000000000000 --- a/vendored-meson/build-backend-wrapper/npbuild/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -import os -import sys -import pathlib - -from mesonpy import ( - build_sdist, - build_wheel, - build_editable, - get_requires_for_build_sdist, - get_requires_for_build_wheel, - get_requires_for_build_editable, -) - - -# The numpy-vendored version of Meson. Put the directory that the executable -# `meson` is in at the front of the PATH. -curdir = pathlib.Path(__file__).parent.resolve() -meson_executable_dir = str(curdir.parent.parent / 'entrypoint') -os.environ['PATH'] = meson_executable_dir + os.pathsep + os.environ['PATH'] - -# Check that the meson git submodule is present -meson_import_dir = curdir.parent.parent / 'meson' / 'mesonbuild' -if not meson_import_dir.exists(): - raise RuntimeError( - 'The `vendored-meson/meson` git submodule does not exist! ' + - 'Run `git submodule update --init` to fix this problem.' - ) diff --git a/vendored-meson/entrypoint/meson b/vendored-meson/entrypoint/meson deleted file mode 100755 index f440b6ec55c0..000000000000 --- a/vendored-meson/entrypoint/meson +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -import re -import sys -import pathlib - - -# The numpy-vendored version of Meson -meson_dir = str(pathlib.Path(__file__).resolve().parent.parent / 'meson') -sys.path.insert(0, meson_dir) - -from mesonbuild.mesonmain import main -import mesonbuild -if not 'vendored-meson' in mesonbuild.__path__[0]: - # Note: only the print statement will show most likely, not the exception. - # If this goes wrong, it first fails inside meson-python on the `meson - # --version` check. - print(f'picking up the wrong `meson`: {mesonbuild.__path__}') - raise RuntimeError('incorrect mesonbuild module, exiting') - -if __name__ == '__main__': - sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) - sys.exit(main()) diff --git a/vendored-meson/meson-python b/vendored-meson/meson-python deleted file mode 160000 index 206a31a96458..000000000000 --- a/vendored-meson/meson-python +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 206a31a96458af6cf5e29272b4ea1f6ea500b91b From f98424077282684166d474a92d0b02df5672a3e0 Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Fri, 2 Feb 2024 17:20:49 +0100 Subject: [PATCH 22/25] CI: upgrade cibuildwheel from 2.16.4 to 2.16.5 [wheel build] This fixes issues with Windows wheel builds; a new GitHub Actions runner image caused argument escaping to break. --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 5c37a69d0df4..fbc82c03aaa8 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -118,7 +118,7 @@ jobs: python-version: "3.x" - name: Build wheels - uses: pypa/cibuildwheel@0b04ab1040366101259658b355777e4ff2d16f83 # v2.16.4 + uses: pypa/cibuildwheel@ce3fb7832089eb3e723a0a99cab7f3eaccf074fd # v2.16.5 env: CIBW_PRERELEASE_PYTHONS: True CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} From 659be6848f65929cd101b489e3fa77f5fa740e33 Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Sat, 27 Jan 2024 13:30:08 -0800 Subject: [PATCH 23/25] MAINT: Include header defining backtrace --- numpy/core/src/multiarray/temp_elide.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/numpy/core/src/multiarray/temp_elide.c b/numpy/core/src/multiarray/temp_elide.c index 0bf500ed29c5..289040673571 100644 --- a/numpy/core/src/multiarray/temp_elide.c +++ b/numpy/core/src/multiarray/temp_elide.c @@ -59,6 +59,9 @@ */ #if defined HAVE_BACKTRACE && defined HAVE_DLFCN_H && ! defined PYPY_VERSION + +#include + /* 1 prints elided operations, 2 prints stacktraces */ #define NPY_ELIDE_DEBUG 0 #define NPY_MAX_STACKSIZE 10 From fee88abf57bed1b30bf88242693c56604db10a1b Mon Sep 17 00:00:00 2001 From: Pieter Eendebak Date: Tue, 30 Jan 2024 15:03:17 +0100 Subject: [PATCH 24/25] BUG: Fix np.quantile([Fraction(2,1)], 0.5) (#24711) * BUG: Fix np.quantile([Fraction(2,1)], 0.5) * address review comments * pass type instead of dtype instance --- numpy/lib/function_base.py | 3 ++- numpy/lib/tests/test_function_base.py | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index e75aca1e58ec..a3dab04d3331 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -4655,7 +4655,8 @@ def _lerp(a, b, t, out=None): diff_b_a = subtract(b, a) # asanyarray is a stop-gap until gh-13105 lerp_interpolation = asanyarray(add(a, diff_b_a * t, out=out)) - subtract(b, diff_b_a * (1 - t), out=lerp_interpolation, where=t >= 0.5) + subtract(b, diff_b_a * (1 - t), out=lerp_interpolation, where=t >= 0.5, + casting='unsafe', dtype=type(lerp_interpolation.dtype)) if lerp_interpolation.ndim == 0 and out is None: lerp_interpolation = lerp_interpolation[()] # unpack 0d arrays return lerp_interpolation diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index 11e44630e79d..2bb73b600380 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -3606,6 +3606,10 @@ def test_fraction(self): assert_equal(q, Fraction(7, 2)) assert_equal(type(q), Fraction) + q = np.quantile(x, .5) + assert_equal(q, 1.75) + assert_equal(type(q), np.float64) + q = np.quantile(x, Fraction(1, 2)) assert_equal(q, Fraction(7, 4)) assert_equal(type(q), Fraction) From 114ed25180c9d1f17b13b2c674d7137a931d6fbf Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Mon, 5 Feb 2024 11:24:42 -0700 Subject: [PATCH 25/25] REL: Prepare for the NumPy 1.26.4 release - Create 1.26.4-changelog.rst - Update 1.26.4-notes.rst - Remove old fragments from doc/release/upcoming_changes [wheel build] --- doc/changelog/1.26.4-changelog.rst | 45 +++++++++++++++++++ .../upcoming_changes/25181.compatibility.rst | 4 -- .../upcoming_changes/25186.improvement.rst | 1 - doc/source/release/1.26.4-notes.rst | 43 +++++++++++++++++- 4 files changed, 86 insertions(+), 7 deletions(-) create mode 100644 doc/changelog/1.26.4-changelog.rst delete mode 100644 doc/release/upcoming_changes/25181.compatibility.rst delete mode 100644 doc/release/upcoming_changes/25186.improvement.rst diff --git a/doc/changelog/1.26.4-changelog.rst b/doc/changelog/1.26.4-changelog.rst new file mode 100644 index 000000000000..f365ff1546eb --- /dev/null +++ b/doc/changelog/1.26.4-changelog.rst @@ -0,0 +1,45 @@ + +Contributors +============ + +A total of 13 people contributed to this release. People with a "+" by their +names contributed a patch for the first time. + +* Charles Harris +* Elliott Sales de Andrade +* Lucas Colley + +* Mark Ryan + +* Matti Picus +* Nathan Goldbaum +* Ola x Nilsson + +* Pieter Eendebak +* Ralf Gommers +* Sayed Adel +* Sebastian Berg +* Stefan van der Walt +* Stefano Rivera + +Pull requests merged +==================== + +A total of 19 pull requests were merged for this release. + +* `#25323 `__: BUG: Restore missing asstr import +* `#25523 `__: MAINT: prepare 1.26.x for further development +* `#25539 `__: BUG: ``numpy.array_api``: fix ``linalg.cholesky`` upper decomp... +* `#25584 `__: CI: Bump azure pipeline timeout to 120 minutes +* `#25585 `__: MAINT, BLD: Fix unused inline functions warnings on clang +* `#25599 `__: BLD: include fix for MinGW platform detection +* `#25618 `__: TST: Fix test_numeric on riscv64 +* `#25619 `__: BLD: fix building for windows ARM64 +* `#25620 `__: MAINT: add ``newaxis`` to ``__all__`` in ``numpy.array_api`` +* `#25630 `__: BUG: Use large file fallocate on 32 bit linux platforms +* `#25643 `__: TST: Fix test_warning_calls on Python 3.12 +* `#25645 `__: TST: Bump pytz to 2023.3.post1 +* `#25658 `__: BUG: Fix AVX512 build flags on Intel Classic Compiler +* `#25670 `__: BLD: fix potential issue with escape sequences in ``__config__.py`` +* `#25718 `__: CI: pin cygwin python to 3.9.16-1 and fix typing tests [skip... +* `#25720 `__: MAINT: Bump cibuildwheel to v2.16.4 +* `#25748 `__: BLD: unvendor meson-python on 1.26.x and upgrade to meson-python... +* `#25755 `__: MAINT: Include header defining backtrace +* `#25756 `__: BUG: Fix np.quantile([Fraction(2,1)], 0.5) (#24711) diff --git a/doc/release/upcoming_changes/25181.compatibility.rst b/doc/release/upcoming_changes/25181.compatibility.rst deleted file mode 100644 index aefe7cd7a437..000000000000 --- a/doc/release/upcoming_changes/25181.compatibility.rst +++ /dev/null @@ -1,4 +0,0 @@ -``f2py`` will no longer accept ambiguous ``-m`` and ``.pyf`` CLI combinations. -When more than one ``.pyf`` file is passed, an error is raised. When both ``-m`` -and a ``.pyf`` is passed, a warning is emitted and the ``-m`` provided name is -ignored. diff --git a/doc/release/upcoming_changes/25186.improvement.rst b/doc/release/upcoming_changes/25186.improvement.rst deleted file mode 100644 index 6c55a2f500a1..000000000000 --- a/doc/release/upcoming_changes/25186.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -``f2py`` now handles ``common`` blocks which have ``kind`` specifications from modules. This further expands the usability of intrinsics like ``iso_fortran_env`` and ``iso_c_binding``. diff --git a/doc/source/release/1.26.4-notes.rst b/doc/source/release/1.26.4-notes.rst index f8d46cb12673..4db2a02c8b50 100644 --- a/doc/source/release/1.26.4-notes.rst +++ b/doc/source/release/1.26.4-notes.rst @@ -5,14 +5,53 @@ NumPy 1.26.4 Release Notes ========================== NumPy 1.26.4 is a maintenance release that fixes bugs and regressions -discovered after the 1.26.3 release. The most notable changes are the f2py bug -fixes. The Python versions supported by this release are 3.9-3.12. +discovered after the 1.26.3 release. The Python versions supported by this +release are 3.9-3.12. This is the last planned release in the 1.26.x series. Contributors ============ +A total of 13 people contributed to this release. People with a "+" by their +names contributed a patch for the first time. + +* Charles Harris +* Elliott Sales de Andrade +* Lucas Colley + +* Mark Ryan + +* Matti Picus +* Nathan Goldbaum +* Ola x Nilsson + +* Pieter Eendebak +* Ralf Gommers +* Sayed Adel +* Sebastian Berg +* Stefan van der Walt +* Stefano Rivera + Pull requests merged ==================== +A total of 19 pull requests were merged for this release. + +* `#25323 `__: BUG: Restore missing asstr import +* `#25523 `__: MAINT: prepare 1.26.x for further development +* `#25539 `__: BUG: ``numpy.array_api``: fix ``linalg.cholesky`` upper decomp... +* `#25584 `__: CI: Bump azure pipeline timeout to 120 minutes +* `#25585 `__: MAINT, BLD: Fix unused inline functions warnings on clang +* `#25599 `__: BLD: include fix for MinGW platform detection +* `#25618 `__: TST: Fix test_numeric on riscv64 +* `#25619 `__: BLD: fix building for windows ARM64 +* `#25620 `__: MAINT: add ``newaxis`` to ``__all__`` in ``numpy.array_api`` +* `#25630 `__: BUG: Use large file fallocate on 32 bit linux platforms +* `#25643 `__: TST: Fix test_warning_calls on Python 3.12 +* `#25645 `__: TST: Bump pytz to 2023.3.post1 +* `#25658 `__: BUG: Fix AVX512 build flags on Intel Classic Compiler +* `#25670 `__: BLD: fix potential issue with escape sequences in ``__config__.py`` +* `#25718 `__: CI: pin cygwin python to 3.9.16-1 and fix typing tests [skip... +* `#25720 `__: MAINT: Bump cibuildwheel to v2.16.4 +* `#25748 `__: BLD: unvendor meson-python on 1.26.x and upgrade to meson-python... +* `#25755 `__: MAINT: Include header defining backtrace +* `#25756 `__: BUG: Fix np.quantile([Fraction(2,1)], 0.5) (#24711) +