hotfix: early kwargs.pop('err') (#10197)

* hotfix: early kwargs.pop('err')

* err, no container
This commit is contained in:
qazal
2025-05-07 18:53:26 +03:00
committed by GitHub
parent 3bc72f02d9
commit e6c80a9e40
2 changed files with 3 additions and 2 deletions

View File

@@ -185,7 +185,7 @@ function renderMemoryGraph(graph) {
return `${p0.join(' ')} ${p1.join(' ')}`;
}).attr("fill", d => `#${colors[d.buf.num % colors.length]}`).on("mouseover", (e, { id, buf, x }) => {
d3.select(e.currentTarget).attr("stroke", "rgba(26, 27, 38, 0.8)").attr("stroke-width", 0.8);
const metadata = document.querySelector(".container.metadata");
const metadata = document.querySelector(".metadata");
document.getElementById("current-buf")?.remove();
const { num, dtype, nbytes, ...rest } = buf;
let label = `<BUFFER n${num} ${dtype} ${nbytes_format(nbytes)}>\nalive for ${pluralize(x[x.length-1]-x[0], 'timestep')}`;

View File

@@ -20,8 +20,9 @@ uops_colors = {Ops.LOAD: "#ffc0c0", Ops.STORE: "#87CEEB", Ops.CONST: "#e0e0e0",
# NOTE: if any extra rendering in VIZ fails, we don't crash
def pcall(fxn:Callable[..., str], *args, **kwargs) -> str:
err = kwargs.pop("err", "")
try: return fxn(*args, **kwargs)
except Exception: return f"ERROR in {fxn.__name__}\n{kwargs.get('err', '')}"
except Exception: return f"ERROR in {fxn.__name__}\n{err}"
# ** Metadata for a track_rewrites scope