aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Duraj <julien.duraj@linaro.org>2016-09-05 10:49:46 +0100
committerJulien Duraj <julien.duraj@linaro.org>2016-09-05 11:19:59 +0100
commitaaca2ef22f705f16276beac48b39dfb88d809cd8 (patch)
tree6c1a6f461705323a0119bf88acbcb940b6a33c13
parent4c919da642ff1ca8d8ce2e208db1f9c21635d4b6 (diff)
downloadart-testing-aaca2ef22f705f16276beac48b39dfb88d809cd8.tar.gz
compare.py: handle different sets of keys
This change is to fix the Exception we get when we attempt to sort a list using both floats and strings. Change-Id: I57fad4bccfa86f3321773c20772df33663b9279e
-rwxr-xr-xcompare.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/compare.py b/compare.py
index 3c7fbcd..a7f27a7 100755
--- a/compare.py
+++ b/compare.py
@@ -16,6 +16,7 @@
import argparse
import json
+import math
from collections import OrderedDict
@@ -100,7 +101,10 @@ def FilterSignificantChanges(data_1, data_2,
return False
def OrderByDiff(entries):
- return sorted(entries, key = lambda values : values[3])
+ sortable_entries = [e for e in entries if not math.isnan(e[3])]
+ unsortable_entries = [e for e in entries if math.isnan(e[3])]
+ return sorted(sortable_entries, key = lambda values : values[3]) + \
+ unsortable_entries
print_extended_mean_data = 1
print_extended_raw_data = 2
@@ -156,8 +160,8 @@ def PrintDiff(data_1, data_2,
median_diff = utils_stats.GetRelativeDiff(med1, med2)
mean_diff = utils_stats.GetRelativeDiff(ave1, ave2)
else:
- median_diff = ''
- mean_diff = ''
+ median_diff = float('nan')
+ mean_diff = float('nan')
res = [key, wilcoxon_p, ttest_p, median_diff, madp1, madp2]
if print_extended >= print_extended_mean_data:
res.extend([mean_diff, dp1, dp2])