File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -314,13 +314,17 @@ def _process_index(self, index):
314314 # If only one slice or integer passed in, it was not wrapped in a tuple
315315 index = [index ]
316316 elif isinstance (index , tuple ):
317- index = list (index )
318- for i in range (len (index )):
319- if index [i ] == Ellipsis :
320- index = (
321- index [:i ] + (dims + 2 - len (index )) * [slice (None )] + index [i + 1 :]
322- )
323- break
317+ if len (index ) == 0 :
318+ # The empty tuple specifies all valid and ghost cells
319+ index = [index ]
320+ else :
321+ index = list (index )
322+ for i in range (len (index )):
323+ if index [i ] == Ellipsis :
324+ index = (
325+ index [:i ] + (dims + 2 - len (index )) * [slice (None )] + index [i + 1 :]
326+ )
327+ break
324328 else :
325329 raise Exception ("MultiFab.__getitem__: unexpected index type" )
326330
You can’t perform that action at this time.
0 commit comments