def test_complex_methods(complex): if complex: x = np.array([1 + 2j, 2 - 1j, 0, 1, 0]) else: x = np.array([1, 2, 0, 0, 0]) s = GCXS.from_numpy(x) assert_eq(s.imag, x.imag) assert_eq(s.real, x.real) assert_eq(s.conj(), x.conj())
def test_gcxs_valerr(): a = np.arange(300) with pytest.raises(ValueError): GCXS.from_numpy(a, idx_dtype=np.int8)