Skip to content

Commit

Permalink
Merge pull request #416 from gdsfactory/update_gdsfactory818
Browse files Browse the repository at this point in the history
Update gdsfactory818
  • Loading branch information
joamatab authored Nov 10, 2024
2 parents 7254e98 + 97be071 commit 6a50653
Show file tree
Hide file tree
Showing 29 changed files with 511 additions and 820 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
rev: 0.8.0
hooks:
- id: nbstripout
files: ".ipynb"
Expand All @@ -20,14 +20,14 @@ repos:
- tomli

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.4.2"
rev: "v0.7.2"
hooks:
- id: ruff
args: [ --fix, --exit-non-zero-on-fix ]
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format

- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.13.0
rev: v2.14.0
hooks:
- id: pretty-format-toml
args: [--autofix]
Expand Down
23 changes: 9 additions & 14 deletions docs/notebooks/00_layout.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"source": [
"import gdsfactory as gf\n",
"\n",
"import ubcpdk\n",
"import ubcpdk.components as uc"
]
},
Expand Down Expand Up @@ -239,7 +238,7 @@
"outputs": [],
"source": [
"c = uc.mzi_heater()\n",
"c = uc.add_fiber_array_pads_rf(c, optical_routing_type=2)\n",
"c = uc.add_fiber_array_pads_rf(c)\n",
"c.plot()"
]
},
Expand Down Expand Up @@ -278,6 +277,7 @@
"outputs": [],
"source": [
"from functools import partial\n",
"\n",
"import gdsfactory as gf\n",
"\n",
"import ubcpdk.components as uc\n",
Expand Down Expand Up @@ -354,9 +354,9 @@
" \"\"\"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_adiabatic_te1550())]\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_1550())]\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",
Expand All @@ -379,16 +379,11 @@
"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 = [\n",
" uc.add_fiber_array(mzi, optical_routing_type=2, fanout_length=5) for mzi in mzis\n",
" ]\n",
" mzis = [mzi(delta_length=delta_length) for delta_length in [10, 40]]\n",
" mzis_gc = [uc.add_fiber_array(mzi, fanout_length=5) for mzi in mzis]\n",
"\n",
" mzis = [uc.mzi_heater(delta_length=delta_length) for delta_length in [40]]\n",
" mzis_heater_gc = [\n",
" uc.add_fiber_array_pads_rf(mzi, orientation=90, optical_routing_type=2)\n",
" for mzi in mzis\n",
" ]\n",
" mzis_heater_gc = [uc.add_fiber_array_pads_rf(mzi, orientation=90) for mzi in mzis]\n",
"\n",
" e = mzis_gc + mzis_heater_gc\n",
" c = gf.Component()\n",
Expand All @@ -415,7 +410,7 @@
" 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",
" ring_gc = uc.add_fiber_array_pads_rf(ring, pad_yspacing=10)\n",
" rings.append(ring_gc)\n",
"\n",
" c = gf.Component()\n",
Expand Down Expand Up @@ -457,7 +452,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.11.8"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion docs/notebooks/11_sparameters_gratings.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.11.8"
}
},
"nbformat": 4,
Expand Down
2 changes: 0 additions & 2 deletions docs/notebooks/12_sim_plugins_tidy3d.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"metadata": {},
"outputs": [],
"source": [
"import gdsfactory as gf\n",
"import gplugins as sim\n",
"import gplugins.tidy3d as gt\n",
"\n",
Expand Down Expand Up @@ -116,7 +115,6 @@
"metadata": {},
"outputs": [],
"source": [
"import gdsfactory as gf\n",
"import gplugins.sax as gsax\n",
"import jax.numpy as jnp\n",
"import matplotlib.pyplot as plt\n",
Expand Down
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@ authors = [
]
classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: OS Independent"
]
dependencies = [
"gdsfactory~=8.8.9",
"gdsfactory~=8.18.0",
"gplugins[sax]>=1,<2"
]
description = "ubcpdk pdk"
keywords = ["python"]
license = {file = "LICENSE"}
name = "ubcpdk"
readme = "README.md"
requires-python = ">=3.11"
requires-python = ">=3.10"
version = "2.6.3"

[project.optional-dependencies]
Expand All @@ -36,7 +37,7 @@ dev = [
docs = [
"autodoc_pydantic",
"jupytext",
"jupyter-book==1.0.2"
"jupyter-book==1.0.3"
]

[tool.codespell]
Expand Down
Binary file added tests/ref/dbr_cavity_te_dbr_cavit_edb4408e.gds
Binary file not shown.
Binary file added tests/ref/pad_array_pad_array_PFp_32374610.gds
Binary file not shown.
1 change: 1 addition & 0 deletions tests/test_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"ebeam_swg_edgecoupler",
"ebeam_BondPad",
"add_fiber_array",
"add_fiber_array_pads_rf",
}
cell_names = set(cells.keys()) - set(skip_test)
dirpath_ref = pathlib.Path(__file__).absolute().parent / "ref"
Expand Down
117 changes: 2 additions & 115 deletions tests/test_components/test_pdk_settings_add_fiber_array_pads_rf_.yml
Original file line number Diff line number Diff line change
@@ -1,116 +1,3 @@
function: add_fiber_array
info: {}
module: ubcpdk.components
name: add_fiber_array_add_fiber_array_35c727a6
settings:
component:
function: add_electrical_pads_top
module: gdsfactory.routing.add_electrical_pads_top
settings:
component:
function: ring_single_heater
module: gdsfactory.components.ring_single_heater
settings:
bend:
function: bend_euler
bend_coupler:
function: bend_euler
coupler_ring:
function: coupler_ring
cross_section:
bbox_layers: null
bbox_offsets: null
components_along_path: []
radius: 10.0
radius_min: 5.0
sections:
- hidden: false
insets: null
layer: WG
name: _default
offset: 0.0
offset_function: null
port_names:
- o1
- o2
port_types:
- optical
- optical
simplify: null
width: 0.5
width_function: null
cross_section_waveguide_heater: xs_sc_heater_metal
gap: 0.2
length_x: 4.0
length_y: 0.6
port_orientation: null
radius: 10.0
straight:
function: straight
via_stack:
function: via_stack
module: gdsfactory.components.via_stack
settings:
layers:
- - 11
- 0
- - 12
- 0
size:
- 10
- 10
vias:
- null
- null
via_stack_offset:
- 0
- 0
direction: top
layer: MTOP
orientation: 0
pad_array:
function: pad_array
module: gdsfactory.components.pad
settings:
pad:
function: pad
module: gdsfactory.components.pad
settings:
bbox_layers:
- - 13
- 0
bbox_offsets:
- -1.8
layer:
- 12
- 0
size:
- 75
- 75
spacing:
- 125
- 125
port_names: null
select_ports:
function: select_ports
module: gdsfactory.port
settings:
port_type: electrical
spacing:
- 0.0
- 100.0
component_name: null
cross_section: xs_sc
fanout_length: 0.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
with_loopback: false
name: Unnamed_102
settings: {}
5 changes: 3 additions & 2 deletions tests/test_components/test_pdk_settings_bend_.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ info:
route_info_length: 16.637
route_info_min_bend_radius: 7.061
route_info_n_bend_90: 1
route_info_type: xs_38f6dd83
route_info_type: xs_c8b8e980
route_info_weight: 16.637
route_info_xs_38f6dd83_length: 16.637
route_info_xs_c8b8e980_length: 16.637
width: 0.5
name: bend_euler_CSstrip
settings:
cross_section: strip
5 changes: 3 additions & 2 deletions tests/test_components/test_pdk_settings_bend_euler180_.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ info:
route_info_length: 42.817
route_info_min_bend_radius: 9.086
route_info_n_bend_90: 2
route_info_type: xs_38f6dd83
route_info_type: xs_c8b8e980
route_info_weight: 42.817
route_info_xs_38f6dd83_length: 42.817
route_info_xs_c8b8e980_length: 42.817
width: 0.5
name: bend_euler_CSstrip_A180
settings:
angle: 180
Expand Down
5 changes: 3 additions & 2 deletions tests/test_components/test_pdk_settings_bend_euler_.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ info:
route_info_length: 16.637
route_info_min_bend_radius: 7.061
route_info_n_bend_90: 1
route_info_type: xs_38f6dd83
route_info_type: xs_c8b8e980
route_info_weight: 16.637
route_info_xs_38f6dd83_length: 16.637
route_info_xs_c8b8e980_length: 16.637
width: 0.5
name: bend_euler_CSstrip
settings:
cross_section: strip
42 changes: 2 additions & 40 deletions tests/test_components/test_pdk_settings_dbr_cavity_te_.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,4 @@
function: add_fiber_array
info: {}
module: ubcpdk.components
name: add_fiber_array_add_fiber_array_d1dbd359
name: dbr_cavity_te_Cdbr_cavity
settings:
component:
function: cavity
module: gdsfactory.components.cavity
settings:
component:
function: dbr
module: ubcpdk.components
settings:
cross_section:
function: cross_section
module: gdsfactory.cross_section
settings:
radius_min: 5
dw: 0.1
l1: 0.079406
l2: 0.079406
n: 100
w0: 0.5
coupler:
function: coupler
gap: 0.2
length: 0.1
component_name: null
cross_section: xs_sc
fanout_length: 0.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
with_loopback: false
component: dbr_cavity
3 changes: 2 additions & 1 deletion tests/test_components/test_pdk_settings_pad_array_.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
info: {}
name: pad_array_PFpad_Mgdsfac_c2f3ae49
name: pad_array_PFpad_Mgdsfac_1ba46877
settings:
centered_ports: false
columns: 6
layer: MTOP
pad: Fpad_Mgdsfactorypcomponentsppad_SS75_75_LM2_ROUTER_BLPAD_OPEN_BOm1p8
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
@@ -1,9 +1,9 @@
info:
length: 10
route_info_length: 10
route_info_type: xs_38f6dd83
route_info_type: xs_c8b8e980
route_info_weight: 10
route_info_xs_38f6dd83_length: 10
route_info_xs_c8b8e980_length: 10
width: 0.5
name: straight_L10_N2_CSstrip
settings:
Expand Down
1 change: 1 addition & 0 deletions tests/test_netlists.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"add_pads_bot",
"wire_corner",
"straight_heater_metal",
"add_fiber_array_pads_rf",
}
cell_names = cells.keys() - skip_test

Expand Down
Loading

0 comments on commit 6a50653

Please sign in to comment.