Skip to content

Commit

Permalink
Merge pull request #26 from gdsfactory/153
Browse files Browse the repository at this point in the history
fix tests
  • Loading branch information
joamatab authored Apr 27, 2022
2 parents 5d0decc + 4efc6fb commit 469b984
Show file tree
Hide file tree
Showing 36 changed files with 500 additions and 253 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [1.5.3]

- [PR](https://github.com/gdsfactory/ubc/pull/24) replaced bbox with Section in strip cross_section
- [PR](https://github.com/gdsfactory/ubc/pull/25) assumes that the imported gds file is already siepic-compatible and adds ports where it finds siepic pins.

## [1.5.2](https://github.com/gdsfactory/ubc/pull/23)

- compatible with gdsfactory 5.2.0
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-e .
lygadgets
gdsfactory[full]==5.2.0
gdsfactory[full]==5.2.4
modes
45 changes: 45 additions & 0 deletions ubcpdk/circuits/mzi_pads.pic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: sample_different_factory

instances:
tl:
component: pad
tr:
component: pad

mzi:
component: mzi_phase_shifter_top_heater_metal

placements:
mzi:
ymax: tl,south
dy: -100
tl:
x: mzi,west
y: mzi,north
dy: 100
tr:
x: mzi,west
dx: 200
y: mzi,north
dy: 100

routes:
electrical1:
routing_strategy: get_bundle
settings:
separation: 20
layer: [31, 0]
width: 10

links:
mzi,e2: tr,e1

electrical2:
routing_strategy: get_bundle
settings:
separation: 20
layer: [31, 0]
width: 10

links:
mzi,e1: tl,e1
6 changes: 3 additions & 3 deletions ubcpdk/circuits/pads.pic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ instances:

placements:
tl:
x: 0
y: 200
x: 100
y: 290

br:
x: 400
Expand All @@ -29,7 +29,7 @@ routes:
settings:
separation: 20
layer: [31, 0]
width: 10
width: 5
links:
tl,e3: tr,e1
bl,e3: br,e1
Expand Down
44 changes: 20 additions & 24 deletions ubcpdk/components/cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ def y_splitter() -> Component:
um = 1e-6

add_siepic_labels = gf.partial(
add_siepic_labels,
label_layer=LAYER.DEVREC,
library="Design Kits/ebeam"
)
add_siepic_labels, label_layer=LAYER.DEVREC, library="Design Kits/ebeam"
)

straight_ubc = gf.partial(gf.components.straight, cross_section="strip")
bend_euler_ubc = gf.partial(gf.components.bend_euler, cross_section="strip")
Expand Down Expand Up @@ -72,8 +70,8 @@ def y_splitter() -> Component:
layout_model_port_pairs=(
("opt1", "opt_a1"),
("opt2", "opt_b1"),
("opt3", "opt_b2")
)
("opt3", "opt_b2"),
),
)
crossing = gf.partial(
import_gds,
Expand All @@ -91,7 +89,7 @@ def y_splitter() -> Component:
port_e0_splitter="opt3",
port_e1_combiner="opt2",
port_e0_combiner="opt3",
cross_section="strip"
cross_section="strip",
)


Expand All @@ -102,7 +100,7 @@ def ebeam_dc_halfring_straight(
length_x: float = 4.0,
cross_section="strip",
siepic: bool = True,
model: str = 'ebeam_dc_halfring_straight',
model: str = "ebeam_dc_halfring_straight",
**kwargs
):
c = gf.Component()
Expand All @@ -126,22 +124,22 @@ def ebeam_dc_halfring_straight(
("o2", "port 2"),
("o3", "port 4"),
("o4", "port 3"),
),
),
properties={
"gap": gap * um,
"radius": radius * um,
"wg_thickness": thickness[LAYER.WG] * um,
"wg_width": x.width * um,
"Lc": length_x * um,
},
component_type=["optical"]
)
},
component_type=["optical"],
)

add_siepic_info = gf.compose(
gf.partial(add_siepic_labels, model=model),
add_pins_bbox_siepic,
remove_pins_recursive,
)
)
c = add_siepic_info(c)
return c

Expand All @@ -152,23 +150,19 @@ def ebeam_dc_halfring_straight(
remove_pins_recursive,
gf.partial(
gf.components.coupler,
component_type=['optical'],
layout_model_property_pairs=(
("length", "coupling_length")
),
properites=(
('annotate', False)
)
)
)
# component_type=["optical"],
# layout_model_property_pairs=(("length", "coupling_length")),
# properites=(("annotate", False)),
),
)
spiral = gf.partial(gf.components.spiral_external_io)
ring_with_crossing = gf.partial(
gf.components.ring_single_dut,
component=crossing,
port_name="opt4",
bend=bend_euler,
straight=straight,
cross_section=strip
cross_section=strip,
)


Expand All @@ -189,7 +183,7 @@ def ebeam_dc_halfring_straight(
# c = y_splitter()
# s = dc_adiabatic()

c = mzi()
# c = mzi()

# c = gf.Component()
# s = y_splitter()
Expand All @@ -199,4 +193,6 @@ def ebeam_dc_halfring_straight(

# c = ebeam_dc_halfring_straight()
# c = ring_with_crossing()

c = ebeam_dc_te1550()
c.show(show_ports=False)
9 changes: 6 additions & 3 deletions ubcpdk/components/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
gf.components.bend_euler,
cross_section="strip",
)
coupler = gf.partial(gf.components.coupler, decorator=add_pins_bbox_siepic)
coupler = gf.partial(
gf.components.coupler, decorator=add_pins_bbox_siepic, cross_section="strip"
)
coupler_ring = gf.partial(gf.components.coupler_ring, cross_section="strip")

ring_single = gf.partial(
Expand All @@ -22,6 +24,7 @@

if __name__ == "__main__":
# c = coupler_ring()
c = ring_single()
# c = ring_single()
# c = bend_with_pins()
c.show()
c = coupler()
c.show(show_ports=False)
20 changes: 5 additions & 15 deletions ubcpdk/components/grating_couplers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import gdsfactory as gf
from ubcpdk.import_gds import (
import_gds
)
from ubcpdk.import_gds import import_gds


import_gc = gf.compose(
Expand All @@ -17,9 +15,7 @@
wavelength=1.55,
model="ebeam_gc_te1550",
name="ebeam_gc_te1550",
layout_model_port_pairs=(
("opt1", "opt_wg"),
)
layout_model_port_pairs=(("opt1", "opt_wg"),),
)

gc_te1550_broadband = gf.partial(
Expand All @@ -29,9 +25,7 @@
model="ebeam_gc_te1550_broadband",
polarization="te",
wavelength=1.55,
layout_model_port_pairs=(
("opt1", "opt_wg"),
)
layout_model_port_pairs=(("opt1", "opt_wg"),),
)


Expand All @@ -42,9 +36,7 @@
model="ebeam_gc_te1310",
polarization="te",
wavelength=1.31,
layout_model_port_pairs=(
("opt1", "opt_wg"),
)
layout_model_port_pairs=(("opt1", "opt_wg"),),
)

gc_tm1550 = gf.partial(
Expand All @@ -54,9 +46,7 @@
model="ebeam_gc_tm1550",
polarization="tm",
wavelength=1.55,
layout_model_port_pairs=(
("opt1", "opt_wg"),
)
layout_model_port_pairs=(("opt1", "opt_wg"),),
)


Expand Down
4 changes: 2 additions & 2 deletions ubcpdk/import_gds.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ def add_siepic_labels_and_simulation_info(
gf.import_gds,
gdsdir=PATH.gds,
library="Design kits/ebeam",
decorator=add_ports_from_siepic_pins
)
decorator=add_ports_from_siepic_pins,
)
#
# gratings have a 2nm square that is sticking out 1nm
# add_pins_gratings = gf.partial(add_pins_bbox_siepic, padding=-1e-3)
Expand Down
23 changes: 9 additions & 14 deletions ubcpdk/tech.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,14 @@ class Tech(BaseModel):
library="Design kits/ebeam",
layout_model_property_pairs=(
# (layout_property_name, interconnect_property_name)
('length', 'wg_length', 1e-6),
('width', 'wg_width', 1e-6),
),
layout_model_port_pairs=(
("o1", "port 1"),
("o2", "port 2")
),
("length", "wg_length", 1e-6),
("width", "wg_width", 1e-6),
),
layout_model_port_pairs=(("o1", "port 1"), ("o2", "port 2")),
spice_params=["wg_length", "wg_width"],
component_type=['optical'],
properties=(
('annotate', False),
)
)
component_type=["optical"],
properties=(("annotate", False),),
)

get_sparameters_data_lumerical = gf.partial(
sim.get_sparameters_data_lumerical,
Expand All @@ -128,8 +123,7 @@ class Tech(BaseModel):
siepic_devrec_section = Section(
width=TECH.DEVREC["width"],
layer=LAYER.DEVREC,
name="DEVREC"
)
)

strip_pins = gf.partial(
gf.cross_section.strip,
Expand Down Expand Up @@ -160,3 +154,4 @@ class Tech(BaseModel):

if __name__ == "__main__":
c = gf.c.straight(cross_section=strip)
c.show(show_ports=False)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified ubcpdk/tests/test_components.gds/gds_ref/rotate_f258530e.gds
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 469b984

Please sign in to comment.