pickle does not like defaultdicts

master
LEdoian 8 months ago
parent 064c59d081
commit 34be65e081

@ -31,7 +31,7 @@ def get_data() -> tuple[datetime, dict[str, int], dict[str, int]]:
for talk in data: for talk in data:
states[talk['state']] += 1 states[talk['state']] += 1
jobstates[talk['progress']] += 1 jobstates[talk['progress']] += 1
return time, states, jobstates return time, dict(states), dict(jobstates)
def main(): def main():
@ -56,7 +56,6 @@ def main():
# Show the plot # Show the plot
x = sorted(ts.data.keys()) # times x = sorted(ts.data.keys()) # times
# vvv should be a defaultdict anyway, but let's be defensive :-)
ys = [tuple(ts.data[time][0].get(state, 0) for state in ts.states) for time in x] # numbers per state ys = [tuple(ts.data[time][0].get(state, 0) for state in ts.states) for time in x] # numbers per state
# We do not show jobstates atm. Too lazy. # We do not show jobstates atm. Too lazy.
# ys are transposed we need vectors by times, not by states. # ys are transposed we need vectors by times, not by states.

Loading…
Cancel
Save