Download scripts/flow_debug/render_tasks.py from beyarkay/factorio-blueprints: direct link, hf CLI and curl.
- Browser
- Download file 774 Bytes
-
https://huggingface.co/datasets/beyarkay/factorio-blueprints/resolve/main/scripts/flow_debug/render_tasks.py
- Command line
-
hf download hf://datasets/beyarkay/factorio-blueprints/scripts/flow_debug/render_tasks.py
-
curl -L -o render_tasks.py https://huggingface.co/datasets/beyarkay/factorio-blueprints/resolve/main/scripts/flow_debug/render_tasks.py
774 Bytes
| import pickle, sys | |
| import matplotlib | |
| matplotlib.use("Agg") | |
| import matplotlib.pyplot as plt | |
| sys.path.insert(0, "scripts") | |
| from render_png import draw | |
| tasks = pickle.load(open(sys.argv[1], "rb")) | |
| pick = [tasks[i] for i in range(0, len(tasks), max(1, len(tasks) // 6))][:6] | |
| pick = pick[:3] | |
| fig, axes = plt.subplots(2, 2, figsize=(22, 23)) | |
| for ax, t in zip(axes.flat[:3], pick): | |
| draw(t["world"], ax, f"reference {t['max_throughput']:.2f}/s, {t['n_src']} sources, {t['n_snk']} sinks, {t['n_machines']} machines") | |
| ax.title.set_fontsize(18) | |
| draw(pick[0]["context"], axes.flat[3], "top-left task with the surrounding human factory as fixed context"); axes.flat[3].title.set_fontsize(18) | |
| fig.savefig("/home/user/factorion/plots/human_tasks.png", dpi=80, bbox_inches="tight") | |