inire/README.md

42 lines
2 KiB
Markdown
Raw Normal View History

# inire
2026-03-07 08:26:29 -08:00
Use Inire to connect fixed ports on a photonic or RF layout with straight segments, 90-degree bends, and S-bends. Supply the device placement, keepouts, and allowed bend radii. The router checks the finished geometry for clearance and returns partial paths to help you diagnose unfinished nets.
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
```
This example prints `200.0`, the length in the layout's coordinate unit. The branch that prints `outcome` is where you can report an unfinished or colliding net. [Interpret results and diagnose failures](DOCS.md#read-the-result)
Use a unit fine enough to preserve your port spacing on an integer grid. A heading of 0 points east. Both ports in the example have heading 0 because the waveguide travels east when it leaves the start and when it reaches the target. [Describe a layout](DOCS.md#describe-a-layout)
2026-03-30 15:32:29 -07:00
## Route your own layout
2026-03-08 14:40:36 -07:00
Place crossing devices before routing and describe their external legs as separate nets. Use the [examples](examples/README.md) to try multi-net routing, locked paths, or custom bends, and the [tuning guide](DOCS.md#tune-a-run) to decide which settings to change.
2026-03-08 14:40:36 -07:00
## Develop Inire
Run `python -m pytest` for the correctness suite. Use `python -m pytest -m "not routing_corpus"` for a shorter local run. Start with the [architecture](docs/architecture.md) to find where a change belongs, then use the [benchmark guide](docs/topological-routing.md) and [diagnostics](docs/routing-diagnostics.md) to check its effect.
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)