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)