Skip to content

Commit

Permalink
Merge pull request #362 from gdsfactory/add_models
Browse files Browse the repository at this point in the history
add models
  • Loading branch information
joamatab authored Mar 7, 2024
2 parents 0d19d74 + 223e198 commit f7b326f
Show file tree
Hide file tree
Showing 29 changed files with 90 additions and 32 deletions.
2 changes: 1 addition & 1 deletion docs/notebooks/12_sim_plugins_tidy3d.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "01c019da",
"id": "c4c38679",
"metadata": {},
"outputs": [],
"source": []
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ classifiers = [
"Operating System :: OS Independent"
]
dependencies = [
"gdsfactory==7.17.0",
"gplugins[tidy3d,sax,schematic]>=0.10,<0.11"
"gdsfactory==7.18.0",
"gplugins[tidy3d,sax,schematic]>=0.10.2,<0.11"
]
description = "ubcpdk pdk"
keywords = ["python"]
Expand Down
Binary file modified tests/ref/add_fiber_array_add_fiber_array_add_fiber_array.gds
Binary file not shown.
Binary file modified tests/ref/add_fiber_array_pads_rf.gds
Binary file not shown.
Binary file added tests/ref/mzi_mzi_0e264d4b.gds
Binary file not shown.
Binary file added tests/ref/mzi_mzi_5a8609eb.gds
Binary file not shown.
Binary file not shown.
Binary file added tests/ref/ring_double_ring_double_b0e5609f.gds
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added tests/ref/ring_single_ring_single_f7a07c6e.gds
Binary file not shown.
Binary file added tests/ref/straight_straight_af6b139c.gds
Binary file not shown.
5 changes: 3 additions & 2 deletions tests/test_components/test_pdk_settings_add_fiber_array_.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ settings:
settings:
cross_section: xs_sc
post_process:
function: add_padding
- function: add_padding
module: gdsfactory.add_padding
settings:
bottom: 0.5
Expand All @@ -32,6 +32,7 @@ settings:
function: get_input_labels
grating_coupler:
function: gc_te1550
info: null
layer_label:
- 10
- 0
Expand All @@ -43,7 +44,7 @@ settings:
settings:
cross_section: xs_sc
post_process:
function: add_padding
- function: add_padding
module: gdsfactory.add_padding
settings:
bottom: 0.5
Expand Down
1 change: 1 addition & 0 deletions tests/test_components/test_pdk_settings_add_pads_dc_.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ settings:
bend:
function: wire_corner
cross_section: xs_metal_routing
info: null
pad_array:
function: pad_array
module: gdsfactory.components.pad
Expand Down
1 change: 1 addition & 0 deletions tests/test_components/test_pdk_settings_add_pads_rf_.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ name: ring_single_heater_add_electrical_pads_top_cc2475fe
settings:
component: ring_single_heater
direction: top
info: null
layer: MTOP
pad_array:
function: pad_array
Expand Down
3 changes: 2 additions & 1 deletion tests/test_components/test_pdk_settings_dbr_cavity_te_.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ settings:
function: get_input_labels
grating_coupler:
function: gc_te1550
info: null
layer_label:
- 10
- 0
Expand All @@ -67,7 +68,7 @@ settings:
settings:
cross_section: xs_sc
post_process:
function: add_padding
- function: add_padding
module: gdsfactory.add_padding
settings:
bottom: 0.5
Expand Down
5 changes: 3 additions & 2 deletions tests/test_components/test_pdk_settings_mzi_.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function: mzi
info: {}
module: gdsfactory.components.mzi
name: mzi_0f25a097
name: mzi_0e264d4b
settings:
add_electrical_ports_bot: true
add_optical_ports_arms: false
Expand All @@ -13,6 +13,7 @@ settings:
cross_section_x_top: null
delta_length: 10.0
extend_ports_straight_x: null
info: null
length_x: 0.1
length_y: 2.0
mirror_bot: false
Expand All @@ -30,7 +31,7 @@ settings:
settings:
cross_section: xs_sc
post_process:
function: add_padding
- function: add_padding
module: gdsfactory.add_padding
settings:
bottom: 0.5
Expand Down
5 changes: 3 additions & 2 deletions tests/test_components/test_pdk_settings_mzi_heater_.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function: mzi
info: {}
module: gdsfactory.components.mzi
name: mzi_a3e473ed
name: mzi_5a8609eb
settings:
add_electrical_ports_bot: true
add_optical_ports_arms: false
Expand All @@ -13,6 +13,7 @@ settings:
cross_section_x_top: null
delta_length: 10.0
extend_ports_straight_x: null
info: null
length_x: 200
length_y: 2.0
mirror_bot: false
Expand All @@ -30,7 +31,7 @@ settings:
settings:
cross_section: xs_sc
post_process:
function: add_padding
- function: add_padding
module: gdsfactory.add_padding
settings:
bottom: 0.5
Expand Down
1 change: 1 addition & 0 deletions tests/test_components/test_pdk_settings_pad_.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ settings:
- 0
bbox_offsets:
- -1.8
info: null
layer:
- 12
- 0
Expand Down
1 change: 1 addition & 0 deletions tests/test_components/test_pdk_settings_pad_array_.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module: gdsfactory.components.pad
name: pad_array_2e24007e
settings:
columns: 6
info: null
orientation: 270
pad:
function: pad
Expand Down
4 changes: 2 additions & 2 deletions tests/test_components/test_pdk_settings_ring_double_.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function: ring_double
info: {}
module: gdsfactory.components.ring_double
name: ring_double_23a77142
name: ring_double_b0e5609f
settings:
bend:
function: bend_euler
Expand Down Expand Up @@ -88,7 +88,7 @@ settings:
settings:
cross_section: xs_sc
post_process:
function: add_padding
- function: add_padding
module: gdsfactory.add_padding
settings:
bottom: 0.5
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function: ring_double_heater
info: {}
module: gdsfactory.components.ring_double_heater
name: ring_double_heater_084a38b9
name: ring_double_heater_30105b49
settings:
bend:
function: bend_euler
Expand Down Expand Up @@ -92,7 +92,7 @@ settings:
settings:
cross_section: xs_sc
post_process:
function: add_padding
- function: add_padding
module: gdsfactory.add_padding
settings:
bottom: 0.5
Expand Down
4 changes: 2 additions & 2 deletions tests/test_components/test_pdk_settings_ring_single_.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function: ring_single
info: {}
module: gdsfactory.components.ring_single
name: ring_single_a02af6db
name: ring_single_f7a07c6e
settings:
bend:
function: bend_euler_sc
Expand Down Expand Up @@ -90,7 +90,7 @@ settings:
settings:
cross_section: xs_sc
post_process:
function: add_padding
- function: add_padding
module: gdsfactory.add_padding
settings:
bottom: 0.5
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function: ring_single_heater
info: {}
module: gdsfactory.components.ring_single_heater
name: ring_single_heater_203d59fa
name: ring_single_heater_2c28c6d4
settings:
bend:
function: bend_euler
Expand Down Expand Up @@ -91,7 +91,7 @@ settings:
settings:
cross_section: xs_sc
post_process:
function: add_padding
- function: add_padding
module: gdsfactory.add_padding
settings:
bottom: 0.5
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function: ring_single_dut
info: {}
module: gdsfactory.components.ring_single_dut
name: ring_single_dut_eae863cb
name: ring_single_dut_ec96572d
settings:
bend:
function: bend_euler_sc
Expand Down Expand Up @@ -58,7 +58,7 @@ settings:
settings:
cross_section: xs_sc
post_process:
function: add_padding
- function: add_padding
module: gdsfactory.add_padding
settings:
bottom: 0.5
Expand Down
4 changes: 2 additions & 2 deletions tests/test_components/test_pdk_settings_straight_.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ info:
route_info_xs_sc_length: 10.0
width: 0.5
module: gdsfactory.components.straight
name: straight_901ddba2
name: straight_af6b139c
settings:
cross_section: xs_sc
info: null
length: 10.0
npoints: 2
post_process:
function: add_padding
- function: add_padding
module: gdsfactory.add_padding
settings:
bottom: 0.5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module: gdsfactory.components.via_stack
name: via_stack_627f28a4
settings:
correct_size: true
info: null
layer_offsets: null
layer_port: null
layers:
Expand Down
18 changes: 8 additions & 10 deletions ubcpdk/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
Label,
LayerSpec,
List,
Metadata,
Optional,
Port,
Tuple,
Expand Down Expand Up @@ -42,7 +43,7 @@ def bend_euler_sc(**kwargs) -> Component:
straight = partial(
gf.components.straight,
cross_section="xs_sc",
post_process=tech.add_bbox_siepic_top_bot,
post_process=(tech.add_bbox_siepic_top_bot,),
)
bend_s = partial(
gf.components.bend_s,
Expand All @@ -63,12 +64,6 @@ def bend_euler_sc(**kwargs) -> Component:
prefix_te1550 = prefix_tm1550 = prefix_te1310 = prefix_tm1130 = "o2"


# @gf.cell
# def Packaging_FibreArray_8ch() -> gf.Component:
# """Return Packaging_FibreArray_8ch fixed cell."""
# return import_gds("Packaging_FibreArray_8ch.gds")


def clean_name(name: str) -> str:
return name.replace("_", ".")

Expand Down Expand Up @@ -498,7 +493,8 @@ def add_fiber_array(
cross_section: CrossSectionSpec = "xs_sc",
layer_label: LayerSpec = LAYER.TEXT,
straight: ComponentSpec = straight,
post_process: Callable | None = None,
post_process: Callable | list[Callable] | None = None,
info: Metadata | None = None,
**kwargs,
) -> Component:
"""Returns component with grating couplers and labels on each port.
Expand All @@ -519,6 +515,7 @@ def add_fiber_array(
layer_label: for label.
straight: straight component.
post_process: function to post process the component.
info: metadata.
"""
c = gf.Component()
Expand All @@ -543,8 +540,9 @@ def add_fiber_array(
ref.rotate(-90)
c.add_ports(ref.ports)
c.copy_child_info(component)
if post_process:
c = post_process(c)

c.post_process(post_process)
c.info.update(info or {})
return c


Expand Down
51 changes: 51 additions & 0 deletions ubcpdk/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
from __future__ import annotations

from functools import partial

from gplugins.sax.models import (
attenuator,
bend,
coupler,
grating_coupler,
mmi1x2,
mmi2x2,
phase_shifter,
)
from gplugins.sax.models import straight as _straight

nm = 1e-3


straight = partial(_straight, wl0=1.55, neff=2.4, ng=4.2)
bend_euler = partial(bend, loss=0.03)

gc_te1550 = partial(grating_coupler, loss=6, bandwidth=35 * nm, wl0=1.55)
gc_te1550_broadband = partial(grating_coupler, loss=6, bandwidth=50 * nm, wl0=1.55)
gc_tm1550 = partial(grating_coupler, loss=6, bandwidth=35 * nm, wl0=1.55)

gc_te1310_broadband = partial(grating_coupler, loss=6, bandwidth=50 * nm, wl0=1.31)
gc_te1310 = partial(grating_coupler, loss=6, bandwidth=35 * nm, wl0=1.31)


models = dict(
attenuator=attenuator,
bend_euler=bend,
coupler=coupler,
mmi1x2=mmi1x2,
mmi2x2=mmi2x2,
phase_shifter=phase_shifter,
straight=straight,
taper=straight,
gc_te1550=gc_te1550,
gc_te1550_broadband=gc_te1550_broadband,
gc_tm1550=gc_tm1550,
gc_te1310_broadband=gc_te1310_broadband,
gc_te1310=gc_te1310,
)


if __name__ == "__main__":
import gplugins.sax as gs

gs.plot_model(grating_coupler)
# gs.plot_model(coupler)

0 comments on commit f7b326f

Please sign in to comment.