inire/README.md

43 lines
2.1 KiB
Markdown
Raw Normal View History

# inire
2026-03-07 08:26:29 -08:00
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.
2026-03-07 08:26:29 -08:00
## Install
2026-03-07 08:26:29 -08:00
From a checkout with Python 3.11 or newer, run `pip install .`. For development, `uv sync` also installs the test and lint tools.
2026-03-07 08:26:29 -08:00
## Route a net
2026-03-07 08:26:29 -08:00
```python
from inire import NetSpec, Port, RoutingProblem, route
2026-03-07 08:26:29 -08:00
2026-03-30 15:32:29 -07:00
problem = RoutingProblem(
bounds=(0, 0, 1000, 1000),
nets=(NetSpec("input", Port(50, 100, 0), Port(250, 100, 0), width=2),),
clearance=2,
2026-03-08 23:34:18 -07:00
)
2026-03-07 08:26:29 -08:00
run = route(problem)
result = run.results_by_net["input"]
if result.is_valid:
print(result.report.total_length)
else:
print(result.outcome)
2026-03-07 08:26:29 -08:00
```
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)
2026-03-30 15:32:29 -07:00
## Examples and development
2026-03-08 14:40:36 -07:00
- [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.
2026-03-08 14:40:36 -07:00
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)
2026-03-08 23:34:18 -07:00
2026-03-07 08:26:29 -08:00
## License
GNU Affero General Public License v3. [License text](LICENSE.md)