Skip to content

Commit

Permalink
hack chunk_getitem with a try except
Browse files Browse the repository at this point in the history
  • Loading branch information
emfdavid committed Feb 12, 2024
1 parent cb3908b commit c6659e2
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions zarr/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2225,16 +2225,27 @@ def _chunk_getitems(

for ckey, chunk_select, out_select in zip(ckeys, lchunk_selection, lout_selection):
if ckey in cdatas:
self._process_chunk(
out,
cdatas[ckey],
chunk_select,
drop_axes,
out_is_ndarray,
fields,
out_select,
partial_read_decode=partial_read_decode,
)
try:
self._process_chunk(
out,
cdatas[ckey],
chunk_select,
drop_axes,
out_is_ndarray,
fields,
out_select,
partial_read_decode=partial_read_decode,
)
except RuntimeError:
raise
except Exception as e:
print(f"Ignoring exception {type(e)}:'{e}' in _process_chunk: ckey:{ckey}; fields:{fields}; chunk_select:{chunk_select}; out_select: {out_select} fill_value:{self._fill_value};")
if self._fill_value is not None:
if fields:
fill_value = self._fill_value[fields]
else:
fill_value = self._fill_value
out[out_select] = fill_value
else:
# check exception type
if self._fill_value is not None:
Expand Down

0 comments on commit c6659e2

Please sign in to comment.