def test_arr_to_cube_writeable(): """Test arr_to_mat.""" sample = np.asarray( np.random.normal(size=(25, 2, 2)), dtype=np.float64, order='C' ) sample.setflags(write=0) with pytest.raises(RuntimeError): carma.arr_to_cube(sample, False)
def test_arr_to_mat_cube_copy(): """Test arr_to_cube.""" sample = np.asarray(np.random.normal(size=(10, 2, 2)), dtype=np.float64, order='F') flag = carma.arr_to_cube(sample, True, False) assert flag == 5, test_flags[flag]
def test_arr_to_cube_writeable_copy(): """Test arr_to_mat.""" sample = np.asarray( np.random.normal(size=(25, 2, 2)), dtype=np.float64, order='F' ) sample.setflags(write=0) flag = carma.arr_to_cube(sample, True) assert flag == 5, test_flags[flag]
def test_arr_to_cube_double_c_contiguous(): """Test arr_to_mat.""" sample = np.asarray(np.random.normal(size=(10, 2, 2)), dtype=np.float64) flag = carma.arr_to_cube(sample, False, False) assert flag == 5, test_flags[flag]