Skip to content

Commit 3dfea45

Browse files
Jeffrey WhitakerJeffrey Whitaker
authored andcommitted
update
1 parent 2d5b802 commit 3dfea45

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/netCDF4/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,10 @@ def _StartCountStride(elem, shape, dimensions=None, grp=None, datashape=None,\
426426

427427
# ITERABLE #
428428
elif np.iterable(e) and np.array(e).dtype.kind in 'i': # Sequence of integers
429-
start[...,i] = np.apply_along_axis(lambda x: e*x, i, np.ones(sdim[:-1]))
429+
if not e.size
430+
start[...,i] = np.empty(0)
431+
else:
432+
start[...,i] = np.apply_along_axis(lambda x: e*x, i, np.ones(sdim[:-1]))
430433
indices[...,i] = np.apply_along_axis(lambda x: np.arange(sdim[i])*x, i, np.ones(sdim[:-1], int))
431434

432435
count[...,i] = 1

test/test_fancyslicing.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,6 @@ def test_get(self):
144144

145145
# slicing with all False booleans (PR #1197)
146146
iby[:] = False
147-
print(ibx)
148-
print(iby)
149-
print(ibz)
150147
data = v[ibx,iby,ibz]
151148
assert data.size == 0
152149

0 commit comments

Comments
 (0)