gdsfactory / kfactory

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

better error for port non divideable by 2 #219

Closed joamatab closed 10 months ago

joamatab commented 10 months ago

import kfactory as kf 

c = kf.KCell()
# this should fail
c.create_port(name='A', width=475, center=(0, 0), layer=0, angle=0)

# this should give you a better error message
orientation = 0
center = (0, 0)
trans = kf.kdb.DCplxTrans(1, orientation, False, center[0], center[1])
c.create_port(name='B', dwidth=0.475, center=(0, 0), layer=0, dcplx_trans=trans)