Ejemplo n.º 1
0
 def test_invalid_shape(self):
     row = numpy.array((0, 2, 4, 1), dtype=numpy.int32)
     col = numpy.array((1, 3, 0, 2, 4), dtype=numpy.int32)
     with self.assertRaises(ValueError):
         utils.get_order(row, col)
Ejemplo n.º 2
0
 def test_other_order(self):
     row = numpy.array((0, 2, 4, 1, 3), dtype=numpy.int32)
     col = numpy.array((1, 3, 0, 2, 4), dtype=numpy.int32)
     assert utils.get_order(row, col) == 'other'
     assert utils.get_order(col, row) == 'other'
Ejemplo n.º 3
0
 def test_diag_order(self):
     row = numpy.array((0, 0, 1, 1, 2), dtype=numpy.int32)
     col = numpy.array((0, 1, 1, 2, 2), dtype=numpy.int32)
     assert utils.get_order(row, col) == 'C'
     assert utils.get_order(col, row) == 'C'
Ejemplo n.º 4
0
 def test_invalid_index_combinatin(self):
     row = numpy.array((0, 2, 4, 1, -1), dtype=numpy.int32)
     col = numpy.array((1, 3, 0, -1, 4), dtype=numpy.int32)
     with self.assertRaises(ValueError):
         utils.get_order(row, col)