Skip to content

Commit

Permalink
Proper argument for numpy.reshape
Browse files Browse the repository at this point in the history
`numpy.reshape` not only accepts a tuple of ints, but also a simple int.

Besides `(10)` is not a tuple and is identical to `10`, unlike `(10,)`.
  • Loading branch information
DimitriPapadopoulos committed Sep 13, 2023
1 parent 4944e66 commit 91480f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zarr/tests/test_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1666,7 +1666,7 @@ def test_set_selections_with_fields():
),
(
(slice(0, 10, 1),),
np.arange(0, 10).reshape((10)),
np.arange(0, 10).reshape(10),
[(0, 10, (slice(0, 10, 1),))],
),
((0,), np.arange(0, 100).reshape((10, 10)), [(0, 10, (slice(0, 1, 1),))]),
Expand All @@ -1678,7 +1678,7 @@ def test_set_selections_with_fields():
np.arange(0, 100).reshape((10, 10)),
[(0, 1, (slice(0, 1, 1), slice(0, 1, 1)))],
),
((0,), np.arange(0, 10).reshape((10)), [(0, 1, (slice(0, 1, 1),))]),
((0,), np.arange(0, 10).reshape(10), [(0, 1, (slice(0, 1, 1),))]),
pytest.param(
(slice(5, 8, 1), slice(2, 4, 1), slice(0, 5, 1)),
np.arange(2, 100002).reshape((10, 1, 10000)),
Expand Down

0 comments on commit 91480f0

Please sign in to comment.