From 50aea38ab82d13d6a51dcba0763cc1761a1fbfd1 Mon Sep 17 00:00:00 2001 From: George Williams Date: Fri, 17 Sep 2021 19:09:05 +0000 Subject: [PATCH] fix issue with sensor/power metrics check breaks data export --- benchmark/plotting/utils.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/benchmark/plotting/utils.py b/benchmark/plotting/utils.py index 281653ed..033de092 100644 --- a/benchmark/plotting/utils.py +++ b/benchmark/plotting/utils.py @@ -67,17 +67,13 @@ def compute_metrics(true_nn, res, metric_1, metric_2, return all_results -def compute_metrics_all_runs(dataset, res, recompute=False): +def compute_metrics_all_runs(dataset, res, recompute=False, sensor_metrics=False): try: true_nn = dataset.get_groundtruth() except: print(f"Groundtruth for {dataset} not found.") return - # removes 'wspq' metric if no power benchmarks found - # in the loaded runs - power_capture.detect_power_benchmarks(metrics, res) - search_type = dataset.search_type() for i, (properties, run) in enumerate(res): algo = properties['algo'] @@ -112,6 +108,8 @@ def compute_metrics_all_runs(dataset, res, recompute=False): if search_type == "knn" and name == "ap" or\ search_type == "range" and name == "k-nn": continue + if not sensor_metrics and name=="wspq": #don't process sensor_metrics by default + break v = metric["function"](true_nn, run_nn, metrics_cache, properties) run_result[name] = v yield run_result