gdsfactory / kfactory

gdsfactory with a klayout backend
https://gdsfactory.github.io/kfactory/
MIT License
31 stars 12 forks source link

Create protocols for routing functions and other places where necessary #277

Closed sebastian-goeldi closed 6 months ago

sebastian-goeldi commented 6 months ago
class StraightFactory(Protocol):
    def __call__(self, *, length: int, width: int) -> kf.KCell: ...

class RouteFunction(Protocol):
    def __call__(
        self,
        port1: kf.Port | kf.kdb.Trans,
        port2: kf.Port | kf.kdb.Trans,
        bend90_radius: int,
        bend180_radius: int,
        start_straight: int,
        end_straight: int,
    ) -> list[kf.kdb.Point]: ...