#NEWLINE# def finalize( self ) : #NEWLINE# #INDENT# if self . save_all_Ks : #NEWLINE# #INDENT# rhos = [ rho [ : , ( self . Ks - 1 ) ] for rho in self . rhos ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# rhos = self . rhos #NEWLINE# #UNINDENT# for ( meta , info ) in iteritems ( self . metas ) : #NEWLINE# #INDENT# required = [ self . outputs [ : , : , [ i ] , : ] for i in info . deps ] #NEWLINE# r = meta ( rhos , required ) #NEWLINE# if ( r . ndim == 3 ) : #NEWLINE# #INDENT# r = r [ : , : , np . newaxis , : ] #NEWLINE# #UNINDENT# self . outputs [ : , : , required . pos , : ] = r #NEWLINE# #UNINDENT# if self . n_meta_only : #NEWLINE# #INDENT# self . outputs = np . ascontiguousarray ( self . outputs [ : , : , : ( - self . n_meta_only ) , : ] ) #NEWLINE# #UNINDENT# if self . should_mask : #NEWLINE# #INDENT# self . outputs [ ( ~ self . mask ) ] = np . nan