Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ exts_list = [
'patches': [
'numpy-1.20.3_disable_fortran_callback_test.patch',
'numpy-1.22.3_disable-broken-override-test.patch',
'%(name)s-%(version)s_skip-ppc-long-complex-test.patch',
],
'sources': ['%(name)s-%(version)s.zip'],
'checksums': [
Expand All @@ -35,6 +36,8 @@ exts_list = [
'44975a944544fd0e771b7e63c32590d257a3713070f8f7fdf60105dc516f1d75',
# numpy-1.22.3_disable-broken-override-test.patch
'9c589bb073b28b25ff45eb3c63c57966aa508dd8b318d0b885b6295271e4983c',
# numpy-1.22.3_skip-ppc-long-complex-test.patch
'058c8128b9f7158b4d5bedb2f52ccc7e1362b99c352c3d10335f98a6194c880e',
],
}),
('ply', '3.11', {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Include a PPC detection for the inaccurate trig functions
See https://github.com/numpy/numpy/issues/15763

Author: Alexander Grund (TU Dresden)

diff --git a/numpy/core/tests/test_umath.py b/numpy/core/tests/test_umath.py
index c0b26e75b..ee040fe4b 100644
--- a/numpy/core/tests/test_umath.py
+++ b/numpy/core/tests/test_umath.py
@@ -37,12 +37,17 @@ def on_powerpc():


def bad_arcsinh():
- """The blocklisted trig functions are not accurate on aarch64 for
+ """The blocklisted trig functions are not accurate on aarch64/PPC for
complex256. Rather than dig through the actual problem skip the
test. This should be fixed when we can move past glibc2.17
which is the version in manylinux2014
"""
- x = 1.78e-10
+ if platform.machine() == 'aarch64':
+ x = 1.78e-10
+ elif on_powerpc():
+ x = 2.16e-10
+ else:
+ return False
v1 = np.arcsinh(np.float128(x))
v2 = np.arcsinh(np.complex256(x)).real
# The eps for float128 is 1-e33, so this is way bigger
@@ -3434,9 +3439,9 @@ def check(x, rtol):
x_basic = np.logspace(-2.999, 0, 10, endpoint=False)

if dtype is np.longcomplex:
- if (platform.machine() == 'aarch64' and bad_arcsinh()):
+ if bad_arcsinh():
pytest.skip("Trig functions of np.longcomplex values known "
- "to be inaccurate on aarch64 for some compilation "
+ "to be inaccurate on aarch64 and PPC for some compilation "
"configurations.")
# It's not guaranteed that the system-provided arc functions
# are accurate down to a few epsilons. (Eg. on Linux 64-bit)