- Python 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| docs | ||
| examples | ||
| inire | ||
| scripts | ||
| .gitignore | ||
| .python-version | ||
| DOCS.md | ||
| LICENSE.md | ||
| pyproject.toml | ||
| README.md | ||
| uv.lock | ||
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
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
Examples and development
- Runnable examples cover clearance, locked waveguides, custom bends, and partial routes.
- Architecture describes planner selection, detailed search, and verification.
- Routing benchmarks explain the corpus, profiles, and measured coverage.
- Diagnostics 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
License
GNU Affero General Public License v3. License text