diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2018-11-13 09:30:13 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2018-11-13 15:49:42 -0700 |
commit | 8b2b7a2a5549e33f2d7187c4f78de69a8c482c83 (patch) | |
tree | 01cf5190ccd5434f4a8c1413ba349eecafb3e823 | |
parent | 685aef76de436bf2b42a74a52a22041d08a79007 (diff) | |
download | numpy-8b2b7a2a5549e33f2d7187c4f78de69a8c482c83.tar.gz |
TST: Update complex long double precision tests.
It seems that special casing the long double precision tests in order to
deal with PPC is no longer needed now that finfo has been fixed for the
IBM double double and the blacklisting of failing functions.
Consequently the tests can be simplified and no longer needed functions
removed. See #8566 for discussion.
-rw-r--r-- | numpy/core/tests/test_umath.py | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/numpy/core/tests/test_umath.py b/numpy/core/tests/test_umath.py index bd7985dfb..f751fb66e 100644 --- a/numpy/core/tests/test_umath.py +++ b/numpy/core/tests/test_umath.py @@ -2444,11 +2444,6 @@ class TestRationalFunctions(object): assert_equal(np.gcd(2**100, 3**100), 1) -def is_longdouble_finfo_bogus(): - info = np.finfo(np.longcomplex) - return not np.isfinite(np.log10(info.tiny/info.eps)) - - class TestComplexFunctions(object): funcs = [np.arcsin, np.arccos, np.arctan, np.arcsinh, np.arccosh, np.arctanh, np.sin, np.cos, np.tan, np.exp, @@ -2544,7 +2539,8 @@ class TestComplexFunctions(object): b = cfunc(p) assert_(abs(a - b) < atol, "%s %s: %s; cmath: %s" % (fname, p, a, b)) - def check_loss_of_precision(self, dtype): + @pytest.mark.parametrize('dtype', [np.complex64, np.complex_, np.longcomplex]) + def test_loss_of_precision(self, dtype): """Check loss of precision in complex arc* functions""" # Check against known-good functions @@ -2586,10 +2582,11 @@ class TestComplexFunctions(object): # 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: - check(x_series, 50*eps) + # Can use 2.1 for > Ubuntu LTS Trusty (2014), glibc = 2.19. + check(x_series, 50.0*eps) else: check(x_series, 2.1*eps) - check(x_basic, 2*eps/1e-3) + check(x_basic, 2.0*eps/1e-3) # Check a few points @@ -2629,15 +2626,6 @@ class TestComplexFunctions(object): check(func, pts, 1j) check(func, pts, 1+1j) - def test_loss_of_precision(self): - for dtype in [np.complex64, np.complex_]: - self.check_loss_of_precision(dtype) - - @pytest.mark.skipif(is_longdouble_finfo_bogus(), - reason="Bogus long double finfo") - def test_loss_of_precision_longcomplex(self): - self.check_loss_of_precision(np.longcomplex) - class TestAttributes(object): def test_attributes(self): |