Add a column with average value of input files.

Gather the averages of the non-reference files.
devs/lauromoura/reporting
Lauro Moura 4 years ago
parent a873c115e0
commit 908c95ba85
  1. 13
      src/bin/expedite-cmp

@ -7,6 +7,7 @@ import os
import os.path
import csv
from optparse import OptionParser
from collections import defaultdict
fmttext = '%(value)7.2f (%(percentual)+6.1f%%)'
fmthtml = '%(value)7.2f <span style="color: #666; width: 55pt; display: inline-block; text-align: right; text-shadow: #999 1px 1px 3px;">(%(percentual)+0.1f%%)</span>'
@ -64,6 +65,17 @@ for f in files:
d[t] = float(row[0])
max_test_name = max(len(t), max_test_name)
# Insert averages
data['average'] = defaultdict(list)
for f in others_f:
for test in data[f]:
data['average'][test].append(data[f][test])
for test in data['average']:
values = data['average'][test]
data['average'][test] = sum(values)/len(values)
others_f.insert(0, 'average')
def report_text():
test_name_fmt = "%%%ds:" % max_test_name
@ -126,6 +138,7 @@ def report_html():
import time
fnames = [os.path.basename(f) for f in files]
fnames.insert(1, 'Average')
print("""\
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Loading…
Cancel
Save