Skip to content
Myr

Add error message

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by sharkdp · committed by David Peter · parent 5a3fc3c · Browse files · 1 file+7 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+7 added−2 removed

  • other:+7 added−2 removed

1 file+7 added−2 removed

modified:scripts/welch_ttest.py+7 added-2 removed
1#!/usr/bin/python23import argparse4import json5import sys6from scipy import stats78parser = argparse.ArgumentParser()8parser.add_argument("file", help="JSON file with benchmark results")9parser.add_argument("file", help="JSON file with two benchmark results")10args = parser.parse_args()1112with open(args.file) as f:13 results = json.load(f)["results"]1415if len(results) != 2:16 print("The input file has to contain exactly two benchmarks")17 sys.exit(1)1819a, b = [x["command"] for x in results[:2]]20X, Y = [x["times"] for x in results[:2]]2122print("Command 1: {}".format(a))
6 unmodified lines
29print("p < {} = {}\n".format(th, dispose))30if dispose:31 print("There is a difference between the two benchmarks.")32else:28 print("The two benchmarks are almost the same.")33 print("The two benchmarks are almost the same.")