summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Grund <alexander.grund@tu-dresden.de>2022-08-04 17:58:51 +0200
committerCharles Harris <charlesr.harris@gmail.com>2022-08-10 19:11:34 -0600
commit3fdeae210e0146846c552e5069f6dadddedd7e83 (patch)
tree5c45cc8bf820475b2df8a98a3424a776c172d393
parent72b98a0d42c9e52cd2650cf357bc0ccb20264b27 (diff)
downloadnumpy-3fdeae210e0146846c552e5069f6dadddedd7e83.tar.gz
BUG: Fix skip condition for test_loss_of_precision[complex256]
The check code needs to use another constant to check for an affected GLIBC on PPC. See #15763 Fixes #15243
-rw-r--r--numpy/core/tests/test_umath.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/numpy/core/tests/test_umath.py b/numpy/core/tests/test_umath.py
index dd0bb88ff..f12307e30 100644
--- a/numpy/core/tests/test_umath.py
+++ b/numpy/core/tests/test_umath.py
@@ -27,12 +27,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
@@ -3515,10 +3520,10 @@ class TestComplexFunctions:
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 "
- "configurations.")
+ "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)
# So, give more leeway for long complex tests here: