Example #1
0
 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)
Example #2
0
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)
Example #3
0
 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])
Example #4
0
 def test_pair_misfit(self):
     p = Pair.rand()
     assert np.allclose(p.misfit, 0)
Example #5
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])
Example #6
0
def test_pair_misfit():
    p = Pair.rand()
    assert np.allclose(p.misfit, 0)