Skip to article frontmatterSkip to article content

gdsfactory.routing.add_electrical_pads_top

gdsfactory.routing.add_electrical_pads_top(component: str | ~collections.abc.Callable[[...], ~gdsfactory.component.Component] | dict[str, ~typing.Any] | ~kfactory.kcell.DKCell, direction: ~typing.Literal['top', 'right'] = 'top', spacing: tuple[float, float] = (0.0, 100.0), pad_array: str | ~collections.abc.Callable[[...], ~gdsfactory.component.Component] | dict[str, ~typing.Any] | ~kfactory.kcell.DKCell = 'pad_array', select_ports: ~collections.abc.Callable[[...], ~collections.abc.Sequence[~kfactory.port.DPort]] = functools.partial(<function select_ports>, port_type='electrical'), port_names: ~collections.abc.Sequence[str] | None = None, layer: tuple[int, int] | str | int | ~kfactory.layer.LayerEnum = 'MTOP', **kwargs: ~typing.Any)Component

Returns new component with electrical ports connected to top pad array.

Parameters
  • componentto route.

  • directionsets direction of the array (top or right).

  • spacingcomponent to pad spacing.

  • pad_arrayfunction for pad_array.

  • select_portsfunction to select electrical ports.

  • port_namesoptional port names. Overrides select_ports.

  • layerfor the routes.

  • kwargsadditional arguments.

Keyword Arguments
  • portsDict[str, Port] a port dict {port name: port}.

  • prefixselect ports with port name prefix.

  • suffixselect ports with port name suffix.

  • orientationselect ports with orientation in degrees.

  • widthselect ports with port width.

  • layers_excludedList of layers to exclude.

  • port_typeselect ports with port type (optical, electrical, vertical_te).

  • clockwiseif True, sort ports clockwise, False: counter-clockwise.

import gdsfactory as gf

c = gf.components.wire_straight(length=200.)
cc = gf.routing.add_electrical_pads_top(component=c, spacing=(-150, 30))
cc.plot()