aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Duraj <julien.duraj@linaro.org>2016-10-03 14:34:28 +0100
committerJulien Duraj <julien.duraj@linaro.org>2016-10-04 09:58:11 +0100
commit38db2722756cd7a22be7b6c57b1710fc5642f38f (patch)
treea06bb47d8055fa604607f81706a868ea56751a55
parent91dda2aac21c5462f34456d19c7f5cfa7f3a0b73 (diff)
downloadart-testing-lor_marshmallow.tar.gz
Print removed keys and remove stacktrace in warningslor_marshmallow
Change-Id: Ie5ef0a122dee6dabe62077f340f9a0844bb4219a
-rwxr-xr-xcompare.py5
-rw-r--r--tools/utils.py6
2 files changed, 7 insertions, 4 deletions
diff --git a/compare.py b/compare.py
index 3d1a780..913dcd1 100755
--- a/compare.py
+++ b/compare.py
@@ -196,9 +196,10 @@ if __name__ == "__main__":
filter_stats_warnings=args.output_for_linaro_automation)
if not utils.HaveSameKeys(res_1, res_2):
+ res_1, res_2, diff = utils.KeepSameKeys(res_1, res_2)
utils.Warning("Computing geomean on a subset of statistics which only " \
- "includes keys common to both datasets.")
- res_1, res_2 = utils.KeepSameKeys(res_1, res_2)
+ "includes keys common to both datasets.\n" \
+ "Removed Keys: " + str(diff))
utils_stats.ComputeAndPrintRelationGeomean(
utils.Unflatten(res_1),
utils.Unflatten(res_2),
diff --git a/tools/utils.py b/tools/utils.py
index 409ee47..e39a16d 100644
--- a/tools/utils.py
+++ b/tools/utils.py
@@ -64,7 +64,6 @@ def Warning(message, exc=None):
if exc != None:
traceback.print_exception(type(exc), exc, None)
print(utils_print.NO_COLOUR)
- traceback.print_stack()
def Error(message, rc=1):
print(utils_print.COLOUR_RED + 'ERROR: ' + message + utils_print.NO_COLOUR,
@@ -416,17 +415,20 @@ def Flatten(data, key=''):
return res
+# TODO: Refactor function to handle arbitrary data structures (see HaveSameKeys)
def KeepSameKeys(data_1, data_2):
+ diff_keys_dict = dict()
for stats_type in data_1:
keys_1, keys_2 = data_1[stats_type].keys(), data_2[stats_type].keys()
diff_keys = keys_1 ^ keys_2
+ diff_keys_dict[stats_type] = diff_keys
for k in list(keys_1):
if k in diff_keys:
del data_1[stats_type][k]
for k in list(keys_2):
if k in diff_keys:
del data_2[stats_type][k]
- return data_1, data_2
+ return data_1, data_2, diff_keys_dict
def HaveSameKeys(data_1, data_2):
if IsDictionary(data_1) and IsDictionary(data_2):