Illustrate the intermediate stages of complex-routing example 1
This commit is contained in:
parent
365c14c59a
commit
c3e420eadb
1 changed files with 402 additions and 86 deletions
|
|
@ -4,7 +4,7 @@ from argparse import ArgumentParser
|
|||
from json import dumps
|
||||
from pathlib import Path
|
||||
|
||||
from examples.advanced_layouts import INPUTS, build_problem
|
||||
from examples.advanced_layouts import COMPLEX_EXAMPLE, COMPLEX_EXAMPLE_POINTS, INPUTS, build_problem
|
||||
from inire.tests.routing_corpus import CASE_GROUPS, profile_options
|
||||
from inire.tests.stress_routing_benchmarks import STRESS_BENCHMARK_CASES
|
||||
|
||||
|
|
@ -14,9 +14,12 @@ def main() -> None:
|
|||
parser.add_argument("--output", type=Path, default=INPUTS)
|
||||
args = parser.parse_args()
|
||||
|
||||
cases = (*STRESS_BENCHMARK_CASES, *CASE_GROUPS["terminal-bench"], *CASE_GROUPS["terminal-bench-point-terminals"])
|
||||
cases = [(case.name, case) for case in STRESS_BENCHMARK_CASES]
|
||||
for name in (COMPLEX_EXAMPLE, COMPLEX_EXAMPLE_POINTS):
|
||||
(case,) = CASE_GROUPS[name]
|
||||
cases.append((name, case))
|
||||
entries = []
|
||||
for case in cases:
|
||||
for name, case in cases:
|
||||
problem = case.problem
|
||||
options = profile_options(case, "public-defaults")
|
||||
data = {
|
||||
|
|
@ -30,10 +33,10 @@ def main() -> None:
|
|||
}
|
||||
rebuilt, settings = build_problem(data)
|
||||
if problem != rebuilt or options != settings:
|
||||
raise ValueError(f"The advanced example no longer reproduces fixture {case.name}")
|
||||
raise ValueError(f"The advanced example no longer reproduces fixture {name}")
|
||||
|
||||
# Keep ports and each net on one line so the input file is easy to scan.
|
||||
lines = [f" {dumps(case.name)}: {{"]
|
||||
lines = [f" {dumps(name)}: {{"]
|
||||
for field in ("bounds", "clearance", "bend_radii", "sbend_radii", "infer_terminal_headings"):
|
||||
lines.append(f" {dumps(field)}: {dumps(data[field])},")
|
||||
for field in ("keepouts", "nets"):
|
||||
|
|
|
|||
Loading…
Reference in a new issue