Exemplo n.º 1
0
 def test1_split_into_blocks(self):
     """1D test
     """
     arr_size = (3,)
     arr_in = np.random.randn(*arr_size)
     window_shape = (3,)
     out = split_into_blocks(arr_in, window_shape, step=1)
     out_real = [(0,)]
     self.assertTrue(out == out_real)
Exemplo n.º 2
0
 def test4_split_into_blocks(self):
     """2D test
     """
     arr_size = (3, 3)
     arr_in = np.random.randn(*arr_size)
     window_shape = (1, 1)
     out = split_into_blocks(arr_in, window_shape, step=2)
     out_real = [(0, 0), (0, 2), (2, 0), (2, 2)]
     self.assertTrue(out == out_real)