diff options
author | Julien Duraj <julien.duraj@linaro.org> | 2016-09-05 10:49:46 +0100 |
---|---|---|
committer | Julien Duraj <julien.duraj@linaro.org> | 2016-09-05 11:19:59 +0100 |
commit | aaca2ef22f705f16276beac48b39dfb88d809cd8 (patch) | |
tree | 6c1a6f461705323a0119bf88acbcb940b6a33c13 | |
parent | 4c919da642ff1ca8d8ce2e208db1f9c21635d4b6 (diff) | |
download | art-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-x | compare.py | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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]) |