Skip to content

Commit

Permalink
Handle case where reading is a bit too optimistic
Browse files Browse the repository at this point in the history
  • Loading branch information
cphyc committed Dec 6, 2023
1 parent 26c01c3 commit 23f3f28
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion yt/frontends/ramses/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ def _read_fluid_selection(self, chunks, selector, fields, size):
rv = subset.fill(fd, field_subs, selector, file_handler)
for ft, f in field_subs:
d = rv.pop(f)
if d.size == 0:
continue
mylog.debug(
"Filling %s with %s (%0.3e %0.3e) (%s zones)",
f,
Expand All @@ -213,7 +215,8 @@ def _read_fluid_selection(self, chunks, selector, fields, size):
tr[(ft, f)].append(d)
d = {}
for field in fields:
d[field] = np.concatenate(tr.pop(field))
tmp = tr.pop(field, None)
d[field] = np.concatenate(tmp) if tmp else np.empty(0, dtype="d")

return d

Expand Down

0 comments on commit 23f3f28

Please sign in to comment.