Esempio n. 1
0
def test_error_raised_when_trying_to_slice_with_one_slice(data_C):
    data, path = data_C
    c = BinaryReader(path, data.dtype, data.shape, 'C')

    with pytest.raises(ValueError):
        c[:]
Esempio n. 2
0
def test_error_raised_when_trying_to_slice_with_iterators_in_rows_F(data_F):
    data, path = data_F
    c = BinaryReader(path, data.dtype, data.shape, 'F')

    with pytest.raises(NotImplementedError):
        c[[0, 1, 2], :]
Esempio n. 3
0
def test_can_read_rows_in_C_with_iterable(data_C):
    data, path = data_C
    c = BinaryReader(path, data.dtype, data.shape, 'C')
    np.testing.assert_equal(c[[0, 1, 2], :3], data[[0, 1, 2], :3])
Esempio n. 4
0
def test_can_read_columns_in_F_with_iterable(data_F):
    data, path = data_F
    f = BinaryReader(path, data.dtype, data.shape, 'F')
    np.testing.assert_equal(f[3:, [6, 7, 8]], data[3:, [6, 7, 8]])
Esempio n. 5
0
def test_can_read_data_in_F_order_empty_end(data_F):
    data, path = data_F
    f = BinaryReader(path, data.dtype, data.shape, 'F')
    np.testing.assert_equal(f[3:, 8:], data[3:, 8:])
Esempio n. 6
0
def test_can_read_data_in_C_order_empty_end(data_C):
    data, path = data_C
    c = BinaryReader(path, data.dtype, data.shape, 'C')
    np.testing.assert_equal(c[:10, :3], data[:10, :3])
Esempio n. 7
0
def test_can_read_data_in_F_order_empty_start(data_F):
    data, path = data_F
    f = BinaryReader(path, data.dtype, data.shape, 'F')
    np.testing.assert_equal(f[:10, :3], data[:10, :3])
Esempio n. 8
0
def test_error_1d_array_when_indexing_with_ints_in_rows(data_C):
    data, path = data_C
    c = BinaryReader(path, data.dtype, data.shape, 'C')

    assert c[0, :10].ndim == 1
Esempio n. 9
0
def test_error_raised_when_trying_to_slice_with_iterators_in_cols_C(data_C):
    data, path = data_C
    c = BinaryReader(path, data.dtype, data.shape, 'C')

    with pytest.raises(NotImplementedError):
        c[:, [0, 1, 2]]