Skip to content

Commit

Permalink
Merge pull request #324 from gdsfactory/add_bbox
Browse files Browse the repository at this point in the history
add bbox
  • Loading branch information
joamatab authored Oct 21, 2023
2 parents ef0d378 + 6738c1b commit 29809db
Show file tree
Hide file tree
Showing 111 changed files with 1,747 additions and 224 deletions.
87 changes: 44 additions & 43 deletions docs/notebooks/00_layout.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"import gdsfactory as gf\n",
"\n",
"import ubcpdk\n",
"import ubcpdk.components as uc\n",
"\n",
"gf.CONF.display_type = \"klayout\""
]
Expand All @@ -41,7 +42,7 @@
"metadata": {},
"outputs": [],
"source": [
"c = ubcpdk.components.ebeam_crossing4()\n",
"c = uc.ebeam_crossing4()\n",
"c.plot()"
]
},
Expand All @@ -52,7 +53,7 @@
"metadata": {},
"outputs": [],
"source": [
"c = ubcpdk.components.ebeam_swg_edgecoupler()\n",
"c = uc.ebeam_swg_edgecoupler()\n",
"c.plot()"
]
},
Expand All @@ -63,7 +64,7 @@
"metadata": {},
"outputs": [],
"source": [
"c = ubcpdk.components.ebeam_bdc_te1550()\n",
"c = uc.ebeam_bdc_te1550()\n",
"c.plot()"
]
},
Expand All @@ -74,7 +75,7 @@
"metadata": {},
"outputs": [],
"source": [
"c = ubcpdk.components.ebeam_adiabatic_te1550()\n",
"c = uc.ebeam_adiabatic_te1550()\n",
"c.plot()"
]
},
Expand All @@ -85,7 +86,7 @@
"metadata": {},
"outputs": [],
"source": [
"c = ubcpdk.components.ebeam_y_adiabatic()\n",
"c = uc.ebeam_y_adiabatic()\n",
"c.plot()"
]
},
Expand All @@ -96,7 +97,7 @@
"metadata": {},
"outputs": [],
"source": [
"c = ubcpdk.components.ebeam_y_1550()\n",
"c = uc.ebeam_y_1550()\n",
"c.plot()"
]
},
Expand All @@ -117,7 +118,7 @@
"metadata": {},
"outputs": [],
"source": [
"c = ubcpdk.components.straight(length=2)\n",
"c = uc.straight(length=2)\n",
"c.plot()"
]
},
Expand All @@ -128,7 +129,7 @@
"metadata": {},
"outputs": [],
"source": [
"c = ubcpdk.components.bend_euler(radius=5)\n",
"c = uc.bend(radius=5)\n",
"c.plot()"
]
},
Expand All @@ -139,7 +140,7 @@
"metadata": {},
"outputs": [],
"source": [
"c = ubcpdk.components.ring_with_crossing()\n",
"c = uc.ring_with_crossing()\n",
"c.plot()"
]
},
Expand All @@ -150,7 +151,7 @@
"metadata": {},
"outputs": [],
"source": [
"c = ubcpdk.components.dbr()\n",
"c = uc.dbr()\n",
"c.plot()"
]
},
Expand All @@ -161,7 +162,7 @@
"metadata": {},
"outputs": [],
"source": [
"c = ubcpdk.components.spiral()\n",
"c = uc.spiral()\n",
"c.plot()"
]
},
Expand All @@ -172,7 +173,7 @@
"metadata": {},
"outputs": [],
"source": [
"c = ubcpdk.components.mzi_heater()\n",
"c = uc.mzi_heater()\n",
"c.plot()"
]
},
Expand All @@ -183,7 +184,7 @@
"metadata": {},
"outputs": [],
"source": [
"c = ubcpdk.components.ring_single_heater()\n",
"c = uc.ring_single_heater()\n",
"c.plot()"
]
},
Expand All @@ -204,7 +205,7 @@
"metadata": {},
"outputs": [],
"source": [
"splitter = ubcpdk.components.ebeam_y_1550(decorator=gf.port.auto_rename_ports)\n",
"splitter = uc.ebeam_y_1550(decorator=gf.port.auto_rename_ports)\n",
"mzi = gf.components.mzi(splitter=splitter)\n",
"mzi.plot()"
]
Expand All @@ -216,7 +217,7 @@
"metadata": {},
"outputs": [],
"source": [
"component_fiber_array = ubcpdk.components.add_fiber_array(component=mzi)\n",
"component_fiber_array = uc.add_fiber_array(component=mzi)\n",
"component_fiber_array.plot()"
]
},
Expand All @@ -227,8 +228,8 @@
"metadata": {},
"outputs": [],
"source": [
"c = ubcpdk.components.ring_single_heater()\n",
"c = ubcpdk.components.add_fiber_array_pads_rf(c)\n",
"c = uc.ring_single_heater()\n",
"c = uc.add_fiber_array_pads_rf(c)\n",
"c.plot()"
]
},
Expand All @@ -239,8 +240,8 @@
"metadata": {},
"outputs": [],
"source": [
"c = ubcpdk.components.mzi_heater()\n",
"c = ubcpdk.components.add_fiber_array_pads_rf(c, optical_routing_type=2)\n",
"c = uc.mzi_heater()\n",
"c = uc.add_fiber_array_pads_rf(c, optical_routing_type=2)\n",
"c.plot()"
]
},
Expand Down Expand Up @@ -284,38 +285,38 @@
"import gdsfactory as gf\n",
"\n",
"import ubcpdk\n",
"import ubcpdk.components as pdk\n",
"import ubcpdk.components as uc\n",
"from ubcpdk import tech\n",
"from ubcpdk.tech import LAYER\n",
"\n",
"\n",
"gf.CONF.display_type = \"klayout\"\n",
"size = (440, 470)\n",
"add_gc = ubcpdk.components.add_fiber_array\n",
"add_gc = uc.add_fiber_array\n",
"pack = partial(\n",
" gf.pack, max_size=size, add_ports_prefix=False, add_ports_suffix=False, spacing=2\n",
")\n",
"\n",
"@gf.cell\n",
"def EBeam_JoaquinMatres_1() -> gf.Component:\n",
" \"\"\"Add DBR cavities.\"\"\"\n",
" e = [add_gc(ubcpdk.components.straight())]\n",
" e += [add_gc(pdk.mzi(delta_length=dl)) for dl in [9.32, 93.19]]\n",
" e = [add_gc(uc.straight())]\n",
" e += [add_gc(uc.mzi(delta_length=dl)) for dl in [9.32, 93.19]]\n",
" e += [\n",
" add_gc(gf.components.ring_single(radius=12, gap=gap, length_x=coupling_length))\n",
" add_gc(uc.ring_single(radius=12, gap=gap, length_x=coupling_length))\n",
" for gap in [0.2]\n",
" for coupling_length in [2.5, 4.5, 6.5]\n",
" ]\n",
"\n",
" e += [\n",
" ubcpdk.components.dbr_cavity_te(w0=w0, dw=dw)\n",
" uc.dbr_cavity_te(w0=w0, dw=dw)\n",
" for w0 in [0.5]\n",
" for dw in [50e-3, 100e-3, 150e-3, 200e-3]\n",
" ]\n",
" e += [add_gc(ubcpdk.components.ring_with_crossing())]\n",
" e += [add_gc(uc.ring_with_crossing())]\n",
" e += [\n",
" add_gc(\n",
" ubcpdk.components.ring_with_crossing(port_name=\"o2\", with_component=False)\n",
" uc.ring_with_crossing(port_name=\"o2\", with_component=False)\n",
" )\n",
" ]\n",
"\n",
Expand Down Expand Up @@ -344,8 +345,8 @@
" radius = 10\n",
"\n",
" e = [\n",
" ubcpdk.components.add_fiber_array(\n",
" component=ubcpdk.components.spiral(\n",
" uc.add_fiber_array(\n",
" component=uc.spiral(\n",
" N=N,\n",
" radius=radius,\n",
" y_straight_inner_top=0,\n",
Expand All @@ -356,8 +357,8 @@
" ]\n",
"\n",
" e.append(\n",
" ubcpdk.components.add_fiber_array(\n",
" component=ubcpdk.components.spiral(\n",
" uc.add_fiber_array(\n",
" component=uc.spiral(\n",
" N=N,\n",
" radius=radius,\n",
" y_straight_inner_top=0,\n",
Expand Down Expand Up @@ -387,13 +388,13 @@
"def EBeam_JoaquinMatres_3() -> gf.Component:\n",
" \"\"\"contains mirror cavities and structures inside a resonator\"\"\"\n",
" e = []\n",
" e += [add_gc(ubcpdk.components.ebeam_crossing4())]\n",
" e += [add_gc(ubcpdk.components.ebeam_adiabatic_te1550(), optical_routing_type=1)]\n",
" e += [add_gc(ubcpdk.components.ebeam_bdc_te1550())]\n",
" e += [add_gc(ubcpdk.components.ebeam_y_1550(), optical_routing_type=1)]\n",
" e += [add_gc(ubcpdk.components.ebeam_y_adiabatic_tapers(), optical_routing_type=1)]\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 += [\n",
" add_gc(ubcpdk.components.straight(), component_name=f\"straight_{i}\")\n",
" add_gc(uc.straight(), component_name=f\"straight_{i}\")\n",
" for i in range(2)\n",
" ]\n",
" c = gf.Component()\n",
Expand All @@ -417,13 +418,13 @@
"@gf.cell\n",
"def EBeam_JoaquinMatres_4() -> gf.Component:\n",
" \"\"\"MZI interferometers.\"\"\"\n",
" mzi = partial(gf.components.mzi, splitter=ubcpdk.components.ebeam_y_1550)\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 = [pdk.add_fiber_array(mzi) for mzi in mzis]\n",
" mzis_gc = [uc.add_fiber_array(mzi) for mzi in mzis]\n",
"\n",
" mzis = [pdk.mzi_heater(delta_length=delta_length) for delta_length in [40]]\n",
" mzis = [uc.mzi_heater(delta_length=delta_length) for delta_length in [40]]\n",
" mzis_heater_gc = [\n",
" pdk.add_fiber_array_pads_rf(mzi, orientation=90, optical_routing_type=2)\n",
" uc.add_fiber_array_pads_rf(mzi, orientation=90, optical_routing_type=2)\n",
" for mzi in mzis\n",
" ]\n",
"\n",
Expand All @@ -449,9 +450,9 @@
"@gf.cell\n",
"def EBeam_JoaquinMatres_5() -> gf.Component:\n",
" \"\"\"Ring resonators.\"\"\"\n",
" rings = [pdk.ring_single_heater(length_x=length_x) for length_x in [4, 6]]\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 = [pdk.add_fiber_array_pads_rf(ring) for ring in rings]\n",
" rings_gc = [uc.add_fiber_array_pads_rf(ring) for ring in rings]\n",
"\n",
" c = gf.Component()\n",
" _ = c << pack(rings_gc)[0]\n",
Expand Down
14 changes: 13 additions & 1 deletion docs/notebooks/11_sparameters.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
"outputs": [],
"source": [
"for f in [\n",
" pdk.bend_euler,\n",
" pdk.bend,\n",
" pdk.coupler,\n",
" pdk.coupler_ring,\n",
" pdk.ebeam_y_1550,\n",
Expand Down Expand Up @@ -177,6 +177,18 @@
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
}
},
"nbformat": 4,
Expand Down
20 changes: 20 additions & 0 deletions docs/notebooks/11_sparameters_gratings.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,14 @@
"source": [
"help(gt.write_sparameters_grating_coupler)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "285f61c1",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -163,6 +171,18 @@
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 29809db

Please sign in to comment.