Skip to content

Commit

Permalink
remove taper cell
Browse files Browse the repository at this point in the history
  • Loading branch information
joamatab committed Sep 30, 2024
1 parent bc42bc9 commit 4a00e46
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 58 deletions.
6 changes: 0 additions & 6 deletions gdsfactory/components/grating_coupler_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def loss_deembedding_ch13_24(
gc_ports[0],
gc_ports[2],
start_straight_length=40.0,
taper=None,
cross_section=cross_section,
**kwargs,
)
Expand Down Expand Up @@ -121,7 +120,6 @@ def loss_deembedding_ch12_34(
gc_ports[0],
gc_ports[1],
start_straight_length=40.0,
taper=None,
cross_section=cross_section,
**kwargs,
)
Expand All @@ -130,7 +128,6 @@ def loss_deembedding_ch12_34(
gc_ports[2],
gc_ports[3],
start_straight_length=40.0,
taper=None,
cross_section=cross_section,
**kwargs,
)
Expand Down Expand Up @@ -178,7 +175,6 @@ def loss_deembedding_ch14_23(
gc_ports[0],
gc_ports[3],
start_straight_length=40.0,
taper=None,
cross_section=cross_section,
**kwargs,
)
Expand All @@ -187,7 +183,6 @@ def loss_deembedding_ch14_23(
gc_ports[1],
gc_ports[2],
start_straight_length=30.0,
taper=None,
cross_section=cross_section,
**kwargs,
)
Expand Down Expand Up @@ -233,7 +228,6 @@ def grating_coupler_loss_fiber_array(
gc_ports[0],
gc_ports[1],
start_straight_length=40.0,
taper=None,
cross_section=cross_section,
**kwargs,
)
Expand Down
1 change: 0 additions & 1 deletion gdsfactory/components/grating_coupler_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def grating_coupler_tree(
grating_coupler=grating_coupler,
fanout_length=fanout_length,
bend=bend,
taper=None,
**kwargs,
)

Expand Down
2 changes: 1 addition & 1 deletion gdsfactory/generic_tech/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def get_generic_pdk() -> Pdk:
cells.update(containers)

layer_transitions = {
LAYER.WG: partial(gf.c.taper, cross_section="rib", length=20),
LAYER.WG: partial(gf.c.taper, cross_section="strip", length=10),
(LAYER.WG, LAYER.WGN): "taper_sc_nc",
LAYER.M3: "taper_electrical",
}
Expand Down
3 changes: 0 additions & 3 deletions gdsfactory/routing/add_fiber_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def add_fiber_array(
gc_port_name: str = "o1",
select_ports: Callable = select_ports_optical,
cross_section: CrossSectionSpec = "strip",
taper: ComponentSpec | None = None,
**kwargs,
) -> Component:
"""Returns component with south routes and grating_couplers.
Expand All @@ -34,7 +33,6 @@ def add_fiber_array(
gc_port_name: grating coupler input port name.
select_ports: function to select ports.
cross_section: cross_section function.
taper: taper spec.
kwargs: additional arguments.
Keyword Args:
Expand Down Expand Up @@ -120,7 +118,6 @@ def add_fiber_array(
gc_port_name=gc_port_name,
cross_section=cross_section,
select_ports=select_ports,
taper=taper,
**kwargs,
)

Expand Down
4 changes: 0 additions & 4 deletions gdsfactory/routing/add_pads.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def add_pads_bot(
straight_separation: float = 15.0,
pad_spacing: float | str = "pad_spacing",
optical_routing_type: int | None = 1,
taper: ComponentSpec | None = None,
port_type: str = "electrical",
allow_width_mismatch: bool = True,
fanout_length: float | None = 80,
Expand All @@ -49,7 +48,6 @@ def add_pads_bot(
straight_separation: from wire edge to edge. Defaults to xs.width+xs.gap
pad_spacing: in um. Defaults to pad_spacing constant from the PDK.
optical_routing_type: None: auto, 0: no extension, 1: standard, 2: check.
taper: taper spec.
port_type: port type.
allow_width_mismatch: True
fanout_length: if None, automatic calculation of fanout length.
Expand Down Expand Up @@ -130,7 +128,6 @@ def add_pads_bot(
port_names=port_names,
fiber_spacing=pad_spacing,
optical_routing_type=optical_routing_type,
taper=taper,
port_type=port_type,
gc_port_name_fiber=pad_port_name,
allow_width_mismatch=allow_width_mismatch,
Expand Down Expand Up @@ -164,7 +161,6 @@ def add_pads_top(
bend: bend spec.
straight_separation: from edge to edge.
straight: straight spec.
taper: taper spec.
get_input_label_text_loopback_function: function to get input label test.
get_input_label_text_function: for labels.
fanout_length: if None, automatic calculation of fanout length.
Expand Down
17 changes: 5 additions & 12 deletions gdsfactory/routing/route_fiber_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from gdsfactory.components.bend_euler import bend_euler
from gdsfactory.components.grating_coupler_elliptical_trenches import grating_coupler_te
from gdsfactory.components.straight import straight as straight_function
from gdsfactory.components.taper import taper as taper_function
from gdsfactory.cross_section import strip
from gdsfactory.port import select_ports_optical
from gdsfactory.routing.route_bundle import get_min_spacing, route_bundle
Expand All @@ -33,7 +32,6 @@ def route_fiber_array(
grating_coupler: ComponentSpecOrList = grating_coupler_te,
bend: ComponentSpec = bend_euler,
straight: ComponentSpec = straight_function,
taper: ComponentSpec | None = taper_function,
fanout_length: float | None = None,
max_y0_optical: None = None,
with_loopback: bool = True,
Expand Down Expand Up @@ -69,7 +67,6 @@ def route_fiber_array(
grating_coupler: grating coupler instance, function or list of functions.
bend: for bends.
straight: straight.
taper: taper.
fanout_length: target distance between gratings and the southmost component port.
If None, automatically calculated.
max_y0_optical: Maximum y coordinate at which the intermediate optical ports can be set.
Expand Down Expand Up @@ -267,7 +264,6 @@ def has_p(side) -> bool:
gc_port_name=gc_port_name,
bend=bend90,
straight=straight,
taper=taper,
select_ports=select_ports,
port_names=port_names,
cross_section=cross_section,
Expand Down Expand Up @@ -337,7 +333,6 @@ def has_p(side) -> bool:
port_type=port_type,
sort_ports=True,
allow_width_mismatch=allow_width_mismatch,
taper=taper,
route_width=route_width,
)
if with_fiber_port:
Expand All @@ -364,7 +359,6 @@ def has_p(side) -> bool:
port_type=port_type,
sort_ports=True,
allow_width_mismatch=allow_width_mismatch,
taper=taper,
route_width=route_width,
)
del to_route[n0 - dn : n0 + dn]
Expand Down Expand Up @@ -424,7 +418,6 @@ def has_p(side) -> bool:
straight=straight,
bend=bend90,
cross_section=cross_section,
taper=taper,
)
if with_fiber_port:
port0 = gca1[gc_port_name_fiber]
Expand Down Expand Up @@ -456,16 +449,16 @@ def demo() -> None:
if __name__ == "__main__":

@gf.cell
def mzi_with_bend(radius=10):
def mzi_with_bend(radius=10, **kwargs):
c = gf.Component()
bend = c.add_ref(gf.components.bend_euler(radius=radius))
mzi = c.add_ref(gf.components.mzi())
bend = c.add_ref(gf.components.bend_euler(radius=radius, **kwargs))
mzi = c.add_ref(gf.components.mzi(**kwargs))
bend.connect("o1", mzi.ports["o2"])
c.add_port(name="o1", port=mzi.ports["o1"])
c.add_port(name="o2", port=bend.ports["o2"])
return c

gc = gf.components.grating_coupler_elliptical_te(taper_length=30)
gc = gf.components.grating_coupler_elliptical_te(taper_length=10)

# component = gf.components.nxn(north=10, south=10, east=10, west=10)
# component = gf.components.straight()
Expand All @@ -476,7 +469,7 @@ def mzi_with_bend(radius=10):
# component = gf.components.mzi_phase_shifter()

c = gf.Component()
ref = c << mzi_with_bend()
ref = c << gf.c.straight(width=2, length=10)
routes = route_fiber_array(
c,
ref,
Expand Down
5 changes: 0 additions & 5 deletions gdsfactory/routing/route_single.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def route_single(
port2: Port,
bend: ComponentSpec = bend_euler,
straight: ComponentSpec = straight_function,
taper: ComponentSpec | None = None,
start_straight_length: float = 0.0,
end_straight_length: float = 0.0,
cross_section: CrossSectionSpec | MultiCrossSectionAngleSpec = "strip",
Expand All @@ -75,7 +74,6 @@ def route_single(
port2: end port.
bend: bend spec.
straight: straight spec.
taper: taper spec.
start_straight_length: length of starting straight.
end_straight_length: length of end straight.
cross_section: spec.
Expand Down Expand Up @@ -110,7 +108,6 @@ def route_single(
radius = radius or xs.radius
width_dbu = width / component.kcl.dbu

taper_cell = gf.get_component(taper, cross_section=cross_section) if taper else None
bend90 = gf.get_component(
bend, cross_section=cross_section, radius=radius, width=width
)
Expand Down Expand Up @@ -148,7 +145,6 @@ def straight_dbu(
p2=p2,
straight_factory=straight_dbu,
bend90_cell=bend90,
taper_cell=taper_cell,
pts=waypoints,
port_type=port_type,
allow_width_mismatch=allow_width_mismatch,
Expand All @@ -162,7 +158,6 @@ def straight_dbu(
p2=p2,
straight_factory=straight_dbu,
bend90_cell=bend90,
taper_cell=taper_cell,
start_straight=start_straight,
end_straight=end_straight,
port_type=port_type,
Expand Down
23 changes: 1 addition & 22 deletions gdsfactory/routing/route_single_from_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ def route_single_from_steps(
steps: Sequence[Mapping[Literal["x", "y", "dx", "dy"], int | float]] | None = None,
bend: ComponentSpec = "bend_euler",
straight: ComponentSpec = "straight",
taper: ComponentSpec | None = "taper",
cross_section: CrossSectionSpec | MultiCrossSectionAngleSpec = "strip",
auto_widen: bool = False,
taper_length: float | None = None,
port_type: str | None = None,
allow_width_mismatch: bool = False,
auto_taper: bool = True,
Expand All @@ -49,10 +46,7 @@ def route_single_from_steps(
steps: that define the route (x, y, dx, dy) [{'dx': 5}, {'dy': 10}].
bend: function that returns bends.
straight: straight spec.
taper: taper spec.
cross_section: cross_section spec.
auto_widen: if True, tapers to wider straights.
taper_length: length of the taper if auto_widen=True.
port_type: optical or electrical.
allow_width_mismatch: if True, allows width mismatch.
auto_taper: if True, adds taper to the route.
Expand Down Expand Up @@ -120,20 +114,6 @@ def route_single_from_steps(
else:
xs = gf.get_cross_section(cross_section, **kwargs)

if auto_widen:
if taper_length is None:
raise ValueError("taper_length is required when auto_widen=True")
taper = gf.get_component(
taper,
length=taper_length,
width1=xs.width,
width2=xs.width_wide,
cross_section=cross_section,
**kwargs,
)
else:
taper = None

port_type = port_type or port1.port_type
return route_single(
component=component,
Expand All @@ -142,7 +122,6 @@ def route_single_from_steps(
waypoints=waypoints,
bend=bend,
straight=straight,
taper=taper,
cross_section=cross_section,
port_type=port_type,
allow_width_mismatch=allow_width_mismatch,
Expand All @@ -163,7 +142,7 @@ def route_single_from_steps(
w = gf.components.straight()
left = c << w
right = c << w
right.dmove((100, 80))
right.dmove((500, 80))

obstacle = gf.components.rectangle(size=(100, 10), port_type=None)
obstacle1 = c << obstacle
Expand Down
4 changes: 0 additions & 4 deletions gdsfactory/routing/route_south.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from gdsfactory.component import Component, ComponentReference
from gdsfactory.components.bend_euler import bend_euler
from gdsfactory.components.straight import straight as straight_function
from gdsfactory.components.taper import taper as taper_function
from gdsfactory.cross_section import strip
from gdsfactory.port import Port, select_ports_optical
from gdsfactory.routing.route_single import route_single
Expand All @@ -27,7 +26,6 @@ def route_south(
gc_port_name: str = "o1",
bend: ComponentSpec = bend_euler,
straight: ComponentSpec = straight_function,
taper: ComponentSpec | None = taper_function,
select_ports: Callable = select_ports_optical,
port_names: Strs | None = None,
cross_section: CrossSectionSpec = strip,
Expand All @@ -51,7 +49,6 @@ def route_south(
gc_port_name: grating coupler port name. Used only if io_gratings_lines is supplied.
bend: spec.
straight: spec.
taper: spec.
select_ports: function to select_ports.
port_names: optional port names. Overrides select_ports.
cross_section: cross_section spec.
Expand Down Expand Up @@ -110,7 +107,6 @@ def route_south(
conn_params = dict(
bend=bend,
straight=straight,
taper=taper,
cross_section=cross_section,
port_type=port_type,
allow_width_mismatch=allow_width_mismatch,
Expand Down

0 comments on commit 4a00e46

Please sign in to comment.