# inire Inire routes waveguides between fixed ports on photonic and RF layouts. It uses straight segments, 90-degree bends, and S-bends, and checks the finished geometry for clearance. You supply the placement, keepouts, and allowed bend radii. The router returns the routes it could verify along with any partial results. ## Install From a checkout with Python 3.11 or newer, run `pip install .`. For development, `uv sync` also installs the test and lint tools. ## Route a net ```python from inire import NetSpec, Port, RoutingProblem, route problem = RoutingProblem( bounds=(0, 0, 1000, 1000), nets=(NetSpec("input", Port(50, 100, 0), Port(250, 100, 0), width=2),), clearance=2, ) run = route(problem) result = run.results_by_net["input"] if result.is_valid: print(result.report.total_length) else: print(result.outcome) ``` Use one coordinate unit throughout the layout. Port coordinates snap to the integer grid in that unit. Headings are in degrees, with 0 pointing east and 90 pointing north. The target heading is the direction of travel into the target. Automatic routing is the default. For a layout with crossing devices, place the devices first and route each external segment as a separate net. Include device keepouts with access to their ports. To keep previously routed waveguides fixed, add their `locked_geometry` to the next problem's obstacles. [API and tuning guide](DOCS.md) ## Examples and development - [Runnable examples](examples/README.md) cover clearance, locked waveguides, custom bends, and partial routes. - [Architecture](docs/architecture.md) describes planner selection, detailed search, and verification. - [Routing benchmarks](docs/topological-routing.md) explain the corpus, profiles, and measured coverage. - [Diagnostics](docs/routing-diagnostics.md) explains counters, timings, and trace tools. Run `python -m pytest` for the correctness suite, including all 67 routing regression boards. Use `python -m pytest -m "not routing_corpus"` for a shorter local run. [Performance checks](docs/routing-diagnostics.md#reproduce-and-compare) ## License GNU Affero General Public License v3. [License text](LICENSE.md)