def test_branch_5(self): z = np.exp(1j * np.linspace(0, 2 * np.pi, 721)) res = hfmath.angle(z, deg=False, branch=0) assert np.all((res >= 0) & (res <= 2 * np.pi))
def test_branch_2(self): z = np.exp(1j * np.linspace(0, 2 * np.pi, 721)) res = hfmath.angle(z, deg=True) assert np.all((res > -180) & (res <= 180))
def test_np_2(self): res = hfmath.angle(self.a, deg=True) self.assertAllclose(res, np.array([0, 90, 180, -90]))
def test_branch_1(self): res = hfmath.angle(self.a, deg=True, branch=0) self.assertAllclose(res, np.array([0, 90, 180, 270]))
def test_np_1(self): res = hfmath.angle(self.a, deg=False) self.assertAllclose(res, np.array([0, np.pi / 2, np.pi, -np.pi / 2]))