Skip to content

Commit

Permalink
add 1d and 3d tests for concatenate3
Browse files Browse the repository at this point in the history
  • Loading branch information
mrocklin committed Jun 2, 2015
1 parent 240933d commit 83346aa
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions dask/array/tests/test_array_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,10 @@ def test_bincount_raises_informative_error_on_missing_minlength_kwarg():


def test_concatenate3():
x = np.array([1, 2])
assert eq(concatenate3([x, x, x]),
np.array([1, 2, 1, 2, 1, 2]))

x = np.array([[1, 2]])
assert (concatenate3([[x, x, x], [x, x, x]]) ==
np.array([[1, 2, 1, 2, 1, 2],
Expand All @@ -1012,3 +1016,28 @@ def test_concatenate3():
np.array([[1, 2, 1, 2],
[1, 2, 1, 2],
[1, 2, 1, 2]])).all()

x = np.arange(12).reshape((2, 2, 3))
assert eq(concatenate3([[[x, x, x],
[x, x, x]],
[[x, x, x],
[x, x, x]]]),
np.array([[[ 0, 1, 2, 0, 1, 2, 0, 1, 2],
[ 3, 4, 5, 3, 4, 5, 3, 4, 5],
[ 0, 1, 2, 0, 1, 2, 0, 1, 2],
[ 3, 4, 5, 3, 4, 5, 3, 4, 5]],

[[ 6, 7, 8, 6, 7, 8, 6, 7, 8],
[ 9, 10, 11, 9, 10, 11, 9, 10, 11],
[ 6, 7, 8, 6, 7, 8, 6, 7, 8],
[ 9, 10, 11, 9, 10, 11, 9, 10, 11]],

[[ 0, 1, 2, 0, 1, 2, 0, 1, 2],
[ 3, 4, 5, 3, 4, 5, 3, 4, 5],
[ 0, 1, 2, 0, 1, 2, 0, 1, 2],
[ 3, 4, 5, 3, 4, 5, 3, 4, 5]],

[[ 6, 7, 8, 6, 7, 8, 6, 7, 8],
[ 9, 10, 11, 9, 10, 11, 9, 10, 11],
[ 6, 7, 8, 6, 7, 8, 6, 7, 8],
[ 9, 10, 11, 9, 10, 11, 9, 10, 11]]]))

0 comments on commit 83346aa

Please sign in to comment.