-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
58 lines (47 loc) · 1.35 KB
/
main.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
"""Main script for the chart plotter."""
from pathlib import Path
from chart_plotter import plot_chart
from data_loader import load_test_data
from data_processing import (
PricePerformanceArgs,
calculate_averages,
calculate_price_performance_ratios,
convert_seconds_to_minutes,
log_transform_ratios,
)
# Load the data from the JSON file
data_file = Path("data.json")
(
test_data,
computer_names,
power_usage_watts_per_computer,
computer_rental_cost_per_hour,
cost_per_kwh,
test_names,
) = load_test_data(data_file)
averages = calculate_averages(test_data)
print("averages", averages)
plot_chart(
averages,
computer_names,
test_names,
ylabel="Average Time in Mins",
conversion_func=convert_seconds_to_minutes,
)
price_performance_args = PricePerformanceArgs(
power_usage_watts_per_computer=power_usage_watts_per_computer,
computer_rental_cost_per_hour=computer_rental_cost_per_hour,
cost_per_kwh=cost_per_kwh,
)
price_performance_ratios = calculate_price_performance_ratios(
averages, price_performance_args
)
log_ratios = log_transform_ratios(price_performance_ratios)
print("price_performance_ratios", price_performance_ratios)
print("normalized_ratios", log_ratios)
plot_chart(
log_ratios,
computer_names,
test_names,
ylabel="Log Transformed Price/Performance Ratio",
)