def test_pair_equal(self): n, lin = Lin.rand(), Lin.rand() fol = n**lin p = Pair.from_pair(fol, lin) assert p == Pair.from_pair(fol, lin) assert p == Pair.from_pair(fol, -lin) assert p == Pair.from_pair(-fol, lin) assert p == Pair.from_pair(-fol, -lin)
def test_pair_equal(): n, lin = Lin.rand(), Lin.rand() fol = n ** lin p = Pair.from_pair(fol, lin) assert p == Pair.from_pair(fol, lin) assert p == Pair.from_pair(fol, -lin) assert p == Pair.from_pair(-fol, lin) assert p == Pair.from_pair(-fol, -lin)
def test_pair_rotate(self): p = Pair.rand() pr = p.rotate(Lin(45, 45), 120) assert np.allclose([p.fvec.angle(p.lvec), pr.fvec.angle(pr.lvec)], [90, 90])
def test_pair_misfit(self): p = Pair.rand() assert np.allclose(p.misfit, 0)
def test_pair_rotate(): p = Pair.rand() pr = p.rotate(Lin(45, 45), 120) assert np.allclose([p.fvec.angle(p.lvec), pr.fvec.angle(pr.lvec)], [90, 90])
def test_pair_misfit(): p = Pair.rand() assert np.allclose(p.misfit, 0)