code stringlengths 3 6.57k |
|---|
da.asarray(range(2) |
pytest.raises(IndexError) |
da.asarray(range(2) |
np.arange(5) |
assert_eq(da.asarray(x) |
assert_eq(da.asarray([0]) |
np.arange(1) |
test_boolean_numpy_array_slicing() |
pytest.raises(IndexError) |
da.asarray(range(2) |
np.array([True]) |
pytest.raises(IndexError) |
da.asarray(range(2) |
np.array([False, False, False]) |
np.arange(5) |
np.array([True, False, False, False, True]) |
assert_eq(da.asarray(x) |
np.array([True]) |
assert_eq(da.asarray([0]) |
np.arange(1) |
test_empty_list() |
np.ones((5, 5, 5) |
da.from_array(x, chunks=2) |
assert_eq(dx[[], :3, :2], x[[], :3, :2]) |
assert_eq(dx[:3, [], :2], x[:3, [], :2]) |
assert_eq(dx[:3, :2, []], x[:3, :2, []]) |
test_uneven_chunks() |
da.ones(20, chunks=5) |
test_new_blockdim() |
new_blockdim(20, [5, 5, 5, 5], slice(0, None, 2) |
test_slicing_consistent_names() |
np.arange(100) |
reshape((10, 10) |
da.from_array(x, chunks=(5, 5) |
same_keys(a[0], a[0]) |
same_keys(a[:, [1, 2, 3]], a[:, [1, 2, 3]]) |
same_keys(a[:, 5:2:-1], a[:, 5:2:-1]) |
same_keys(a[0, ...], a[0, ...]) |
same_keys(a[...], a[...]) |
same_keys(a[[1, 3, 5]], a[[1, 3, 5]]) |
same_keys(a[-11:11], a[:]) |
same_keys(a[-11:-9], a[:1]) |
same_keys(a[-1], a[9]) |
same_keys(a[0::-1], a[0:-11:-1]) |
test_slicing_consistent_names_after_normalization() |
da.zeros(10, chunks=(5,) |
same_keys(x[0:], x[:10]) |
same_keys(x[0:], x[0:10]) |
same_keys(x[0:], x[0:10:1]) |
same_keys(x[:], x[0:10:1]) |
test_sanitize_index_element() |
pytest.raises(TypeError) |
_sanitize_index_element('Hello!') |
test_sanitize_index() |
pytest.importorskip('pandas') |
pytest.raises(TypeError) |
sanitize_index('Hello!') |
np.testing.assert_equal(sanitize_index(pd.Series([1, 2, 3]) |
np.testing.assert_equal(sanitize_index((1, 2, 3) |
test_uneven_blockdims() |
slice(240, 270) |
slice(None) |
slice_array('in', 'out', blockdims, index) |
slice(28, 31, 1) |
slice(None) |
slice(0, 27, 1) |
slice(None) |
slice(240, 270) |
slice(180, 230) |
slice_array('in', 'out', blockdims, index) |
slice(28, 31, 1) |
slice(29, 30, 1) |
slice(28, 31, 1) |
slice(None) |
slice(28, 31, 1) |
slice(0, 18, 1) |
slice(0, 27, 1) |
slice(29, 30, 1) |
slice(0, 27, 1) |
slice(None) |
slice(0, 27, 1) |
slice(0, 18, 1) |
test_oob_check() |
da.ones(5, chunks=(2,) |
pytest.raises(IndexError) |
pytest.raises(IndexError) |
pytest.raises(IndexError) |
pytest.raises(IndexError) |
pytest.raises(IndexError) |
pytest.mark.parametrize('idx_chunks', [None, 3, 2, 1]) |
pytest.mark.parametrize('x_chunks', [None, (3, 5) |
test_index_with_int_dask_array(x_chunks, idx_chunks) |
np.array([3, 0, 1]) |
da.from_array(x, chunks=x_chunks) |
da.from_array(idx, chunks=idx_chunks) |
assert_eq(x[:, idx], expect) |
assert_eq(x.T[idx, :], expect.T) |
pytest.mark.parametrize('chunks', [1, 2, 3]) |
test_index_with_int_dask_array_0d(chunks) |
da.from_array(1, chunks=1) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.