MCPcopy Create free account
hub / github.com/AdaCompNUS/summit / read_jam_factor

Function read_jam_factor

PythonAPI/examples/plot_jam_factor.py:4–23  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

2import matplotlib.pyplot as plt
3
4def read_jam_factor(path):
5 last_time = 0
6 data = []
7 with open(path) as f:
8 line = f.readline()
9 while line:
10 s = line.split(' ')
11 s = [float(x) for x in s]
12 t = s[0]
13
14 if int(t) >= last_time + 30:
15 data.append((t,
16 s[4] / s[1],
17 s[5] / s[2],
18 s[6] / s[3]))
19 print(path)
20 print(sum(s[4:7]) / sum(s[1:4]))
21 last_time = int(t)
22 line = f.readline()
23 return data
24
25data_gamma = read_jam_factor('statistics.gamma.log')
26data_simple = read_jam_factor('statistics.ttc.log')

Callers 1

plot_jam_factor.pyFile · 0.85

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected