示例#1
0
 def test_missing_end_values(self):
     out = make_downshift_arrays(np.array([0, 0, 1, 1, 2, 2]), 4)
     self.assert_rows_match(out,
                            np.array([np.array([0, 1]),
                                      np.array([2, 3]),
                                      np.array([4, 5]),
                                      np.array([], dtype=np.int),
                                      None], dtype=object))
示例#2
0
 def test_missing_intra_values_2(self):
     out = make_downshift_arrays(
         np.array([0, 0, 3, 3, 4, 4]), 5)
     self.assert_rows_match(out,
                            np.array([np.array([0, 1]),
                                      np.array([], dtype=np.int),
                                      np.array([], dtype=np.int),
                                      np.array([2, 3]),
                                      np.array([4, 5]),
                                      None], dtype=object))
示例#3
0
 def test_missing_end_values(self):
     out = make_downshift_arrays(np.array([0, 0, 1, 1, 2, 2]), 4)
     self.assert_rows_match(
         out,
         np.array([
             np.array([0, 1]),
             np.array([2, 3]),
             np.array([4, 5]),
             np.array([], dtype=int), None
         ],
                  dtype=object))
示例#4
0
 def test_missing_intra_values_2(self):
     out = make_downshift_arrays(np.array([0, 0, 3, 3, 4, 4]), 5)
     self.assert_rows_match(
         out,
         np.array([
             np.array([0, 1]),
             np.array([], dtype=int),
             np.array([], dtype=int),
             np.array([2, 3]),
             np.array([4, 5]), None
         ],
                  dtype=object))
示例#5
0
 def test_contents_ragged(self, ragged, ragged_size, ragged_result):
     out = make_downshift_arrays(ragged, ragged_size)
     self.assert_rows_match(out, ragged_result)
示例#6
0
 def test_downshift_dtype_ragged(self):
     out = make_downshift_arrays(self.ragged, self.ragged_size)
     assert_(out.dtype == object)
     assert_(out[0].dtype == np.intp)
示例#7
0
 def test_contents_square(self):
     out = make_downshift_arrays(self.square, self.square_size)
     self.assert_rows_match(out, self.square_result)
示例#8
0
 def test_shape_square(self):
     out = make_downshift_arrays(self.square, self.square_size)
     assert_(out.shape == (4,))
     assert_(out[-1] is None)
示例#9
0
 def test_downshift_dtype_square(self, square, square_size):
     out = make_downshift_arrays(square, square_size)
     assert out.dtype == object
     assert out[0].dtype == np.intp
示例#10
0
 def test_shape_ragged(self, ragged, ragged_size):
     out = make_downshift_arrays(ragged, ragged_size)
     assert out.shape == (4,)
     assert out[-1] is None
示例#11
0
 def test_shape_square(self, square, square_size):
     out = make_downshift_arrays(square, square_size)
     assert out.shape == (4,)
     assert out[-1] is None
示例#12
0
 def test_downshift_dtype_ragged(self, ragged, ragged_size):
     out = make_downshift_arrays(ragged, ragged_size)
     assert out.dtype == object
     assert out[0].dtype == np.intp
示例#13
0
 def test_downshift_dtype_square(self, square, square_size):
     out = make_downshift_arrays(square, square_size)
     assert out.dtype == object
     assert out[0].dtype == np.intp
示例#14
0
 def test_shape_ragged(self):
     out = make_downshift_arrays(self.ragged, self.ragged_size)
     assert_(out.shape == (4, ))
     assert_(out[-1] is None)
示例#15
0
 def test_shape_square(self):
     out = make_downshift_arrays(self.square, self.square_size)
     assert_(out.shape == (4, ))
     assert_(out[-1] is None)
示例#16
0
 def test_downshift_dtype_square(self):
     out = make_downshift_arrays(self.square, self.square_size)
     assert_(out.dtype == object)
     assert_(out[0].dtype == np.int64)
示例#17
0
 def test_downshift_dtype_ragged(self):
     out = make_downshift_arrays(self.ragged, self.ragged_size)
     assert_(out.dtype == object)
     assert_(out[0].dtype == np.int64)
示例#18
0
 def test_downshift_dtype_ragged(self, ragged, ragged_size):
     out = make_downshift_arrays(ragged, ragged_size)
     assert out.dtype == object
     assert out[0].dtype == np.intp
示例#19
0
 def test_shape_ragged(self):
     out = make_downshift_arrays(self.ragged, self.ragged_size)
     assert_(out.shape == (4,))
     assert_(out[-1] is None)
示例#20
0
 def test_shape_square(self, square, square_size):
     out = make_downshift_arrays(square, square_size)
     assert out.shape == (4, )
     assert out[-1] is None
示例#21
0
 def test_contents_ragged(self):
     out = make_downshift_arrays(self.ragged, self.ragged_size)
     self.assert_rows_match(out, self.ragged_result)
示例#22
0
 def test_shape_ragged(self, ragged, ragged_size):
     out = make_downshift_arrays(ragged, ragged_size)
     assert out.shape == (4, )
     assert out[-1] is None
示例#23
0
 def test_contents_square(self, square, square_size, square_result):
     out = make_downshift_arrays(square, square_size)
     self.assert_rows_match(out, square_result)
示例#24
0
 def test_downshift_dtype_square(self):
     out = make_downshift_arrays(self.square, self.square_size)
     assert_(out.dtype == object)
     assert_(out[0].dtype == np.intp)