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

Method test_basic

numpy/lib/tests/test_function_base.py:1230–1241  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1228class TestAngle:
1229
1230 def test_basic(self):
1231 x = [1 + 3j, np.sqrt(2) / 2.0 + 1j * np.sqrt(2) / 2,
1232 1, 1j, -1, -1j, 1 - 3j, -1 + 3j]
1233 y = angle(x)
1234 yo = [
1235 np.arctan(3.0 / 1.0),
1236 np.arctan(1.0), 0, np.pi / 2, np.pi, -np.pi / 2.0,
1237 -np.arctan(3.0 / 1.0), np.pi - np.arctan(3.0 / 1.0)]
1238 z = angle(x, deg=True)
1239 zo = np.array(yo) * 180 / np.pi
1240 assert_array_almost_equal(y, yo, 11)
1241 assert_array_almost_equal(z, zo, 11)
1242
1243 def test_subclass(self):
1244 x = np.ma.array([1 + 3j, 1, np.sqrt(2)/2 * (1 + 1j)])

Callers

nothing calls this directly

Calls 2

angleFunction · 0.90

Tested by

no test coverage detected