Example #1
0
 def test_2D_array(self):
     a = np.array([[1, 2, 3, 4], [1, 2, 3, 4]])
     try:
         dsplit(a, 2)
         assert_(0)
     except ValueError:
         pass
Example #2
0
 def test_2D_array(self):
     a = np.array([[1, 2, 3, 4], [1, 2, 3, 4]])
     try:
         dsplit(a, 2)
         assert_(0)
     except ValueError:
         pass
Example #3
0
 def test_3D_array(self):
     a = np.array([[[1, 2, 3, 4],
                    [1, 2, 3, 4]],
                   [[1, 2, 3, 4],
                    [1, 2, 3, 4]]])
     res = dsplit(a, 2)
     desired = [np.array([[[1, 2], [1, 2]], [[1, 2], [1, 2]]]),
                np.array([[[3, 4], [3, 4]], [[3, 4], [3, 4]]])]
     compare_results(res, desired)
Example #4
0
 def test_3D_array(self):
     a = np.array([[[1, 2, 3, 4],
                [1, 2, 3, 4]],
               [[1, 2, 3, 4],
                [1, 2, 3, 4]]])
     res = dsplit(a, 2)
     desired = [np.array([[[1, 2], [1, 2]], [[1, 2], [1, 2]]]),
                np.array([[[3, 4], [3, 4]], [[3, 4], [3, 4]]])]
     compare_results(res, desired)