Пример #1
0
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)
Пример #2
0
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]
Пример #3
0
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]
Пример #4
0
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]