6 from os.path
import exists
8 new = json.load(
open(
'_performance_') )
10 print 'Missing "_performance_" file'
13 ref = json.load(
open(
'_old_performance_') )
15 print 'Missing "old_performance_" file'
21 runtimes_compare =
open(
'runtime_diffs.txt',
'w')
22 format_string =
'%7.1f %7.1f %7.1f %6.2f %s\n'
23 runtimes_compare.write(
'%7s %7s %7s %6s %s\n' % (
"NEW",
"REF",
"DIFF",
"D/R",
"TEST"))
25 from math
import isnan, isinf
29 for key
in set(new.keys() + ref.keys()):
30 if key
in new
and key
in ref:
36 runtimes_compare.write( format_string % (n, r, diff, diff/r, key) )
40 new_sum =
sum(new_values)
41 ref_sum =
sum(ref_values)
42 new_avg = new_sum/
float(
len(new_values))
43 ref_avg = ref_sum/
float(
len(ref_values))
45 runtimes_compare.write( format_string % (new_sum, ref_sum, new_sum - ref_sum, (new_sum-ref_sum)/ref_sum,
'TOTAL' ))
46 runtimes_compare.write( format_string % (new_avg, ref_avg, new_avg - ref_avg, (new_avg-ref_avg)/ref_avg,
'MEAN' ))
52 if __name__ ==
"__main__":
bool isnan(T value)
portable check to see if a value is NaN.
Fstring::size_type len(Fstring const &s)
Length.
Real sum(ddGs &scores_to_sum)
bool open(utility::io::izstream &db_stream, std::string const &db_file, bool warn)
Open a database file on a provided stream.
BooleanOptionKey const exit("options:exit")