Пример #1
0
 def test_three_arrays(self):
     matrix = utils.coordinates_to_numpy_matrix(
         np.array([0, 1, 2]), np.array([3, 4, 5]), np.array([6, 7, 8])
     )
     self.assertArrayEqual(
         matrix, np.array([[0.0, 1.0, 2.0], [3.0, 4.0, 5.0], [6.0, 7.0, 8.0]])
     )
Пример #2
0
 def test_three_arrays(self):
     matrix = utils.coordinates_to_numpy_matrix(np.array([0, 1, 2]),
                                                np.array([3, 4, 5]),
                                                np.array([6, 7, 8]))
     self.assertArrayEqual(
         matrix,
         np.array([[0.0, 1.0, 2.0], [3.0, 4.0, 5.0], [6.0, 7.0, 8.0]]))
Пример #3
0
 def test_ndarrays(self):
     matrix = utils.coordinates_to_numpy_matrix(
         np.array([[0, 1, 2], [3, 4, 5]]))
     self.assertArrayEqual(matrix, np.array([[0., 1., 2., 3., 4., 5.]]))
Пример #4
0
 def test_three_arrays(self):
     matrix = utils.coordinates_to_numpy_matrix(np.array([0, 1, 2]),
                                                np.array([3, 4, 5]),
                                                np.array([6, 7, 8]))
     self.assertArrayEqual(
         matrix, np.array([[0., 1., 2.], [3., 4., 5.], [6., 7., 8.]]))
Пример #5
0
 def test_one_tuple(self):
     matrix = utils.coordinates_to_numpy_matrix((0, 1, 2))
     self.assertArrayEqual(matrix, np.array([[0., 1., 2.]]))
Пример #6
0
 def test_one_list(self):
     matrix = utils.coordinates_to_numpy_matrix([0, 1, 2])
     self.assertArrayEqual(matrix, np.array([[0., 1., 2.]]))
Пример #7
0
 def test_arrays_are_always_float(self):
     matrix = utils.coordinates_to_numpy_matrix(np.array([0, 1, 2]))
     self.assertArrayEqual(matrix, np.array([[0., 1., 2.]]))
Пример #8
0
 def test_one_numpy_array(self):
     matrix = utils.coordinates_to_numpy_matrix(np.array([0.0, 1.0, 2.0]))
     self.assertArrayEqual(matrix, np.array([[0.0, 1.0, 2.0]]))
Пример #9
0
 def test_ndarrays(self):
     matrix = utils.coordinates_to_numpy_matrix(np.array([[0, 1, 2], [3, 4, 5]]))
     self.assertArrayEqual(matrix, np.array([[0.0, 1.0, 2.0, 3.0, 4.0, 5.0]]))
Пример #10
0
 def test_one_tuple(self):
     matrix = utils.coordinates_to_numpy_matrix((0, 1, 2))
     self.assertArrayEqual(matrix, np.array([[0.0, 1.0, 2.0]]))
Пример #11
0
 def test_one_list(self):
     matrix = utils.coordinates_to_numpy_matrix([0, 1, 2])
     self.assertArrayEqual(matrix, np.array([[0.0, 1.0, 2.0]]))
Пример #12
0
 def test_arrays_are_always_float(self):
     matrix = utils.coordinates_to_numpy_matrix(np.array([0, 1, 2]))
     self.assertArrayEqual(matrix, np.array([[0.0, 1.0, 2.0]]))