Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions src/amrex/extensions/MultiFab.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,19 @@ def _process_index(self, index):
# If only one slice or integer passed in, it was not wrapped in a tuple
index = [index]
elif isinstance(index, tuple):
index = list(index)
for i in range(len(index)):
if index[i] == Ellipsis:
index = (
index[:i] + (dims + 2 - len(index)) * [slice(None)] + index[i + 1 :]
)
break
if len(index) == 0:
# The empty tuple specifies all valid and ghost cells
index = [index]
else:
index = list(index)
for i in range(len(index)):
if index[i] == Ellipsis:
index = (
index[:i]
+ (dims + 2 - len(index)) * [slice(None)]
+ index[i + 1 :]
)
break
else:
raise Exception("MultiFab.__getitem__: unexpected index type")

Expand Down
Loading