Skip to content

Commit

Permalink
Merge pull request #396 from gdsfactory/gdsfactory8
Browse files Browse the repository at this point in the history
Gdsfactory8
  • Loading branch information
joamatab authored Jul 15, 2024
2 parents 84d647f + 9cdcb81 commit 5ceaa2d
Show file tree
Hide file tree
Showing 243 changed files with 4,405 additions and 6,840 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ubcpdk/tests/test_components.gds/gds_diff/
.dvc/
.virtual_documents
tests/ref/*.oas
ubcpdk/gds/*.oas

# C extensions
*.so
Expand Down
56 changes: 14 additions & 42 deletions docs/notebooks/00_layout.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
"metadata": {},
"outputs": [],
"source": [
"component_fiber_array = uc.add_fiber_array(component=mzi)\n",
"component_fiber_array = uc.add_fiber_array(component=mzi, fanout_length=5)\n",
"component_fiber_array.plot()"
]
},
Expand Down Expand Up @@ -278,16 +278,11 @@
"outputs": [],
"source": [
"from functools import partial\n",
"from pathlib import Path\n",
"\n",
"import gdsfactory as gf\n",
"\n",
"import ubcpdk\n",
"import ubcpdk.components as uc\n",
"from ubcpdk import tech\n",
"from ubcpdk.tech import LAYER\n",
"\n",
"\n",
"size = (440, 470)\n",
"add_gc = uc.add_fiber_array\n",
"\n",
Expand Down Expand Up @@ -317,7 +312,6 @@
" return c\n",
"\n",
"\n",
"gf.clear_cache()\n",
"c = EBeam_JoaquinMatres_1()\n",
"c.show() # show in klayout\n",
"c.plot() # plot in notebook"
Expand All @@ -330,34 +324,14 @@
"metadata": {},
"outputs": [],
"source": [
"@gf.cell\n",
"def EBeam_JoaquinMatres_2() -> gf.Component:\n",
" \"\"\"spirals for extracting straight waveguide loss\"\"\"\n",
" N = 12\n",
" radius = 10\n",
"\n",
" e = [\n",
" uc.add_fiber_array(\n",
" component=uc.spiral(\n",
" N=N,\n",
" radius=radius,\n",
" y_straight_inner_top=0,\n",
" x_inner_length_cutback=0,\n",
" )\n",
" )\n",
" uc.add_fiber_array(component=uc.spiral(n_loops=8, length=length))\n",
" for length in [0, 100, 200]\n",
" ]\n",
"\n",
" e.append(\n",
" uc.add_fiber_array(\n",
" component=uc.spiral(\n",
" N=N,\n",
" radius=radius,\n",
" y_straight_inner_top=0,\n",
" x_inner_length_cutback=185,\n",
" )\n",
" )\n",
" )\n",
"\n",
" c = gf.Component()\n",
" _ = c << gf.pack(e, max_size=size, spacing=2)[0]\n",
" _ = c << gf.components.rectangle(size=size, layer=LAYER.FLOORPLAN)\n",
Expand All @@ -376,23 +350,20 @@
"metadata": {},
"outputs": [],
"source": [
"@gf.cell\n",
"def EBeam_JoaquinMatres_3() -> gf.Component:\n",
" \"\"\"contains mirror cavities and structures inside a resonator\"\"\"\n",
" \"\"\"Contains mirror cavities and structures inside a resonator.\"\"\"\n",
" e = []\n",
" e += [add_gc(uc.ebeam_crossing4())]\n",
" e += [add_gc(uc.ebeam_adiabatic_te1550(), optical_routing_type=1)]\n",
" e += [add_gc(uc.ebeam_bdc_te1550())]\n",
" e += [add_gc(uc.ebeam_y_1550(), optical_routing_type=1)]\n",
" e += [add_gc(uc.ebeam_y_adiabatic_tapers(), optical_routing_type=1)]\n",
" e += [add_gc(uc.straight(), component_name=f\"straight_{i}\") for i in range(2)]\n",
" c = gf.Component()\n",
" _ = c << gf.pack(e, max_size=size, spacing=2)[0]\n",
" _ = c << gf.components.rectangle(size=size, layer=LAYER.FLOORPLAN)\n",
" return c\n",
"\n",
"\n",
"gf.clear_cache()\n",
"c = EBeam_JoaquinMatres_3()\n",
"c.show() # show in klayout\n",
"c.plot() # plot in notebook"
Expand All @@ -405,12 +376,13 @@
"metadata": {},
"outputs": [],
"source": [
"@gf.cell\n",
"def EBeam_JoaquinMatres_4() -> gf.Component:\n",
" \"\"\"MZI interferometers.\"\"\"\n",
" mzi = partial(gf.components.mzi, splitter=uc.ebeam_y_1550)\n",
" mzis = [mzi(delta_length=delta_length) for delta_length in [10, 40, 100]]\n",
" mzis_gc = [uc.add_fiber_array(mzi) for mzi in mzis]\n",
" mzis_gc = [\n",
" uc.add_fiber_array(mzi, optical_routing_type=2, fanout_length=5) for mzi in mzis\n",
" ]\n",
"\n",
" mzis = [uc.mzi_heater(delta_length=delta_length) for delta_length in [40]]\n",
" mzis_heater_gc = [\n",
Expand All @@ -425,7 +397,6 @@
" return c\n",
"\n",
"\n",
"gf.clear_cache()\n",
"c = EBeam_JoaquinMatres_4()\n",
"c.show() # show in klayout\n",
"c.plot() # plot in notebook"
Expand All @@ -438,20 +409,21 @@
"metadata": {},
"outputs": [],
"source": [
"@gf.cell\n",
"def EBeam_JoaquinMatres_5() -> gf.Component:\n",
" \"\"\"Ring resonators.\"\"\"\n",
" rings = [uc.ring_single_heater(length_x=length_x) for length_x in [4, 6]]\n",
" rings = [gf.functions.rotate180(ring) for ring in rings]\n",
" rings_gc = [uc.add_fiber_array_pads_rf(ring) for ring in rings]\n",
"\n",
" rings = []\n",
" for length_x in [4, 6]:\n",
" ring = uc.ring_single_heater(length_x=length_x)\n",
" ring_gc = uc.add_fiber_array_pads_rf(ring)\n",
" rings.append(ring_gc)\n",
"\n",
" c = gf.Component()\n",
" _ = c << gf.pack(rings_gc, max_size=size, spacing=2)[0]\n",
" _ = c << gf.pack(rings, max_size=size, spacing=2)[0]\n",
" _ = c << gf.components.rectangle(size=size, layer=LAYER.FLOORPLAN)\n",
" return c\n",
"\n",
"\n",
"gf.clear_cache()\n",
"c = EBeam_JoaquinMatres_5()\n",
"c.show() # show in klayout\n",
"c.plot() # plot in notebook"
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/11_sparameters.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"id": "1",
"metadata": {},
"source": [
"Meep is open source and does not require a license. However, both tidy3d and Lumerical require licenses to use.\n",
"Meep is open source and does not require a license. However, both tidy3d and Lumerical require licenses to use.\n",
"\n",
"## Tidy3d\n",
"\n",
Expand Down Expand Up @@ -150,7 +150,7 @@
" pdk.ebeam_crossing4,\n",
"]:\n",
" component = f()\n",
" component.plot_klayout()\n",
" component.plot()\n",
" # ls.write_sparameters_lumerical(component=component)"
]
},
Expand Down
16 changes: 0 additions & 16 deletions docs/notebooks/11_sparameters_gratings.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -153,22 +153,6 @@
"source": [
"help(gt.write_sparameters_grating_coupler)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "10",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "11",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
20 changes: 2 additions & 18 deletions docs/notebooks/12_sim_plugins_tidy3d.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
"circuit, _ = sax.circuit(\n",
" netlist=netlist,\n",
" models={\n",
" \"bend_euler_sc\": bend_euler,\n",
" \"bend_euler\": bend_euler,\n",
" \"ebeam_y_1550\": ebeam_y_1550,\n",
" \"straight\": straight,\n",
" },\n",
Expand Down Expand Up @@ -208,7 +208,7 @@
"circuit, _ = sax.circuit(\n",
" netlist=netlist,\n",
" models={\n",
" \"bend_euler_sc\": bend_euler,\n",
" \"bend_euler\": bend_euler,\n",
" \"ebeam_y_1550\": ebeam_y_1550,\n",
" \"straight\": straight,\n",
" },\n",
Expand All @@ -232,22 +232,6 @@
"plt.grid(True)\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "17",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "18",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
10 changes: 2 additions & 8 deletions docs/notebooks/14_sax_tidy3d.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@
"outputs": [],
"source": [
"netlist = mzi.get_netlist()\n",
"pprint(netlist[\"connections\"])"
"pprint(netlist[\"nets\"])"
]
},
{
Expand Down Expand Up @@ -631,7 +631,7 @@
"metadata": {},
"outputs": [],
"source": [
"mzi_yaml = mzi_component.get_netlist_yaml()\n",
"mzi_yaml = mzi_component.get_netlist()\n",
"mzi_component2 = gf.read.from_yaml(mzi_yaml)\n",
"fig = mzi_component2.plot()"
]
Expand Down Expand Up @@ -830,12 +830,6 @@
"source": [
"As you can see two couplers have more broadband response"
]
},
{
"cell_type": "markdown",
"id": "53",
"metadata": {},
"source": []
}
],
"metadata": {
Expand Down
8 changes: 4 additions & 4 deletions docs/notebooks/sdl_demo.pic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ placements:
mirror: null}
routes:
r0:
routing_strategy: get_bundle
routing_strategy: route_bundle
settings: {cross_section: xs_sc, separation: 5.0}
links: {'mmi1,o2': 's1,o1'}
r1:
routing_strategy: get_bundle
routing_strategy: route_bundle
settings: {cross_section: xs_sc, separation: 5.0}
links: {'mmi2,o2': 's1,o2'}
r2:
routing_strategy: get_bundle
routing_strategy: route_bundle
settings: {cross_section: xs_sc, separation: 5.0}
links: {'mmi1,o3': 's2,o1'}
r3:
routing_strategy: get_bundle
routing_strategy: route_bundle
settings: {cross_section: xs_sc, separation: 5.0}
links: {'mmi2,o1': 's2,o2'}
ports: {o1: 'mmi1,o1', o2: 'mmi2,o3', o3: 'mmi2,o4'}
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.26.1",
"gplugins[tidy3d,sax,schematic]>=0.13,<0.14"
"gdsfactory~=8.5.1",
"gplugins[sax]>=1,<2"
]
description = "ubcpdk pdk"
keywords = ["python"]
Expand Down
Binary file added tests/ref/None_ebeam_adiabatic_te1550.gds
Binary file not shown.
Binary file added tests/ref/None_ebeam_bdc_te1550.gds
Binary file not shown.
Binary file added tests/ref/None_ebeam_bdc_tm1550.gds
Binary file not shown.
Binary file added tests/ref/None_ebeam_crossing4.gds
Binary file not shown.
Binary file added tests/ref/None_ebeam_splitter_adi_72b66ac9.gds
Binary file not shown.
Binary file added tests/ref/None_ebeam_splitter_swg_08d695ed.gds
Binary file not shown.
Binary file added tests/ref/None_ebeam_splitter_swg_3f05ce33.gds
Binary file not shown.
Binary file added tests/ref/None_ebeam_terminator_te1310.gds
Binary file not shown.
Binary file added tests/ref/None_ebeam_terminator_te1550.gds
Binary file not shown.
Binary file added tests/ref/None_ebeam_terminator_tm1550.gds
Binary file not shown.
Binary file added tests/ref/None_ebeam_y_1550.gds
Binary file not shown.
Binary file added tests/ref/None_ebeam_y_adiabatic.gds
Binary file not shown.
Binary file added tests/ref/None_ebeam_y_adiabatic_1310.gds
Binary file not shown.
Binary file added tests/ref/None_metal_via_15.gds
Binary file not shown.
Binary file added tests/ref/None_photonic_wirebond__59100ff4.gds
Binary file not shown.
Binary file added tests/ref/None_photonic_wirebond__6d291b90.gds
Binary file not shown.
Binary file added tests/ref/None_thermal_phase_shif_886aa1e0.gds
Binary file not shown.
Binary file added tests/ref/None_thermal_phase_shif_9db285ba.gds
Binary file not shown.
Binary file added tests/ref/None_thermal_phase_shif_d9d7eab0.gds
Binary file not shown.
Binary file added tests/ref/None_thermal_phase_shif_e900c7f8.gds
Binary file not shown.
Binary file added tests/ref/add_electrical_pads_top_343ee2df.gds
Binary file not shown.
Binary file added tests/ref/add_electrical_pads_top_dbc94625.gds
Binary file not shown.
Binary file added tests/ref/add_fiber_array_add_fib_2a35c688.gds
Binary file not shown.
Binary file modified tests/ref/bend_euler.gds
Binary file not shown.
Binary file added tests/ref/bend_euler_bend_euler_A180.gds
Binary file not shown.
Binary file added tests/ref/bend_euler_bend_euler_CSstrip.gds
Binary file not shown.
Binary file added tests/ref/bend_euler_bend_euler_C_31752e67.gds
Binary file not shown.
Binary file added tests/ref/bend_euler_sc_bend_euler_sc_A180.gds
Binary file not shown.
Binary file added tests/ref/bend_s_bend_s_S11_1p8_N_e639728a.gds
Binary file not shown.
Binary file modified tests/ref/coupler.gds
Binary file not shown.
Binary file added tests/ref/coupler90_coupler90_G0p_fff69144.gds
Binary file not shown.
Binary file added tests/ref/coupler_coupler_G0p236__159c01fd.gds
Binary file not shown.
Binary file added tests/ref/coupler_coupler_G0p236__e6a217ac.gds
Binary file not shown.
Binary file added tests/ref/coupler_ring_coupler_ri_a4309215.gds
Binary file not shown.
Binary file added tests/ref/coupler_straight_couple_33ca69a2.gds
Binary file not shown.
Binary file added tests/ref/dbr_cavity_dbr_cavity_D_6f81e1fa.gds
Binary file not shown.
Binary file modified tests/ref/ebeam_adiabatic_te1550.gds
Binary file not shown.
Binary file modified tests/ref/ebeam_bdc_te1550.gds
Binary file not shown.
Binary file modified tests/ref/ebeam_bdc_tm1550.gds
Binary file not shown.
Binary file modified tests/ref/ebeam_crossing4.gds
Binary file not shown.
Binary file modified tests/ref/ebeam_crossing4_2ports.gds
Binary file not shown.
Binary file added tests/ref/ebeam_dc_halfring_strai_3c40e626.gds
Binary file not shown.
Binary file added tests/ref/ebeam_splitter_adiabati_1c687ad8.gds
Binary file not shown.
Binary file modified tests/ref/ebeam_splitter_swg_assist_te1310.gds
Binary file not shown.
Binary file modified tests/ref/ebeam_splitter_swg_assist_te1550.gds
Binary file not shown.
Binary file modified tests/ref/ebeam_terminator_te1310.gds
Binary file not shown.
Binary file modified tests/ref/ebeam_terminator_te1550.gds
Binary file not shown.
Binary file modified tests/ref/ebeam_terminator_tm1550.gds
Binary file not shown.
Binary file modified tests/ref/ebeam_y_adiabatic.gds
Binary file not shown.
Binary file modified tests/ref/ebeam_y_adiabatic_1310.gds
Binary file not shown.
Binary file modified tests/ref/gc_te1310.gds
Binary file not shown.
Binary file modified tests/ref/gc_te1310_8deg.gds
Binary file not shown.
Binary file modified tests/ref/gc_te1310_broadband.gds
Binary file not shown.
Binary file modified tests/ref/gc_te1550.gds
Binary file not shown.
Binary file modified tests/ref/gc_te1550_broadband.gds
Binary file not shown.
Binary file modified tests/ref/gc_tm1550.gds
Binary file not shown.
Binary file modified tests/ref/metal_via.gds
Binary file not shown.
Binary file added tests/ref/mmi1x2.gds
Binary file not shown.
Binary file added tests/ref/mzi_heater_mzi_heater_DL10_LX320.gds
Binary file not shown.
Binary file added tests/ref/mzi_heater_mzi_heater_DL10_LX500.gds
Binary file not shown.
Binary file added tests/ref/mzi_mzi_DL10_LY2_LX200__04a5abb5.gds
Binary file not shown.
Binary file added tests/ref/mzi_mzi_DL10_LY2_LX200__1a4b2cc7.gds
Binary file not shown.
Binary file added tests/ref/pad_array_pad_array_PFp_79afac5b.gds
Binary file not shown.
Binary file added tests/ref/pad_pad_S75_75_LM2_ROUT_e620d652.gds
Binary file not shown.
Binary file added tests/ref/photonic_wirebond_surfa_247ccd11.gds
Binary file not shown.
Binary file added tests/ref/photonic_wirebond_surfa_4f115197.gds
Binary file not shown.
Binary file added tests/ref/ring_double_heater_ring_23fdd1a3.gds
Binary file not shown.
Binary file added tests/ref/ring_double_heater_ring_323e2c81.gds
Binary file not shown.
Binary file added tests/ref/ring_double_heater_ring_6237d469.gds
Binary file not shown.
Binary file added tests/ref/ring_double_heater_ring_8b1aafcc.gds
Binary file not shown.
Binary file added tests/ref/ring_double_heater_ring_a2cc93f9.gds
Binary file not shown.
Binary file added tests/ref/ring_double_ring_double_267a3e9c.gds
Binary file not shown.
Binary file added tests/ref/ring_double_ring_double_64dde9ca.gds
Binary file not shown.
Binary file added tests/ref/ring_single_dut_ring_si_219403cd.gds
Binary file not shown.
Binary file added tests/ref/ring_single_dut_ring_si_c1684517.gds
Binary file not shown.
Binary file added tests/ref/ring_single_ring_single_51cf37a6.gds
Binary file not shown.
Binary file added tests/ref/ring_single_ring_single_82ff2bc7.gds
Binary file not shown.
Binary file added tests/ref/spiral_spiral_L100_S3_NL6.gds
Binary file not shown.
Binary file added tests/ref/straight_heater_metal_s_3a225c2e.gds
Binary file not shown.
Binary file added tests/ref/straight_heater_metal_u_9642c5f3.gds
Binary file not shown.
Binary file added tests/ref/straight_one_pin_straig_6db5f564.gds
Binary file not shown.
Binary file added tests/ref/straight_one_pin_straig_e70a3ed8.gds
Binary file not shown.
Binary file added tests/ref/straight_straight_L10_N2_CSstrip.gds
Binary file not shown.
Binary file added tests/ref/straight_straight_L1_N2_CSstrip.gds
Binary file not shown.
Binary file added tests/ref/straight_straight_L1_N2_CSxs_sc.gds
Binary file not shown.
Binary file added tests/ref/taper_taper_L10_W0p5_WN_c9bd9d3a.gds
Binary file not shown.
Binary file added tests/ref/terminator_short_termin_5556f35e.gds
Binary file not shown.
Binary file added tests/ref/thermal_phase_shifter_m_6480beac.gds
Binary file not shown.
Binary file added tests/ref/thermal_phase_shifter_t_22d678c3.gds
Binary file not shown.
Binary file added tests/ref/thermal_phase_shifter_t_75acd1c1.gds
Binary file not shown.
Binary file added tests/ref/thermal_phase_shifter_t_ab7ae757.gds
Binary file not shown.
Binary file added tests/ref/via_stack_heater_mtop_v_dab7f8ed.gds
Binary file not shown.
Binary file added tests/ref/via_stack_via_stack_S10_b19233be.gds
Binary file not shown.
Binary file added tests/ref/wire_corner_metal_wire__3f566de1.gds
Binary file not shown.
Binary file added tests/ref/wire_corner_wire_corner_8c30bf18.gds
Binary file not shown.
Binary file added tests/ref/wire_corner_wire_corner_a07cee56.gds
Binary file not shown.
7 changes: 3 additions & 4 deletions tests/test_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@
"dbg",
"add_pins_bbox_siepic",
"add_pads",
"add_pads_bot",
"add_pads_top",
"add_pins_bbox_siepic_remove_layers",
"import_gds",
"import_gc",
"mzi",
"ebeam_adiabatic_tm1550",
"ebeam_swg_edgecoupler",
"ebeam_BondPad",
"add_fiber_array",
}
cell_names = set(cells.keys()) - set(skip_test)
dirpath_ref = pathlib.Path(__file__).absolute().parent / "ref"
Expand All @@ -44,7 +47,3 @@ def test_pdk_settings(
) -> None:
"""Avoid regressions when exporting settings."""
data_regression.check(component.to_dict(with_ports=False))


def test_assert_ports_on_grid(component: Component) -> None:
component.assert_ports_on_grid()
33 changes: 11 additions & 22 deletions tests/test_components/test_pdk_settings_add_fiber_array_.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,17 @@
function: add_fiber_array
info:
length: 1.0
route_info_length: 1.0
route_info_type: xs_sc
route_info_weight: 1.0
route_info_xs_sc_length: 1.0
length: 1
route_info_length: 1
route_info_type: xs_34e31a19
route_info_weight: 1
route_info_xs_34e31a19_length: 1
width: 0.5
module: ubcpdk.components
name: add_fiber_array_add_fiber_array__ubcpdkpcomponents
name: add_fiber_array_Cstraig_d8738009
settings:
component:
function: straight
component_name: null
component: straight
cross_section: xs_sc
fanout_length: 0.0
fanout_length: 0
gc_port_name: o1
get_input_labels_function:
function: get_input_labels
grating_coupler:
function: gc_te1550
layer_label:
- 10
- 0
optical_routing_type: 0
straight:
function: straight
grating_coupler: gc_te1550
optical_routing_type: 1
straight: straight
with_loopback: false
4 changes: 4 additions & 0 deletions tests/test_components/test_pdk_settings_add_pads_bot_.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
info:
resistance: 0
name: Unnamed_32
settings: {}
6 changes: 3 additions & 3 deletions tests/test_components/test_pdk_settings_add_pads_dc_.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ module: gdsfactory.routing.add_electrical_pads_top_dc
name: ring_single_heater_add_electrical_pads_top_dc_984bbf2d
settings:
component: ring_single_heater
get_bundle_function:
function: get_bundle
module: gdsfactory.routing.get_bundle
route_bundle_function:
function: route_bundle
module: gdsfactory.routing.route_bundle
settings:
bend:
function: wire_corner
Expand Down
Loading

0 comments on commit 5ceaa2d

Please sign in to comment.