Exemplo n.º 1
0
 def test_xy_to_ABC_yscale(self):
     for yscale in [1.0, 2.0, np.sqrt(3) / 2]:
         out = xy_to_ABC(self.xy, yscale=yscale)
         expect = self.ABC.copy()
         # scale is slightly complicated; will leave for now
         # test inverse
         self.assertTrue(np.allclose(ABC_to_xy(out, yscale=yscale),
                                     self.xy))
Exemplo n.º 2
0
    def test_ABC_to_xy_yscale(self):
        for yscale in [1.0, 2.0, np.sqrt(3) / 2]:
            out = ABC_to_xy(self.ABC, yscale=yscale)
            expect = self.xy.copy()
            expect[:, 1] *= yscale
            # test scale
            self.assertTrue(np.allclose(out, expect))
            # test inverse

            self.assertTrue(
                np.allclose(xy_to_ABC(out, yscale=yscale), close(self.ABC)))
Exemplo n.º 3
0
 def test_tfm_inversion_xyABC(self):
     out = ABC_to_xy(xy_to_ABC(self.xy))
     self.assertTrue(np.allclose(out, self.xy))
Exemplo n.º 4
0
 def test_tfm_inversion_ABCxy(self):
     out = xy_to_ABC(ABC_to_xy(self.ABC))
     self.assertTrue(np.allclose(out, close(self.ABC)))
Exemplo n.º 5
0
 def test_xy_to_ABC(self):
     out = xy_to_ABC(self.xy)
     self.assertTrue(np.allclose(out, close(self.ABC)))