#NEWLINE# def __getitem__( self , item ) : #NEWLINE# #INDENT# cols = ( self . cols if ( self . cols is not None ) else slice ( None , None , None ) ) #NEWLINE# ( start , stop ) = _start_stop ( item ) #NEWLINE# if ( ( start is None ) and ( stop is None ) ) : #NEWLINE# #INDENT# return np . concatenate ( self . arrs , axis = 0 ) [ ( ... , cols ) ] #NEWLINE# #UNINDENT# if ( start is None ) : #NEWLINE# #INDENT# start = 0 #NEWLINE# #UNINDENT# if ( stop is None ) : #NEWLINE# #INDENT# stop = self . offsets [ ( - 1 ) ] #NEWLINE# #UNINDENT# if ( stop < 0 ) : #NEWLINE# #INDENT# stop = ( self . offsets [ ( - 1 ) ] + stop ) #NEWLINE# #UNINDENT# rec_start = self . _get_recording ( start ) #NEWLINE# rec_stop = self . _get_recording ( stop ) #NEWLINE# assert ( 0 <= rec_start <= rec_stop < len ( self . arrs ) ) #NEWLINE# start_rel = ( start - self . offsets [ rec_start ] ) #NEWLINE# stop_rel = ( stop - self . offsets [ rec_stop ] ) #NEWLINE# if ( rec_start == rec_stop ) : #NEWLINE# #INDENT# return _fill_index ( self . arrs [ rec_start ] [ start_rel : stop_rel ] , item ) [ ( ... , cols ) ] #NEWLINE# #UNINDENT# chunk_start = self . arrs [ rec_start ] [ start_rel : ] #NEWLINE# chunk_stop = self . arrs [ rec_stop ] [ : stop_rel ] #NEWLINE# l = [ chunk_start ] #NEWLINE# if ( ( rec_stop - rec_start ) >= 2 ) : #NEWLINE# #INDENT# logger . warn ( 'Loading a full virtual array: this might be slow and something might be wrong.' ) #NEWLINE# l += [ self . arrs [ r ] [ ... ] for r in range ( ( rec_start + 1 ) , rec_stop ) ] #NEWLINE# #UNINDENT# l += [ chunk_stop ] #NEWLINE# return _fill_index ( np . concatenate ( l , axis = 0 ) , item ) [ ( ... , cols ) ]