Writing Outputs
After mining, export the ERG in any of three formats:
import ergminer
# Compute sim_time from the log
import pandas as pd
sim_time = float(
(pd.to_datetime(log["timestamp"]).max() - pd.to_datetime(log["timestamp"]).min())
.total_seconds()
)
ergminer.write_ergml(erg, "output/erg.ergml", sim_time=sim_time) # for simulation
ergminer.write_erg_json(erg, "output/erg.json") # full structure
ergminer.write_dot(erg, "output/erg.dot") # for Graphviz
Generate an image from the DOT file with Graphviz CLI:
See ergminer.write for full API details.