MCPcopy Create free account
hub / github.com/FastLED/FastLED / format_table

Function format_table

tests/measure_esp32s3_opt_ins.py:375–393  ·  view source on GitHub ↗
(results: dict[str, int])

Source from the content-addressed store, hash-verified

373
374
375def format_table(results: dict[str, int]) -> str:
376 baseline = results.get("baseline")
377 lines = [
378 "| Config | SLIM row | Label | total_flash | Δ vs baseline | Δ vs previous |",
379 "|---|:---:|---|---:|---:|---:|",
380 ]
381 prev: int | None = None
382 for name, cfg in CONFIGS.items():
383 if name not in results:
384 continue
385 total = results[name]
386 dvb = "" if baseline is None else f"{total - baseline:+,} B"
387 dvp = "" if prev is None else f"{total - prev:+,} B"
388 row = "—" if cfg.slim_row is None else f"{cfg.slim_row}"
389 lines.append(
390 f"| `{name}` | {row} | {cfg.label} | {total:,} B | {dvb} | {dvp} |"
391 )
392 prev = total
393 return "\n".join(lines) + "\n"
394
395
396def main() -> int:

Callers 1

mainFunction · 0.85

Calls 3

itemsMethod · 0.80
getMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected