#NEWLINE# @ dispatch ( Expr , h5py . Dataset ) #NEWLINE# def post_compute( expr , data , scope = None ) : #NEWLINE# #INDENT# " Bring dataset into memory if it's small relative to memory " #NEWLINE# nbytes = ( data . size * data . dtype . alignment ) #NEWLINE# comfortable_memory = ( available_memory ( ) / 4 ) #NEWLINE# if ( nbytes < comfortable_memory ) : #NEWLINE# #INDENT# return data . value #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return data