:param data: Full data set with unavailable samples replaced by nan.
:type data: OrderedDict
:returns: Classification and trend values
- :rtype: 2-tuple, list of strings and list of floats
+ :rtype: 3-tuple, list of strings, list of floats and list of floats
"""
# Nan means something went wrong.
# Use 0.0 to cause that being reported as a severe regression.
group_list.reverse() # Just to use .pop() for FIFO.
classification = []
avgs = []
+ stdevs = []
active_group = None
values_left = 0
avg = 0.0
+ stdv = 0.0
for sample in data.values():
if np.isnan(sample):
classification.append(u"outlier")
avgs.append(sample)
+ stdevs.append(sample)
continue
if values_left < 1 or active_group is None:
values_left = 0
active_group = group_list.pop()
values_left = len(active_group.run_list)
avg = active_group.stats.avg
+ stdv = active_group.stats.stdev
classification.append(active_group.comment)
avgs.append(avg)
+ stdevs.append(stdv)
values_left -= 1
continue
classification.append(u"normal")
avgs.append(avg)
+ stdevs.append(stdv)
values_left -= 1
- return classification, avgs
+ return classification, avgs, stdevs
def convert_csv_to_pretty_txt(csv_file_name, txt_file_name, delimiter=u","):
if txt_table is None:
txt_table = prettytable.PrettyTable(row)
else:
- txt_table.add_row(row)
- txt_table.align = u"r"
- txt_table.align[u"Test Case"] = u"l"
- txt_table.align[u"RCA"] = u"l"
- txt_table.align[u"RCA1"] = u"l"
- txt_table.align[u"RCA2"] = u"l"
- txt_table.align[u"RCA3"] = u"l"
-
+ txt_table.add_row(
+ [str(itm.replace(u"\u00B1", u"+-")) for itm in row]
+ )
if not txt_table:
return
+ txt_table.align = u"r"
+ for itm in (u"Test Case", u"Build", u"Version", u"VPP Version"):
+ txt_table.align[itm] = u"l"
+
if txt_file_name.endswith(u".txt"):
with open(txt_file_name, u"wt", encoding='utf-8') as txt_file:
txt_file.write(str(txt_table))