From d8ab7b2faa6e54453ef1d32083aa4247efc77947 Mon Sep 17 00:00:00 2001 From: Joaquin Matres <4514346+joamatab@users.noreply.github.com> Date: Fri, 27 Sep 2024 16:08:05 +0200 Subject: [PATCH] fix sample routing functions --- cspdk/si220/samples/get_route_sc.py | 2 +- cspdk/si220/tech.py | 151 +++++++++++++------------ cspdk/si500/samples/get_route_rc500.py | 2 +- cspdk/sin300/samples/get_route_nc.py | 2 +- pyproject.toml | 2 +- 5 files changed, 85 insertions(+), 74 deletions(-) diff --git a/cspdk/si220/samples/get_route_sc.py b/cspdk/si220/samples/get_route_sc.py index 3fce58e..a45a1b5 100644 --- a/cspdk/si220/samples/get_route_sc.py +++ b/cspdk/si220/samples/get_route_sc.py @@ -11,8 +11,8 @@ mmi2.dmove((500, 50)) route = tech.route_single_sc( + c, mmi1.ports["o3"], mmi2.ports["o1"], ) - c.add(route.references) c.show() diff --git a/cspdk/si220/tech.py b/cspdk/si220/tech.py index 90794fa..b6995c1 100644 --- a/cspdk/si220/tech.py +++ b/cspdk/si220/tech.py @@ -384,79 +384,90 @@ def route_bundle( ) +route_single_sc = partial( + route_single, + straight="straight_sc", + bend="bend_euler_sc", + taper="taper_sc", + cross_section="xs_sc", +) +route_single_so = partial( + route_single, + straight="straight_so", + bend="bend_euler_so", + taper="taper_so", + cross_section="xs_so", +) +route_single_rc = partial( + route_single, + straight="straight_rc", + bend="bend_euler_rc", + taper="taper_rc", + cross_section="xs_rc", +) +route_single_ro = partial( + route_single, + straight="straight_ro", + bend="bend_euler_ro", + taper="taper_ro", + cross_section="xs_ro", +) +route_bundle_sc = partial( + route_bundle, + straight="straight_sc", + bend="bend_euler_sc", + taper="taper_sc", + cross_section="xs_sc", +) +route_bundle_so = partial( + route_bundle, + straight="straight_so", + bend="bend_euler_so", + taper="taper_so", + cross_section="xs_so", +) +route_bundle_rc = partial( + route_bundle, + straight="straight_rc", + bend="bend_euler_rc", + taper="taper_rc", + cross_section="xs_rc", +) +route_bundle_ro = partial( + route_bundle, + straight="straight_ro", + bend="bend_euler_ro", + taper="taper_ro", + cross_section="xs_ro", +) +route_bundle_metal = partial( + route_bundle, + straight="straight_metal", + bend="bend_metal", + taper=None, + cross_section="metal_routing", +) +route_bundle_metal_corner = partial( + route_bundle, + straight="straight_metal", + bend="wire_corner", + taper=None, + cross_section="metal_routing", +) + routing_strategies = dict( route_single=route_single, - route_single_sc=partial( - route_single, - straight="straight_sc", - bend="bend_euler_sc", - taper="taper_sc", - cross_section="xs_sc", - ), - route_single_so=partial( - route_single, - straight="straight_so", - bend="bend_euler_so", - taper="taper_so", - cross_section="xs_so", - ), - route_single_rc=partial( - route_single, - straight="straight_rc", - bend="bend_euler_rc", - taper="taper_rc", - cross_section="xs_rc", - ), - route_single_ro=partial( - route_single, - straight="straight_ro", - bend="bend_euler_ro", - taper="taper_ro", - cross_section="xs_ro", - ), route_bundle=route_bundle, - route_bundle_sc=partial( - route_bundle, - straight="straight_sc", - bend="bend_euler_sc", - taper="taper_sc", - cross_section="xs_sc", - ), - route_bundle_so=partial( - route_bundle, - straight="straight_so", - bend="bend_euler_so", - taper="taper_so", - cross_section="xs_so", - ), - route_bundle_rc=partial( - route_bundle, - straight="straight_rc", - bend="bend_euler_rc", - taper="taper_rc", - cross_section="xs_rc", - ), - route_bundle_ro=partial( - route_bundle, - straight="straight_ro", - bend="bend_euler_ro", - taper="taper_ro", - cross_section="xs_ro", - ), - route_bundle_metal=partial( - route_bundle, - straight="straight_metal", - bend="bend_metal", - taper=None, - cross_section="metal_routing", - ), - route_bundle_metal_corner=partial( - route_bundle, - straight="straight_metal", - bend="wire_corner", - taper=None, - cross_section="metal_routing", - ), + route_single_sc=route_single_sc, + route_single_so=route_single_so, + route_single_rc=route_single_rc, + route_single_ro=route_single_ro, + route_bundle_sc=route_bundle_sc, + route_bundle_so=route_bundle_so, + route_bundle_rc=route_bundle_rc, + route_bundle_ro=route_bundle_ro, + route_bundle_metal=route_bundle_metal, + route_bundle_metal_corner=route_bundle_metal_corner, ) if __name__ == "__main__": diff --git a/cspdk/si500/samples/get_route_rc500.py b/cspdk/si500/samples/get_route_rc500.py index da02ea7..6639fb3 100644 --- a/cspdk/si500/samples/get_route_rc500.py +++ b/cspdk/si500/samples/get_route_rc500.py @@ -11,8 +11,8 @@ mmi2.dmove((500, 50)) route = tech.route_single_rc( + c, mmi1.ports["o3"], mmi2.ports["o1"], ) - c.add(route.references) c.show() diff --git a/cspdk/sin300/samples/get_route_nc.py b/cspdk/sin300/samples/get_route_nc.py index 4af634a..83ccf25 100644 --- a/cspdk/sin300/samples/get_route_nc.py +++ b/cspdk/sin300/samples/get_route_nc.py @@ -11,8 +11,8 @@ mmi2.dmove((500, 50)) route = tech.route_single_nc( + c, mmi1.ports["o3"], mmi2.ports["o1"], ) - c.add(route.references) c.show() diff --git a/pyproject.toml b/pyproject.toml index f59eaf7..5379d37 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ classifiers = [ "Operating System :: OS Independent" ] dependencies = [ - "gdsfactory~=8.8.8", + "gdsfactory~=8.8.9", "gplugins[sax]>=1,<2" ] description = "CornerStone PDK"