File size: 734 Bytes
0a3edb6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | import glob, sys
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
sys.path.insert(0, "scripts")
from render_png import draw
from functional import sample, window, thput, crafted_delivery
from measure import CONFIGS
views = sample(sorted(glob.glob(sys.argv[1])), int(sys.argv[2]))
cfg, out, ids = CONFIGS[sys.argv[3]], sys.argv[4], [int(i) for i in sys.argv[5].split(",")]
fig, axes = plt.subplots(2, 4, figsize=(40, 21))
for ax, i in zip(axes.flat, ids):
r, lab, x0, y0 = views[i]
w, why = window(r, lab, x0, y0, cfg)
draw(w, ax, f"#{i}: delivers {thput(w):.2f}/s\n" + ", ".join(f"{k} {v}" for k, v in why.most_common(3)))
ax.title.set_fontsize(18)
fig.savefig(out, dpi=55, bbox_inches="tight")
|