Files
evil_MoE/src/projected_grpo/figs.py
T
wassnameandClaude Opus 4.8 4621488cc0 reorg: out/ sorted by datatype (vhack/ pools/ runs/ vhack_grads/ figs/)
Code writes+reads the new scheme; migrate_out_dirs.py moved 225 loose artifacts
(0 left at top level). Per-run checkpoints+rollouts now group under
runs/<ts>_<run_id>/ as train.safetensors/rollouts.jsonl. Figures land in
out/figs/ with a stable docs/figs/<name>.png symlink (figs.link_latest).
justfile also gains run-cell REFRESH param (online-erasure arm). Smoke +
smoke-vanilla + results all green on new paths. Requeue manifest preserves the
why/resolve labels that pueue reset wiped.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-30 03:52:24 +00:00

29 lines
1.0 KiB
Python

"""Stable `docs/figs/<name>.png` -> latest generated figure under `out/`.
Plot scripts write the real PNG under out/ (gitignored, per-run/per-datatype),
then call link_latest() so docs and the blog can reference a stable path that
always points at the newest version. The symlink is relative so the repo stays
relocatable.
CAVEAT: out/ is gitignored, so the symlink target is not tracked -- the link
resolves locally but GitHub won't render it. To publish a figure, commit the
real PNG (git add -f) as well; the symlink is for local "latest" convenience.
"""
from __future__ import annotations
import os
from pathlib import Path
FIGS_DIR = Path("docs/figs")
def link_latest(out_path: Path) -> Path:
"""Point docs/figs/<out_path.name> at out_path (relative symlink). Returns the link."""
FIGS_DIR.mkdir(parents=True, exist_ok=True)
link = FIGS_DIR / out_path.name
target = os.path.relpath(out_path.resolve(), FIGS_DIR.resolve())
if link.is_symlink() or link.exists():
link.unlink()
link.symlink_to(target)
return link