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]]) )
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]]))
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.]]))
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.]]))
def test_one_tuple(self): matrix = utils.coordinates_to_numpy_matrix((0, 1, 2)) self.assertArrayEqual(matrix, np.array([[0., 1., 2.]]))
def test_one_list(self): matrix = utils.coordinates_to_numpy_matrix([0, 1, 2]) self.assertArrayEqual(matrix, np.array([[0., 1., 2.]]))
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.]]))
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]]))
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]]))
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]]))
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]]))
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]]))