Retire routing archives and consolidate documentation tooling

Generate the guide, walkthrough, and gallery figures from one command. Keep benchmark fixtures and attribution with the tests and fold the durable findings from completed plans into the guides.
This commit is contained in:
Jan Petykiewicz 2026-12-02 20:33:19 -08:00
commit a05980e8af
2 changed files with 374 additions and 17204 deletions

View file

@ -97,7 +97,7 @@ In `stress-crossings-shared-outside-detour`, a straight external waveguide joins
Nine source ports feed routes around seven keepouts. Both variants use width 2, clearance 6, and bend radius 50.
- [Lane assignment, turnaround, and refinement](../docs/complex-routing-example-1.md)
- [Fixture and waypoint export](../docs/benchmark-fixtures.md#complex-routing-example-1)
- [Benchmark fixture](../docs/benchmark-fixtures.md#complex-routing-example-1)
### Fixed eastbound headings

View file

@ -23,6 +23,8 @@ from matplotlib import pyplot as plt # noqa: E402
from matplotlib.lines import Line2D # noqa: E402
if TYPE_CHECKING:
from collections.abc import Iterable
from matplotlib.axes import Axes
from inire import RoutingRunResult
@ -108,6 +110,24 @@ def _plot_case(problem: RoutingProblem, options: RoutingOptions, run: RoutingRun
plt.close(fig)
def render_layouts(layouts: dict, output_dir: Path, *, cases: Iterable[str] | None = None) -> int:
"""Render selected gallery layouts and report whether all routes verified."""
output_dir.mkdir(parents=True, exist_ok=True)
all_verified = True
for name in dict.fromkeys(cases or layouts):
problem, options = build_problem(layouts[name])
run = route(problem, options=options)
valid = sum(result.is_valid for result in run.results_by_net.values())
print(f"{name}: {valid}/{len(problem.nets)} verified")
if valid != len(problem.nets):
all_verified = False
print(" " + ", ".join(f"{res.net_id}: {res.outcome}" for res in run.results_by_net.values() if not res.is_valid))
_plot_case(problem, options, run, output_dir / f"example-{name}.png")
return 0 if all_verified else 1
def main() -> int:
layouts = loads(INPUTS.read_text(encoding="utf-8"))
parser = ArgumentParser(description=__doc__)
@ -117,20 +137,7 @@ def main() -> int:
)
parser.add_argument("--output-dir", type=Path, default=INPUTS.parent, help="Directory for the setup and result PNGs.")
args = parser.parse_args()
args.output_dir.mkdir(parents=True, exist_ok=True)
all_verified = True
for name in dict.fromkeys(args.case or layouts):
problem, options = build_problem(layouts[name])
run = route(problem, options=options)
valid = sum(result.is_valid for result in run.results_by_net.values())
print(f"{name}: {valid}/{len(problem.nets)} verified")
if valid != len(problem.nets):
all_verified = False
print(" " + ", ".join(f"{res.net_id}: {res.outcome}" for res in run.results_by_net.values() if not res.is_valid))
_plot_case(problem, options, run, args.output_dir / f"example-{name}.png")
return 0 if all_verified else 1
return render_layouts(layouts, args.output_dir, cases=args.case)
if __name__ == "__main__":