#NEWLINE# def _compute( self , windows , dates , assets , mask ) : #NEWLINE# #INDENT# "\n        Call the user's `compute` function on each window with a pre-built\n        output array.\n        " #NEWLINE# compute = self . compute #NEWLINE# missing_value = self . missing_value #NEWLINE# params = self . params #NEWLINE# outputs = self . outputs #NEWLINE# if ( outputs is not NotSpecified ) : #NEWLINE# #INDENT# out = recarray ( mask . shape , formats = ( [ self . dtype . str ] * len ( outputs ) ) , names = outputs ) #NEWLINE# out [ : ] = missing_value #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# out = full_like ( mask , missing_value , dtype = self . dtype ) #NEWLINE# #UNINDENT# with self . ctx : #NEWLINE# #INDENT# for ( idx , date ) in enumerate ( dates ) : #NEWLINE# #INDENT# col_mask = mask [ idx ] #NEWLINE# masked_out = out [ idx ] [ col_mask ] #NEWLINE# masked_assets = assets [ col_mask ] #NEWLINE# compute ( date , masked_assets , masked_out , * ( next ( w ) [ : , col_mask ] for w in windows ) , ** params ) #NEWLINE# out [ idx ] [ col_mask ] = masked_out #NEWLINE# #UNINDENT# #UNINDENT# return out