aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2018-04-23 13:41:51 +0200
committerTibor Frank <tifrank@cisco.com>2018-04-23 13:43:28 +0200
commit6f8266f81bb052e2c0e51b029e47f0eb4f04a7ed (patch)
tree0a1ea3d3ddcdf3fa9d664308f59c1956d24f7cff /resources/tools
parent7aa0d625baca67d9789b5db3da2ee468597d254b (diff)
Report: fix performance comparision tables
Change-Id: Ieae746412427980fb86512253cc58ebcee991317 Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools')
-rw-r--r--resources/tools/presentation/generator_tables.py28
-rw-r--r--resources/tools/presentation/utils.py5
2 files changed, 21 insertions, 12 deletions
diff --git a/resources/tools/presentation/generator_tables.py b/resources/tools/presentation/generator_tables.py
index 9fe653cb79..a5a573ad94 100644
--- a/resources/tools/presentation/generator_tables.py
+++ b/resources/tools/presentation/generator_tables.py
@@ -407,16 +407,22 @@ def table_performance_comparison(table, input_data):
data_t = remove_outliers(tbl_dict[tst_name]["ref-data"],
outlier_const=table["outlier-const"])
# TODO: Specify window size.
- item.append(round(mean(data_t) / 1000000, 2))
- item.append(round(stdev(data_t) / 1000000, 2))
+ if data_t:
+ item.append(round(mean(data_t) / 1000000, 2))
+ item.append(round(stdev(data_t) / 1000000, 2))
+ else:
+ item.extend([None, None])
else:
item.extend([None, None])
if tbl_dict[tst_name]["cmp-data"]:
data_t = remove_outliers(tbl_dict[tst_name]["cmp-data"],
outlier_const=table["outlier-const"])
# TODO: Specify window size.
- item.append(round(mean(data_t) / 1000000, 2))
- item.append(round(stdev(data_t) / 1000000, 2))
+ if data_t:
+ item.append(round(mean(data_t) / 1000000, 2))
+ item.append(round(stdev(data_t) / 1000000, 2))
+ else:
+ item.extend([None, None])
else:
item.extend([None, None])
if item[1] is not None and item[3] is not None:
@@ -598,16 +604,22 @@ def table_performance_comparison_mrr(table, input_data):
data_t = remove_outliers(tbl_dict[tst_name]["ref-data"],
outlier_const=table["outlier-const"])
# TODO: Specify window size.
- item.append(round(mean(data_t) / 1000000, 2))
- item.append(round(stdev(data_t) / 1000000, 2))
+ if data_t:
+ item.append(round(mean(data_t) / 1000000, 2))
+ item.append(round(stdev(data_t) / 1000000, 2))
+ else:
+ item.extend([None, None])
else:
item.extend([None, None])
if tbl_dict[tst_name]["cmp-data"]:
data_t = remove_outliers(tbl_dict[tst_name]["cmp-data"],
outlier_const=table["outlier-const"])
# TODO: Specify window size.
- item.append(round(mean(data_t) / 1000000, 2))
- item.append(round(stdev(data_t) / 1000000, 2))
+ if data_t:
+ item.append(round(mean(data_t) / 1000000, 2))
+ item.append(round(stdev(data_t) / 1000000, 2))
+ else:
+ item.extend([None, None])
else:
item.extend([None, None])
if item[1] is not None and item[3] is not None and item[1] != 0:
diff --git a/resources/tools/presentation/utils.py b/resources/tools/presentation/utils.py
index 0e72a06343..2fbf70cadc 100644
--- a/resources/tools/presentation/utils.py
+++ b/resources/tools/presentation/utils.py
@@ -36,10 +36,7 @@ def mean(items):
:rtype: float
"""
- if len(items):
- return float(sum(items)) / len(items)
- else:
- return None
+ return float(sum(items)) / len(items)
def stdev(items):