#NEWLINE# def process_iteration_result( self , result , context ) : #NEWLINE# #INDENT# outfile = os . path . join ( context . output_directory , 'result.txt' ) #NEWLINE# with open ( outfile , 'w' ) as wfh : #NEWLINE# #INDENT# for metric in result . metrics : #NEWLINE# #INDENT# line = '{} = {}' . format ( metric . name , metric . value ) #NEWLINE# if metric . units : #NEWLINE# #INDENT# line = ' ' . join ( [ line , metric . units ] ) #NEWLINE# #UNINDENT# line += '\n' #NEWLINE# wfh . write ( line ) #NEWLINE# #UNINDENT# #UNINDENT# context . add_artifact ( 'iteration_result' , 'result.txt' , 'export' )