diff options
author | V3n3RiX <venerix@koprulu.sector> | 2022-02-02 01:39:05 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2022-02-02 01:39:05 +0000 |
commit | fcc5224904648a8e6eb528d7603154160a20022f (patch) | |
tree | 3bfce096b38a9cea8eed13fc70c1526c456e9abd /dev-python/numpy/files | |
parent | 2fd57282f0262ca084e05b0f2c63fbada395d02b (diff) |
gentoo resync : 02.02.2022
Diffstat (limited to 'dev-python/numpy/files')
-rw-r--r-- | dev-python/numpy/files/numpy-1.21.3-unaligned-array.patch | 45 | ||||
-rw-r--r-- | dev-python/numpy/files/numpy-1.21.4-copy-python-3.9.patch | 52 |
2 files changed, 0 insertions, 97 deletions
diff --git a/dev-python/numpy/files/numpy-1.21.3-unaligned-array.patch b/dev-python/numpy/files/numpy-1.21.3-unaligned-array.patch deleted file mode 100644 index 8d04cc0968dc..000000000000 --- a/dev-python/numpy/files/numpy-1.21.3-unaligned-array.patch +++ /dev/null @@ -1,45 +0,0 @@ -From d9bbd60d0f2896d1b1f865e6035dccb12db4b1a0 Mon Sep 17 00:00:00 2001 -From: Sebastian Berg <sebastian@sipsolutions.net> -Date: Sat, 23 Oct 2021 22:54:21 -0500 -Subject: [PATCH] BUG: Do not use nonzero fastpath on unaligned arrays - -The fast-path does not handle unalgined access, previously only -bools had a fast path (and bools are by definition always aligned -since they are stored in a single byte/char). - -Closes gh-19592 ---- - numpy/core/src/multiarray/item_selection.c | 19 +++++++------------ - 1 file changed, 7 insertions(+), 12 deletions(-) - -diff --git a/numpy/core/src/multiarray/item_selection.c b/numpy/core/src/multiarray/item_selection.c -index ee66378a938..33d378c2b58 100644 ---- a/numpy/core/src/multiarray/item_selection.c -+++ b/numpy/core/src/multiarray/item_selection.c -@@ -2398,19 +2398,14 @@ PyArray_CountNonzero(PyArrayObject *self) - npy_intp *strideptr, *innersizeptr; - NPY_BEGIN_THREADS_DEF; - -- // Special low-overhead version specific to the boolean/int types - dtype = PyArray_DESCR(self); -- switch(dtype->kind) { -- case 'u': -- case 'i': -- case 'b': -- if (dtype->elsize > 8) { -- break; -- } -- return count_nonzero_int( -- PyArray_NDIM(self), PyArray_BYTES(self), PyArray_DIMS(self), -- PyArray_STRIDES(self), dtype->elsize -- ); -+ /* Special low-overhead version specific to the boolean/int types */ -+ if (PyArray_ISALIGNED(self) && ( -+ PyDataType_ISBOOL(dtype) || PyDataType_ISINTEGER(dtype))) { -+ return count_nonzero_int( -+ PyArray_NDIM(self), PyArray_BYTES(self), PyArray_DIMS(self), -+ PyArray_STRIDES(self), dtype->elsize -+ ); - } - - nonzero = PyArray_DESCR(self)->f->nonzero; diff --git a/dev-python/numpy/files/numpy-1.21.4-copy-python-3.9.patch b/dev-python/numpy/files/numpy-1.21.4-copy-python-3.9.patch deleted file mode 100644 index 81464151e753..000000000000 --- a/dev-python/numpy/files/numpy-1.21.4-copy-python-3.9.patch +++ /dev/null @@ -1,52 +0,0 @@ -https://github.com/numpy/numpy/commit/50823973e857363f7d8052768276c2e86f004d61 -https://github.com/numpy/numpy/pull/20357 - -From: Bas van Beek <b.f.van.beek@vu.nl> -Date: Wed, 10 Nov 2021 15:36:00 +0100 -Subject: [PATCH] MAINT: Do not forward `__(deep)copy__` calls of - `_GenericAlias` to the wrapped type - -Adapt to the python 3.9.8 changes made in bpo-45167. ---- a/numpy/typing/_generic_alias.py -+++ b/numpy/typing/_generic_alias.py -@@ -178,6 +178,8 @@ def __eq__(self, value: object) -> bool: - "__mro_entries__", - "__reduce__", - "__reduce_ex__", -+ "__copy__", -+ "__deepcopy__", - }) - - def __getattribute__(self, name: str) -> Any: ---- a/numpy/typing/tests/test_generic_alias.py -+++ b/numpy/typing/tests/test_generic_alias.py -@@ -1,6 +1,7 @@ - from __future__ import annotations - - import sys -+import copy - import types - import pickle - import weakref -@@ -74,6 +75,21 @@ def test_pass(self, name: str, func: FuncType) -> None: - value_ref = func(NDArray_ref) - assert value == value_ref - -+ @pytest.mark.parametrize("name,func", [ -+ ("__copy__", lambda n: n == copy.copy(n)), -+ ("__deepcopy__", lambda n: n == copy.deepcopy(n)), -+ ]) -+ def test_copy(self, name: str, func: FuncType) -> None: -+ value = func(NDArray) -+ -+ # xref bpo-45167 -+ GE_398 = ( -+ sys.version_info[:2] == (3, 9) and sys.version_info >= (3, 9, 8) -+ ) -+ if GE_398 or sys.version_info >= (3, 10, 1): -+ value_ref = func(NDArray_ref) -+ assert value == value_ref -+ - def test_weakref(self) -> None: - """Test ``__weakref__``.""" - value = weakref.ref(NDArray)() |