Skip to content

Commit

Permalink
unskip musl complex trig tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mattip committed Nov 9, 2023
1 parent cab680c commit c77ab47
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions numpy/_core/tests/test_umath.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
assert_, assert_equal, assert_raises, assert_raises_regex,
assert_array_equal, assert_almost_equal, assert_array_almost_equal,
assert_array_max_ulp, assert_allclose, assert_no_warnings, suppress_warnings,
_gen_alignment_data, assert_array_almost_equal_nulp, IS_WASM, IS_MUSL,
IS_PYPY
_gen_alignment_data, assert_array_almost_equal_nulp, IS_WASM, IS_PYPY
)
from numpy.testing._private.utils import _glibc_older_than

Expand Down Expand Up @@ -1354,21 +1353,9 @@ def test_log_values(self):

# test log() of max for dtype does not raise
for dt in ['f', 'd', 'g']:
try:
with np.errstate(all='raise'):
x = np.finfo(dt).max
np.log(x)
except FloatingPointError as exc:
if dt == 'g' and IS_MUSL:
# FloatingPointError is known to occur on longdouble
# for musllinux_x86_64 x is very large
pytest.skip(
"Overflow has occurred for"
" np.log(np.finfo(np.longdouble).max)"
)
else:
raise exc

with np.errstate(all='raise'):
x = np.finfo(dt).max
np.log(x)
def test_log_strides(self):
np.random.seed(42)
strides = np.array([-4,-3,-2,-1,1,2,3,4])
Expand Down Expand Up @@ -1899,7 +1886,6 @@ def test_ldexp(self, dtype, stride):
class TestFRExp:
@pytest.mark.parametrize("stride", [-4,-2,-1,1,2,4])
@pytest.mark.parametrize("dtype", ['f', 'd'])
@pytest.mark.xfail(IS_MUSL, reason="gh23048")
@pytest.mark.skipif(not sys.platform.startswith('linux'),
reason="np.frexp gives different answers for NAN/INF on windows and linux")
def test_frexp(self, dtype, stride):
Expand Down Expand Up @@ -4138,7 +4124,6 @@ def test_it(self):
assert_almost_equal(fz.real, fr, err_msg='real part %s' % f)
assert_almost_equal(fz.imag, 0., err_msg='imag part %s' % f)

@pytest.mark.xfail(IS_MUSL, reason="gh23049")
@pytest.mark.xfail(IS_WASM, reason="doesn't work")
def test_precisions_consistent(self):
z = 1 + 1j
Expand All @@ -4149,7 +4134,6 @@ def test_precisions_consistent(self):
assert_almost_equal(fcf, fcd, decimal=6, err_msg='fch-fcd %s' % f)
assert_almost_equal(fcl, fcd, decimal=15, err_msg='fch-fcl %s' % f)

@pytest.mark.xfail(IS_MUSL, reason="gh23049")
@pytest.mark.xfail(IS_WASM, reason="doesn't work")
def test_branch_cuts(self):
# check branch cuts and continuity on them
Expand All @@ -4176,7 +4160,6 @@ def test_branch_cuts(self):
_check_branch_cut(np.arccosh, [0-2j, 2j, 2], [1, 1, 1j], 1, 1)
_check_branch_cut(np.arctanh, [0-2j, 2j, 0], [1, 1, 1j], 1, 1)

@pytest.mark.xfail(IS_MUSL, reason="gh23049")
@pytest.mark.xfail(IS_WASM, reason="doesn't work")
def test_branch_cuts_complex64(self):
# check branch cuts and continuity on them
Expand Down Expand Up @@ -4230,7 +4213,6 @@ def test_against_cmath(self):
_glibc_older_than("2.18"),
reason="Older glibc versions are imprecise (maybe passes with SIMD?)"
)
@pytest.mark.xfail(IS_MUSL, reason="gh23049")
@pytest.mark.xfail(IS_WASM, reason="doesn't work")
@pytest.mark.parametrize('dtype', [
np.complex64, np.complex128, np.clongdouble
Expand Down

0 comments on commit c77ab47

Please sign in to comment.