#NEWLINE# def load_results( self ) : #NEWLINE# #INDENT# 'Load results into model instance for access via model variables.' #NEWLINE# not_optimal = ( self . results [ 'Solver' ] [ 0 ] [ 'Termination condition' ] . key != 'optimal' ) #NEWLINE# r = self . m . solutions . load_from ( self . results ) #NEWLINE# if ( ( r is False ) or not_optimal ) : #NEWLINE# #INDENT# logging . critical ( self . results . Problem ) #NEWLINE# logging . critical ( self . results . Solver ) #NEWLINE# if not_optimal : #NEWLINE# #INDENT# message = 'Model solution was non-optimal.' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# message = 'Could not load results into model instance.' #NEWLINE# #UNINDENT# raise exceptions . ModelError ( message )