示例#1
0
 def test_flipH(self):
     """
     Test create_flip with horizontal flipping.
     """
     result = Quilt.create_flip(self.a, [0, 1])
     expected = np.asarray([[0, 1, 2, 3, 0, 3, 2, 1, 0],
                            [5, 6, 7, 8, 0, 8, 7, 6, 5],
                            [4, 9, 2, 3, 0, 3, 2, 9, 4]])
     np.testing.assert_array_equal(expected, result)
示例#2
0
 def test_flipV(self):
     """
     Test create_flip with vertical flipping.
     """
     result = Quilt.create_flip(self.a, [1, 0])
     expected = np.asarray([[0, 1, 2, 3], [5, 6, 7, 8], [4, 9, 2, 3],
                            [0, 0, 0, 0], [4, 9, 2, 3], [5, 6, 7, 8],
                            [0, 1, 2, 3]])
     np.testing.assert_array_equal(expected, result)
示例#3
0
 def test_flipVH(self):
     """
     Test create_flip with both the flip dimensions activated.
     """
     result = Quilt.create_flip(self.a, [1, 1])
     expected = np.asarray([[0, 1, 2, 3, 0, 3, 2, 1, 0],
                            [5, 6, 7, 8, 0, 8, 7, 6, 5],
                            [4, 9, 2, 3, 0, 3, 2, 9, 4],
                            [0, 0, 0, 0, 0, 0, 0, 0, 0],
                            [4, 9, 2, 3, 0, 3, 2, 9, 4],
                            [5, 6, 7, 8, 0, 8, 7, 6, 5],
                            [0, 1, 2, 3, 0, 3, 2, 1, 0]])
     np.testing.assert_array_equal(expected, result)