<jupyter_start><jupyter_text>Route electrical ports<jupyter_code>import pp

mzi = pp.c.mzi2x2(with_elec_connections=True)
mzi
pp.c.pad_array?
import pp
from pp.routing.connect import connect_elec_waypoints

c = pp.Component("mzi_with_pads_sample")
pads = pp.c.pad_array(n=3, port_list=["S"])
p = c << pads
mzir = c << mzi
p.move((-150, 300))

routes = pp.routing.connect_bundle(
    p.ports,
    mzir.get_ports_list(port_type='dc'),
    route_filter=connect_elec_waypoints,
    bend_radius=10,
)
c.add(routes)
c
mzir.get_ports_list?
import pp

c = pp.c.mzi2x2(with_elec_connections=True)
cc = pp.routing.add_electrical_pads_top(c)
cc
import pp

c = pp.c.mzi2x2(with_elec_connections=True)
cc = pp.routing.add_electrical_pads_shortest(c)
cc
import pp

c = pp.c.mzi2x2(with_elec_connections=True)
cc = pp.routing.add_electrical_pads(c, fanout_length=100)
cc
import pp

c = pp.c.cross(length=100, layer=pp.LAYER.M3, port_type="dc")
c.move((20, 50))
cc = pp.routing.add_electrical_pads_shortest(c)
cc<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13157894736842105, 'fraction_numerical': 0.02729044834307992, 'mean_word_length': 6.082758620689655, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '107751', 'license': 'MIT', 'n_tokens_mistral': 470, 'n_tokens_neox': 460, 'n_words': 69, 'path': 'notebooks/04_routing_electrical_ports.ipynb', 'repo_name': 'flaport/gdsfactory', 'size': '1026'}