File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 8
8
9
9
10
10
import numpy as np
11
- from numcodecs .compat import ensure_contiguous_ndarray
11
+ from numcodecs .compat import ensure_ndarray , ensure_contiguous_ndarray
12
12
13
13
14
14
from zarr .util import (is_total_slice , human_readable_size , normalize_resize_args ,
@@ -1745,10 +1745,11 @@ def _decode_chunk(self, cdata):
1745
1745
chunk = f .decode (chunk )
1746
1746
1747
1747
# view as numpy array with correct dtype
1748
+ chunk = ensure_ndarray (chunk )
1748
1749
if self ._dtype == object :
1749
1750
# special case object dtype, because incorrect handling can lead to
1750
1751
# segfaults and other bad things happening
1751
- if isinstance ( chunk , np . ndarray ) and chunk .dtype == object :
1752
+ if chunk .dtype == object :
1752
1753
# chunk is already of correct dtype, good to carry on
1753
1754
# flatten just to be sure we can reshape later
1754
1755
chunk = chunk .reshape (- 1 , order = 'A' )
You can’t perform that action at this time.
0 commit comments