File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed
Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -6,10 +6,17 @@ Release notes
66Unreleased
77----------
88
9+ .. _release_2.11.1 :
10+
11+ 2.11.1
12+ ------
913
1014Bug fixes
1115~~~~~~~~~
1216
17+ * Fix bug where indexing with a scalar numpy value returned a single-value array.
18+ By :user: `Ben Jeffery <benjeffery> ` :issue: `967 `.
19+
1320* Removed `clobber ` argument from `normalize_store_arg `. This enables to change
1421 data within a opened consolidated group using mode `"r+" ` (i.e region write).
1522 By :user: `Tobias Kölling <d70-t> ` :issue: `975 `.
Original file line number Diff line number Diff line change @@ -34,7 +34,10 @@ def is_integer_list(x):
3434
3535
3636def is_integer_array (x , ndim = None ):
37- t = hasattr (x , 'shape' ) and hasattr (x , 'dtype' ) and x .dtype .kind in 'ui'
37+ t = not np .isscalar (x ) and \
38+ hasattr (x , 'shape' ) and \
39+ hasattr (x , 'dtype' ) and \
40+ x .dtype .kind in 'ui'
3841 if ndim is not None :
3942 t = t and len (x .shape ) == ndim
4043 return t
Original file line number Diff line number Diff line change 1+ import numpy
12import numpy as np
23import pytest
34from numpy .testing import assert_array_equal
@@ -1442,3 +1443,11 @@ def test_slice_selection_uints():
14421443 idx = np .uint64 (3 )
14431444 slice_sel = make_slice_selection ((idx ,))
14441445 assert arr [slice_sel ].shape == (1 , 6 )
1446+
1447+
1448+ def test_numpy_int_indexing ():
1449+ a = np .arange (1050 )
1450+ z = zarr .create (shape = 1050 , chunks = 100 , dtype = a .dtype )
1451+ z [:] = a
1452+ assert a [42 ] == z [42 ]
1453+ assert a [numpy .int64 (42 )] == z [numpy .int64 (42 )]
You can’t perform that action at this time.
0 commit comments