Skip to content

Commit

Permalink
Merge pull request #28 from harsha-simhadri/gw/powermetrics_generator…
Browse files Browse the repository at this point in the history
…_fix

fixed issue with sensor/power metrics pre-check breaking data_export.py
  • Loading branch information
sourcesync authored Sep 18, 2021
2 parents cbf20a6 + 50aea38 commit 8180e0e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions benchmark/plotting/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8180e0e

Please sign in to comment.