-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot.py
executable file
·66 lines (53 loc) · 1.37 KB
/
plot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env python3
"""Implements CLI commands for results plotting."""
import argparse
import pathlib
import sys
from decimal import Decimal
import benchmark_suite.plotresults
parser = argparse.ArgumentParser(description="Create plot for results file.")
parser.add_argument(
"results_file",
metavar="results_file",
type=pathlib.Path,
nargs="?",
help="results JSON file",
default=sys.stdin,
)
parser.add_argument(
"--compare_file",
metavar="compare_file",
type=pathlib.Path,
nargs="?",
action="append",
help="",
)
parser.add_argument(
"plot_file",
metavar="plot_file",
type=pathlib.Path,
nargs="?",
help="file to plot results to",
default=sys.stdout,
)
parser.add_argument(
"--cost_per_kwh", type=Decimal, help="""Cost of power per KWh for plots"""
)
parser.add_argument(
"--carbon_per_kwh", type=Decimal, help="""Carbon dioxide in Kg per KWh for plots"""
)
parser.add_argument(
"--override_power", type=Decimal, help="""Override power consumption in watts"""
)
parser.add_argument("--override_tco", type=Decimal, help="""TCO of machine in GBP""")
args = parser.parse_args()
pr = benchmark_suite.plotresults.PlotResults(
args.results_file,
args.compare_file,
args.plot_file,
args.cost_per_kwh,
args.carbon_per_kwh,
args.override_power,
args.override_tco,
)
pr.plot_results()