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

Method test_branch_cuts

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

Source from the content-addressed store, hash-verified

4125 @pytest.mark.xfail(IS_MUSL, reason="gh23049")
4126 @pytest.mark.xfail(IS_WASM, reason="doesn't work")
4127 def test_branch_cuts(self):
4128 # check branch cuts and continuity on them
4129 _check_branch_cut(np.log, -0.5, 1j, 1, -1, True)
4130 _check_branch_cut(np.log2, -0.5, 1j, 1, -1, True)
4131 _check_branch_cut(np.log10, -0.5, 1j, 1, -1, True)
4132 _check_branch_cut(np.log1p, -1.5, 1j, 1, -1, True)
4133 _check_branch_cut(np.sqrt, -0.5, 1j, 1, -1, True)
4134
4135 _check_branch_cut(np.arcsin, [ -2, 2], [1j, 1j], 1, -1, True)
4136 _check_branch_cut(np.arccos, [ -2, 2], [1j, 1j], 1, -1, True)
4137 _check_branch_cut(np.arctan, [0-2j, 2j], [1, 1], -1, 1, True)
4138
4139 _check_branch_cut(np.arcsinh, [0-2j, 2j], [1, 1], -1, 1, True)
4140 _check_branch_cut(np.arccosh, [ -1, 0.5], [1j, 1j], 1, -1, True)
4141 _check_branch_cut(np.arctanh, [ -2, 2], [1j, 1j], 1, -1, True)
4142
4143 # check against bogus branch cuts: assert continuity between quadrants
4144 _check_branch_cut(np.arcsin, [0-2j, 2j], [ 1, 1], 1, 1)
4145 _check_branch_cut(np.arccos, [0-2j, 2j], [ 1, 1], 1, 1)
4146 _check_branch_cut(np.arctan, [ -2, 2], [1j, 1j], 1, 1)
4147
4148 _check_branch_cut(np.arcsinh, [ -2, 2, 0], [1j, 1j, 1], 1, 1)
4149 _check_branch_cut(np.arccosh, [0-2j, 2j, 2], [1, 1, 1j], 1, 1)
4150 _check_branch_cut(np.arctanh, [0-2j, 2j, 0], [1, 1, 1j], 1, 1)
4151
4152 @pytest.mark.xfail(IS_MUSL, reason="gh23049")
4153 @pytest.mark.xfail(IS_WASM, reason="doesn't work")

Callers

nothing calls this directly

Calls 1

_check_branch_cutFunction · 0.85

Tested by

no test coverage detected