-
Notifications
You must be signed in to change notification settings - Fork 0
/
report.py
executable file
·44 lines (29 loc) · 875 Bytes
/
report.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
#!/usr/bin/env python3
import sys
import pandas as pd
import matplotlib.pyplot as plt
def report(csv_path):
with open(csv_path, 'r') as file:
title = file.readline().strip()
if not title.startswith('#'):
header = title
else:
title = title[len('# '):]
header = file.readline().strip()
df = pd.read_csv(csv_path, comment = '#')
columns = header.split(',')
plt.figure()
plt.title(title)
for col in columns[1:]:
if col.startswith('multifrontal'):
alpha = 0.5
else:
alpha = 1.0
plt.semilogy(df[columns[0]], df[col], label = col, alpha = alpha)
plt.legend()
plt.show()
if __name__ == "__main__":
if len(sys.argv) != 2:
print("Usage: python report.py <csv_file_path>")
sys.exit(1)
report(sys.argv[1])