#NEWLINE# def do( self , which_callback , * args ) : #NEWLINE# #INDENT# log = self . main_loop . log #NEWLINE# iteration = log . status [ 'iterations_done' ] #NEWLINE# for ( key , value ) in log . current_row . items ( ) : #NEWLINE# #INDENT# if ( key in self . p_indices ) : #NEWLINE# #INDENT# if ( key not in self . plots ) : #NEWLINE# #INDENT# line_color = self . colors [ ( self . color_indices [ key ] % len ( self . colors ) ) ] #NEWLINE# fig = self . p [ self . p_indices [ key ] ] #NEWLINE# fig . line ( [ iteration ] , [ value ] , legend = key , name = key , line_color = line_color ) #NEWLINE# renderer = fig . select ( dict ( name = key ) ) #NEWLINE# self . plots [ key ] = renderer [ 0 ] . data_source #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . plots [ key ] . data [ 'x' ] . append ( iteration ) #NEWLINE# self . plots [ key ] . data [ 'y' ] . append ( value ) #NEWLINE# self . push_thread . put ( self . plots [ key ] , PushThread . PUT ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# self . push_thread . put ( which_callback , PushThread . PUSH )