#NEWLINE# def print_results( tests ) : #NEWLINE# #INDENT# table_runs = [ ] #NEWLINE# table_mems = [ ] #NEWLINE# for ( name , test ) in tests . items ( ) : #NEWLINE# #INDENT# runs = test [ 'runs' ] #NEWLINE# table_runs . append ( [ name , str ( min ( runs ) ) , str ( max ( test ) ) , str ( numpy . mean ( runs ) ) , str ( numpy . std ( runs ) ) ] ) #NEWLINE# #UNINDENT# for ( name , test ) in tests . items ( ) : #NEWLINE# #INDENT# mems = test [ 'mems' ] #NEWLINE# table_mems . append ( [ name , str ( min ( mems ) ) , str ( max ( mems ) ) , str ( numpy . mean ( mems ) ) , str ( numpy . std ( mems ) ) ] ) #NEWLINE# #UNINDENT# header = [ 'name' , 'min' , 'max' , 'avg' , 'std' ] #NEWLINE# print ( 'Timing (in milliseconds)' ) #NEWLINE# print ( tabulate ( table_runs , headers = header ) ) #NEWLINE# print ( 'Maximum RAM usage (in MB)' ) #NEWLINE# print ( tabulate ( table_mems , headers = header ) )