Exemple #1
0
class TestCell(unittest.TestCase):
    def setUp(self):
        self.cell = Cell((22.84, 32.84, 42.84, 80.84, 90.84, 100.84), None)
    def test_orth(self):
        orth = self.cell.get_orth_matrix()
        expected = np.array([[22.84, -6.17612, -0.628045],
                             [0,     32.254,    6.82343],
                             [0,      0,       42.2884]])
        assert_allclose(to_np(orth), expected, rtol=1e-6)

    def test_frac(self):
        frac = self.cell.get_frac_matrix()
        orth = self.cell.get_orth_matrix()
        assert_allclose(to_np(frac.dot(orth)), np.identity(3), atol=1e-12)