MCPcopy Create free account
hub / github.com/numpy/numpy / test_branch_cuts_complex64

Method test_branch_cuts_complex64

numpy/core/tests/test_umath.py:4154–4177  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4152 @pytest.mark.xfail(IS_MUSL, reason="gh23049")
4153 @pytest.mark.xfail(IS_WASM, reason="doesn't work")
4154 def test_branch_cuts_complex64(self):
4155 # check branch cuts and continuity on them
4156 _check_branch_cut(np.log, -0.5, 1j, 1, -1, True, np.complex64)
4157 _check_branch_cut(np.log2, -0.5, 1j, 1, -1, True, np.complex64)
4158 _check_branch_cut(np.log10, -0.5, 1j, 1, -1, True, np.complex64)
4159 _check_branch_cut(np.log1p, -1.5, 1j, 1, -1, True, np.complex64)
4160 _check_branch_cut(np.sqrt, -0.5, 1j, 1, -1, True, np.complex64)
4161
4162 _check_branch_cut(np.arcsin, [ -2, 2], [1j, 1j], 1, -1, True, np.complex64)
4163 _check_branch_cut(np.arccos, [ -2, 2], [1j, 1j], 1, -1, True, np.complex64)
4164 _check_branch_cut(np.arctan, [0-2j, 2j], [1, 1], -1, 1, True, np.complex64)
4165
4166 _check_branch_cut(np.arcsinh, [0-2j, 2j], [1, 1], -1, 1, True, np.complex64)
4167 _check_branch_cut(np.arccosh, [ -1, 0.5], [1j, 1j], 1, -1, True, np.complex64)
4168 _check_branch_cut(np.arctanh, [ -2, 2], [1j, 1j], 1, -1, True, np.complex64)
4169
4170 # check against bogus branch cuts: assert continuity between quadrants
4171 _check_branch_cut(np.arcsin, [0-2j, 2j], [ 1, 1], 1, 1, False, np.complex64)
4172 _check_branch_cut(np.arccos, [0-2j, 2j], [ 1, 1], 1, 1, False, np.complex64)
4173 _check_branch_cut(np.arctan, [ -2, 2], [1j, 1j], 1, 1, False, np.complex64)
4174
4175 _check_branch_cut(np.arcsinh, [ -2, 2, 0], [1j, 1j, 1], 1, 1, False, np.complex64)
4176 _check_branch_cut(np.arccosh, [0-2j, 2j, 2], [1, 1, 1j], 1, 1, False, np.complex64)
4177 _check_branch_cut(np.arctanh, [0-2j, 2j, 0], [1, 1, 1j], 1, 1, False, np.complex64)
4178
4179 def test_against_cmath(self):
4180 import cmath

Callers

nothing calls this directly

Calls 1

_check_branch_cutFunction · 0.85

Tested by

no test coverage detected