INNER CODE UNIT · Python
_render_dashboard
i3T4AN/KADATH · kadath/cli.py:152
def _render_dashboard(status: dict, styled: bool = False) -> str:
run = status["run"]
population = ", ".join(f"{row['status']}: {row['count']}" for row in status["population"])
if styled:
attempts = {row["status"]: int(row["count"]) for row in status.get("attempts", [])}
total = int(run["population_size"])
done = attempts.get("completed", 0)
failed = attempts.get("failed", 0)
resolved = min(total, done + failed)
active = max(0, total - resolved)
operations = status.get("operations", {})
epoch_label = f"EPOCH {run['current_epoch']} / {run['total_epochs']}"
lines = [
_ansi("KADATH EVOLUTION DASHBOARD", "1", "38;5;51"),
f"{_ansi('RUN', '38;5;245')} {run['id']} {_ansi('STATUS', '38;5;245')} {_ansi(str(run['status']).upper(), '1', '38;5;84')}",
f"{_ansi('GOAL', '38;5;245')} {run['goal']}",
"",
_ansi(epoch_label, "1", "38;5;213"),