Ejemplo n.º 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))
Ejemplo n.º 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))
Ejemplo n.º 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))
Ejemplo n.º 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))
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 7
0
 def test_contents_square(self):
     out = make_downshift_arrays(self.square, self.square_size)
     self.assert_rows_match(out, self.square_result)
Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 21
0
 def test_contents_ragged(self):
     out = make_downshift_arrays(self.ragged, self.ragged_size)
     self.assert_rows_match(out, self.ragged_result)
Ejemplo n.º 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
Ejemplo n.º 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)
Ejemplo n.º 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)