Skip to content

Commit ad38b09

Browse files
committed
Add test that reorder_axes_to_shape arranges data as expected
1 parent 28d3bb3 commit ad38b09

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

tests/test_utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,9 @@ def test_reorder_axes_to_shape():
7272

7373
with pytest.raises(ValueError):
7474
reorder_axes_to_shape(arr, (None, 256, 1024)) # Wildcard & wrong number
75+
76+
# Check we've transposed, not reshaped
77+
arr = np.arange(15).reshape(3, 5)
78+
res = reorder_axes_to_shape(arr, (5, 3))
79+
assert res.shape == (5, 3)
80+
np.testing.assert_array_equal(res[0], [0, 5, 10])

0 commit comments

Comments
 (0)