import numpy as np
from gdshelpers.geometry.chip import Cell
from gdshelpers.parts.waveguide import Waveguide
from gdshelpers.parts.coupler import GratingCoupler

coupler_params = {
        'width': 1.3,
        'full_opening_angle': np.deg2rad(40),
        'grating_period': 1.155,
        'grating_ff': 0.85,
        'n_gratings': 20,
        'taper_length': 16.
}

gc = GratingCoupler.make_traditional_coupler(origin=(0, 0), **coupler_params)

wg = Waveguide.make_at_port(gc.port)
wg.add_bend(np.pi / 2, radius=30)

cell = Cell('CELL')
cell.add_to_layer(1, wg, gc)
cell.show()