diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 0ef49a9c..d426f2a0 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -12,15 +12,18 @@ jobs: name: Sphinx docs to gh-pages steps: - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.11" + cache: "pip" + cache-dependency-path: pyproject.toml - uses: actions/cache@v3 with: path: | ~/.gdsfactory/ key: 0.0.1 restore-keys: 0.0.1 - - name: Add conda to system path - run: | - echo $CONDA/bin >> $GITHUB_PATH - name: Installing the library env: TIDY3D_USER: ${{ secrets.TIDY3D_EMAIL }} @@ -31,11 +34,10 @@ jobs: GDSFACTORY_LAYOUT_PLOTTER: klayout shell: bash -l {0} run: | - sudo apt install libglu1-mesa - make dev plugins + make dev make docs - name: Upload artifact - uses: actions/upload-pages-artifact@v1 + uses: actions/upload-pages-artifact@v2 with: path: "./docs/_build/html/" diff --git a/.github/workflows/test_code.yml b/.github/workflows/test_code.yml index fa31c8da..3353738f 100644 --- a/.github/workflows/test_code.yml +++ b/.github/workflows/test_code.yml @@ -19,8 +19,8 @@ jobs: strategy: max-parallel: 12 matrix: - python-version: ["3.10"] - os: [ubuntu-latest, windows-latest, macos-latest] + python-version: ["3.11"] + os: [ubuntu-latest] steps: - uses: actions/checkout@v3 @@ -32,8 +32,7 @@ jobs: cache-dependency-path: pyproject.toml - name: Install dependencies run: | - pip install . - pip install pytest pytest_regressions + make dev - name: Test with pytest run: pytest tests/ test_code_coverage: @@ -50,11 +49,9 @@ jobs: cache-dependency-path: pyproject.toml - name: Install dependencies run: | - pip install -e . + make dev - name: Test with pytest run: | - python -m pip install --upgrade pip - pip install pytest klayout lytest scikit-image pytest-cov pytest_regressions pytest --cov=ubcpdk tests/ - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 @@ -67,27 +64,21 @@ jobs: strategy: max-parallel: 12 matrix: - python-version: [3.9] + python-version: [3.11] os: [ubuntu-latest] steps: - uses: actions/checkout@v3 - - uses: conda-incubator/setup-miniconda@v2 + - name: Set up Python + uses: actions/setup-python@v4 with: - python-version: 3.9 - channels: conda-forge,defaults - channel-priority: true - activate-environment: anaconda-client-env - - name: Add conda to system path - run: | - echo $CONDA/bin >> $GITHUB_PATH + python-version: "3.11" + cache: "pip" + cache-dependency-path: pyproject.toml - name: Install dependencies run: | - sudo apt install pandoc - make plugins - pip install -e .[docs] --upgrade - pip install numpy --upgrade - conda list > requirements.txt + make dev + pip freeze > requirements.txt - uses: actions/upload-artifact@v3 with: name: requirements diff --git a/.github/write_components_autodoc.py b/.github/write_components_autodoc.py index b76efe8d..72c22d53 100644 --- a/.github/write_components_autodoc.py +++ b/.github/write_components_autodoc.py @@ -1,8 +1,8 @@ import inspect + import ubcpdk from ubcpdk.config import PATH - filepath = PATH.repo / "docs" / "components.rst" skip = { @@ -51,7 +51,7 @@ [ f"{p}={repr(sig.parameters[p].default)}" for p in sig.parameters - if isinstance(sig.parameters[p].default, (int, float, str, tuple)) + if isinstance(sig.parameters[p].default, int | float | str | tuple) and p not in skip_settings ] ) diff --git a/.github/write_components_plot.py b/.github/write_components_plot.py index 0c6b2ea0..14bae7e9 100644 --- a/.github/write_components_plot.py +++ b/.github/write_components_plot.py @@ -1,8 +1,7 @@ -from typing import Tuple import inspect -from ubcpdk.config import PATH -from ubcpdk import cells +from ubcpdk import cells +from ubcpdk.config import PATH filepath = PATH.repo / "docs" / "components_plot.rst" @@ -20,8 +19,8 @@ "waveguide_template", } -skip_plot: Tuple[str, ...] = ("add_fiber_array_siepic",) -skip_settings: Tuple[str, ...] = ("flatten", "safe_cell_names") +skip_plot: tuple[str, ...] = ("add_fiber_array_siepic",) +skip_settings: tuple[str, ...] = ("flatten", "safe_cell_names") with open(filepath, "w+") as f: @@ -45,7 +44,7 @@ [ f"{p}={repr(sig.parameters[p].default)}" for p in sig.parameters - if isinstance(sig.parameters[p].default, (int, float, str, tuple)) + if isinstance(sig.parameters[p].default, int | float | str | tuple) and p not in skip_settings ] ) @@ -75,7 +74,7 @@ import ubcpdk c = ubcpdk.components.{name}({kwargs}) - c.plot_matplotlib() + c.plot_klayout() """ ) diff --git a/.github/write_components_plot_klayout.py b/.github/write_components_plot_klayout.py deleted file mode 100644 index c3f9feb9..00000000 --- a/.github/write_components_plot_klayout.py +++ /dev/null @@ -1,80 +0,0 @@ -from typing import Tuple -import inspect -from ubcpdk.config import PATH -from ubcpdk import cells - - -filepath = PATH.repo / "docs" / "components_plot.rst" - -skip = { - "LIBRARY", - "circuit_names", - "component_factory", - "component_names", - "container_names", - "component_names_test_ports", - "component_names_skip_test", - "component_names_skip_test_ports", - "dataclasses", - "library", - "waveguide_template", -} - -skip_plot: Tuple[str, ...] = ("add_fiber_array_siepic",) -skip_settings: Tuple[str, ...] = ("flatten", "safe_cell_names") - - -with open(filepath, "w+") as f: - f.write( - """ - -Here are the components available in the PDK - - -Cells -============================= -""" - ) - - for name in sorted(cells.keys()): - if name in skip or name.startswith("_"): - continue - print(name) - sig = inspect.signature(cells[name]) - kwargs = ", ".join( - [ - f"{p}={repr(sig.parameters[p].default)}" - for p in sig.parameters - if isinstance(sig.parameters[p].default, (int, float, str, tuple)) - and p not in skip_settings - ] - ) - if name in skip_plot: - f.write( - f""" - -{name} ----------------------------------------------------- - -.. autofunction:: ubcpdk.components.{name} - -""" - ) - else: - f.write( - f""" - -{name} ----------------------------------------------------- - -.. autofunction:: ubcpdk.components.{name} - - .. code-block:: python - - import ubcpdk - - c = ubcpdk.components.{name}({kwargs}) - c.plot_klayout() - -""" - ) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 430965ae..78c7e3a6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,17 +2,9 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: 9260cbc9c84c06022993bfbcc42fdbf0305c5b8e hooks: - - id: check-yaml - exclude: ^(conda\.recipe/meta\.yaml|conda_build/templates/.*\.yaml|docs/click/meta\.yaml|conda/meta\.yaml|construct.yaml) - id: end-of-file-fixer - id: trailing-whitespace - id: requirements-txt-fixer - - repo: https://github.com/pycqa/isort - rev: 7b69d092ae4885dcc45648538ae780a6326bcd1e - hooks: - - id: isort - files: ubcdpk/.* - args: [--profile, black, --filter-files] - repo: https://github.com/psf/black rev: 25d886f52c2bbbb58386ac8050f4e67952507bc7 @@ -23,3 +15,8 @@ repos: rev: "6a0ba1854991b693612486cc84a2254de82d071d" hooks: - id: ruff + - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks + rev: v2.10.0 + hooks: + - id: pretty-format-toml + args: [--autofix] diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e113b96..72ece472 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [2.0.0](https://github.com/gdsfactory/ubc/pull/291) + +- update to gdsfactory 7.0.2 + ## [1.21.0](https://github.com/gdsfactory/ubc/pull/203) - use jupyterbook for docs diff --git a/Makefile b/Makefile index 95402ad9..b14d8033 100644 --- a/Makefile +++ b/Makefile @@ -1,37 +1,17 @@ install: - pip install -e . + pip install -e .[dev,docs] pip install pre-commit pre-commit install python install_tech.py -dev: - pip install -e .[dev,docs] +dev: install -update: - pre-commit autoupdate --bleeding-edge +update-pre: + pre-commit autoupdate watch: gf watch ubcpdk -link: - lygadgets_link lygadgets - lygadgets_link gdsfactory - lygadgets_link toolz - lygadgets_link gdspy - lygadgets_link numpy - lygadgets_link matplotlib - lygadgets_link cycler - lygadgets_link pyparsing - lygadgets_link dateutil - lygadgets_link kiwisolver - lygadgets_link ubcpdk/klayout/tech - lygadgets_link ubcpdk - lygadgets_link scipy # [because of splines in the nanowires] - lygadgets_link omegaconf - lygadgets_link loguru - lygadgets_link pydantic - lygadgets_link shapely - test: pytest -s @@ -47,34 +27,9 @@ meep: conda config --set solver libmamba conda install -c conda-forge pymeep=*=mpi_mpich_* nlopt -y -plugins: meep - pip install gdsfactory[docs,dev,full,gmsh,tidy3d,devsim,meow,sax] - pip install -e .[full] --upgrade - -diff: - pf merge-cells gds_diff - cov: pytest --cov=ubcpdk -mypy: - mypy . --ignore-missing-imports - -lint: - flake8 . - -pylint: - pylint ubcpdk - -lintd: - flake8 --select RST - -pydocstyle: - pydocstyle ubcpdk - -doc8: - doc8 docs/ - git-rm-merged: git branch -D `git branch --merged | grep -v \* | xargs` @@ -82,27 +37,8 @@ release: git push git push origin --tags -build: - rm -rf dist - pip install build - python -m build - -notebooks: - nbstripout --drop-empty-cells docs/notebooks/*.ipynb - -mask: - python ubcpdk/samples/test_masks.py - -jupytext: - jupytext docs/**/*.ipynb --to py - -notebooks: - jupytext docs/**/*.py --to ipynb - -notebooks-rm: - rm docs/notebooks/*.ipynb docs: jb build docs -.PHONY: drc doc docs +.PHONY: drc doc docs install diff --git a/README.md b/README.md index aec812eb..3be7b854 100644 --- a/README.md +++ b/README.md @@ -48,18 +48,3 @@ python install_tech.py - Run notebooks on [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/gdsfactory/binder-sandbox/HEAD) - [UBCpdk docs](https://gdsfactory.github.io/ubc/) and [code](https://github.com/gdsfactory/ubc) - [gdsfactory docs](https://gdsfactory.github.io/gdsfactory/) - -## Acks - -UBCpdk top contributors: - -- Joaquin Matres (Google): maintainer of gdsfactory -- Thomas Dorch (Freedom Photonics): for Meep's material database access, MPB sidewall angles, and add_pin_path -- Lukas Chrostowski (UBC professor): creator of the course and maintainer of the PDK cells - -Links: - -- [UBC docs](https://gdsfactory.github.io/ubc/) and [repo](https://github.com/gdsfactory/ubc) -- [gdsfactory docs](https://gdsfactory.github.io/gdsfactory/) -- [edx course](https://www.edx.org/course/silicon-photonics-design-fabrication-and-data-ana) -- [awesome photonics list](https://github.com/joamatab/awesome_photonics) diff --git a/docs/_toc.yml b/docs/_toc.yml index 40d99004..4830e7f3 100644 --- a/docs/_toc.yml +++ b/docs/_toc.yml @@ -1,5 +1,5 @@ # Table of contents -# Learn more at https://jupyterbook.org/customize/toc.html +# Learn more at https://jterbook.org/customize/toc.html format: jb-book root: index @@ -8,4 +8,15 @@ chapters: - file: components - file: components_plot - file: tutorial + sections: + - file: notebooks/00_layout + - file: notebooks/11_sparameters + - file: notebooks/11_sparameters_gratings + - file: notebooks/12_sim_plugins_tidy3d + - file: notebooks/13_sim_plugins + - file: notebooks/14_sax_tidy3d + - file: notebooks/21_schematic_driven_layout + - file: notebooks/31_data_analysis_mzi + - file: notebooks/32_data_analysis_ring + - file: notebooks/33_data_analysis_dbr - file: changelog diff --git a/docs/components_plot.rst b/docs/components_plot.rst index ad3c834c..f90a9aa3 100644 --- a/docs/components_plot.rst +++ b/docs/components_plot.rst @@ -18,7 +18,7 @@ add_fiber_array import ubcpdk c = ubcpdk.components.add_fiber_array(gc_port_name='o1', with_loopback=False, optical_routing_type=0, fanout_length=0.0, cross_section='strip', layer_label=(66, 0)) - c.plot_matplotlib() + c.plot_klayout() @@ -33,7 +33,7 @@ add_fiber_array_pads_rf import ubcpdk c = ubcpdk.components.add_fiber_array_pads_rf(component='ring_single_heater', username='JoaquinMatres') - c.plot_matplotlib() + c.plot_klayout() @@ -48,7 +48,7 @@ add_pads import ubcpdk c = ubcpdk.components.add_pads(component='ring_single_heater', username='JoaquinMatres') - c.plot_matplotlib() + c.plot_klayout() @@ -63,7 +63,7 @@ add_pads_dc import ubcpdk c = ubcpdk.components.add_pads_dc(component='ring_single_heater', spacing=(0.0, 100.0)) - c.plot_matplotlib() + c.plot_klayout() @@ -78,7 +78,7 @@ add_pads_rf import ubcpdk c = ubcpdk.components.add_pads_rf(component='ring_single_heater', direction='top', spacing=(0.0, 100.0), layer='MTOP') - c.plot_matplotlib() + c.plot_klayout() @@ -93,7 +93,7 @@ add_pins_bbox_siepic import ubcpdk c = ubcpdk.components.add_pins_bbox_siepic(port_type='optical', layer_pin=(1, 10), pin_length=0.01, bbox_layer=(68, 0), padding=0, remove_layers=False) - c.plot_matplotlib() + c.plot_klayout() @@ -108,7 +108,7 @@ add_pins_bbox_siepic_remove_layers import ubcpdk c = ubcpdk.components.add_pins_bbox_siepic_remove_layers(port_type='optical', layer_pin=(1, 10), pin_length=0.01, bbox_layer=(68, 0), padding=0, remove_layers=True) - c.plot_matplotlib() + c.plot_klayout() @@ -123,7 +123,7 @@ add_pins_siepic_metal import ubcpdk c = ubcpdk.components.add_pins_siepic_metal(port_type='placement', layer_pin=(1, 11), pin_length=0.01) - c.plot_matplotlib() + c.plot_klayout() @@ -138,7 +138,7 @@ bend import ubcpdk c = ubcpdk.components.bend(angle=90.0, p=0.5, with_arc_floorplan=True, direction='ccw', with_bbox=True, cross_section='strip') - c.plot_matplotlib() + c.plot_klayout() @@ -153,7 +153,7 @@ bend_euler import ubcpdk c = ubcpdk.components.bend_euler(angle=90.0, p=0.5, with_arc_floorplan=True, npoints=100, direction='ccw', with_bbox=True, cross_section='strip') - c.plot_matplotlib() + c.plot_klayout() @@ -168,7 +168,7 @@ bend_s import ubcpdk c = ubcpdk.components.bend_s(size=(11.0, 2.0), npoints=99, cross_section='strip', check_min_radius=False) - c.plot_matplotlib() + c.plot_klayout() @@ -183,7 +183,7 @@ coupler import ubcpdk c = ubcpdk.components.coupler(gap=0.236, length=20.0, dy=4.0, dx=10.0) - c.plot_matplotlib() + c.plot_klayout() @@ -198,7 +198,7 @@ coupler_ring import ubcpdk c = ubcpdk.components.coupler_ring(gap=0.2, radius=5.0, length_x=4.0, cross_section='strip', length_extension=3) - c.plot_matplotlib() + c.plot_klayout() @@ -213,7 +213,7 @@ dbg import ubcpdk c = ubcpdk.components.dbg(w0=0.5, dw=0.1, n=100, l1=0.07940573770491803, l2=0.07940573770491803) - c.plot_matplotlib() + c.plot_klayout() @@ -228,7 +228,7 @@ dbr import ubcpdk c = ubcpdk.components.dbr(w0=0.5, dw=0.1, n=100, l1=0.07940573770491803, l2=0.07940573770491803) - c.plot_matplotlib() + c.plot_klayout() @@ -243,7 +243,7 @@ dbr_cavity import ubcpdk c = ubcpdk.components.dbr_cavity() - c.plot_matplotlib() + c.plot_klayout() @@ -258,7 +258,7 @@ dbr_cavity_te import ubcpdk c = ubcpdk.components.dbr_cavity_te(component='dbr_cavity') - c.plot_matplotlib() + c.plot_klayout() @@ -273,7 +273,7 @@ ebeam_BondPad import ubcpdk c = ubcpdk.components.ebeam_BondPad() - c.plot_matplotlib() + c.plot_klayout() @@ -288,7 +288,7 @@ ebeam_adiabatic_te1550 import ubcpdk c = ubcpdk.components.ebeam_adiabatic_te1550() - c.plot_matplotlib() + c.plot_klayout() @@ -303,7 +303,7 @@ ebeam_adiabatic_tm1550 import ubcpdk c = ubcpdk.components.ebeam_adiabatic_tm1550() - c.plot_matplotlib() + c.plot_klayout() @@ -318,7 +318,7 @@ ebeam_bdc_te1550 import ubcpdk c = ubcpdk.components.ebeam_bdc_te1550() - c.plot_matplotlib() + c.plot_klayout() @@ -333,7 +333,7 @@ ebeam_bdc_tm1550 import ubcpdk c = ubcpdk.components.ebeam_bdc_tm1550() - c.plot_matplotlib() + c.plot_klayout() @@ -348,7 +348,7 @@ ebeam_crossing4 import ubcpdk c = ubcpdk.components.ebeam_crossing4() - c.plot_matplotlib() + c.plot_klayout() @@ -363,7 +363,7 @@ ebeam_crossing4_2ports import ubcpdk c = ubcpdk.components.ebeam_crossing4_2ports() - c.plot_matplotlib() + c.plot_klayout() @@ -378,7 +378,7 @@ ebeam_dc_halfring_straight import ubcpdk c = ubcpdk.components.ebeam_dc_halfring_straight(gap=0.2, radius=5.0, length_x=4.0, cross_section='strip', siepic=True, model='ebeam_dc_halfring_straight') - c.plot_matplotlib() + c.plot_klayout() @@ -393,7 +393,7 @@ ebeam_dc_te1550 import ubcpdk c = ubcpdk.components.ebeam_dc_te1550(gap=0.236, length=20.0, dy=4.0, dx=10.0, cross_section='strip') - c.plot_matplotlib() + c.plot_klayout() @@ -408,7 +408,7 @@ ebeam_splitter_adiabatic_swg_te1550 import ubcpdk c = ubcpdk.components.ebeam_splitter_adiabatic_swg_te1550() - c.plot_matplotlib() + c.plot_klayout() @@ -423,7 +423,7 @@ ebeam_splitter_swg_assist_te1310 import ubcpdk c = ubcpdk.components.ebeam_splitter_swg_assist_te1310() - c.plot_matplotlib() + c.plot_klayout() @@ -438,7 +438,7 @@ ebeam_splitter_swg_assist_te1550 import ubcpdk c = ubcpdk.components.ebeam_splitter_swg_assist_te1550() - c.plot_matplotlib() + c.plot_klayout() @@ -453,7 +453,7 @@ ebeam_swg_edgecoupler import ubcpdk c = ubcpdk.components.ebeam_swg_edgecoupler() - c.plot_matplotlib() + c.plot_klayout() @@ -468,7 +468,7 @@ ebeam_terminator_te1310 import ubcpdk c = ubcpdk.components.ebeam_terminator_te1310() - c.plot_matplotlib() + c.plot_klayout() @@ -483,7 +483,7 @@ ebeam_terminator_te1550 import ubcpdk c = ubcpdk.components.ebeam_terminator_te1550() - c.plot_matplotlib() + c.plot_klayout() @@ -498,7 +498,7 @@ ebeam_terminator_tm1550 import ubcpdk c = ubcpdk.components.ebeam_terminator_tm1550() - c.plot_matplotlib() + c.plot_klayout() @@ -513,7 +513,7 @@ ebeam_y_1550 import ubcpdk c = ubcpdk.components.ebeam_y_1550() - c.plot_matplotlib() + c.plot_klayout() @@ -528,7 +528,7 @@ ebeam_y_adiabatic import ubcpdk c = ubcpdk.components.ebeam_y_adiabatic() - c.plot_matplotlib() + c.plot_klayout() @@ -543,7 +543,7 @@ ebeam_y_adiabatic_1310 import ubcpdk c = ubcpdk.components.ebeam_y_adiabatic_1310() - c.plot_matplotlib() + c.plot_klayout() @@ -558,7 +558,7 @@ ebeam_y_adiabatic_tapers import ubcpdk c = ubcpdk.components.ebeam_y_adiabatic_tapers() - c.plot_matplotlib() + c.plot_klayout() @@ -573,7 +573,7 @@ gc_te1310 import ubcpdk c = ubcpdk.components.gc_te1310() - c.plot_matplotlib() + c.plot_klayout() @@ -588,7 +588,7 @@ gc_te1310_8deg import ubcpdk c = ubcpdk.components.gc_te1310_8deg() - c.plot_matplotlib() + c.plot_klayout() @@ -603,7 +603,7 @@ gc_te1310_broadband import ubcpdk c = ubcpdk.components.gc_te1310_broadband() - c.plot_matplotlib() + c.plot_klayout() @@ -618,7 +618,7 @@ gc_te1550 import ubcpdk c = ubcpdk.components.gc_te1550() - c.plot_matplotlib() + c.plot_klayout() @@ -633,7 +633,7 @@ gc_te1550_90nmSlab import ubcpdk c = ubcpdk.components.gc_te1550_90nmSlab() - c.plot_matplotlib() + c.plot_klayout() @@ -648,7 +648,7 @@ gc_te1550_broadband import ubcpdk c = ubcpdk.components.gc_te1550_broadband() - c.plot_matplotlib() + c.plot_klayout() @@ -663,7 +663,7 @@ gc_tm1550 import ubcpdk c = ubcpdk.components.gc_tm1550() - c.plot_matplotlib() + c.plot_klayout() @@ -678,7 +678,7 @@ metal_via import ubcpdk c = ubcpdk.components.metal_via() - c.plot_matplotlib() + c.plot_klayout() @@ -693,7 +693,7 @@ mmi1x2 import ubcpdk c = ubcpdk.components.mmi1x2(width_taper=1.0, length_taper=10.0, length_mmi=5.5, width_mmi=2.5, gap_mmi=0.25, with_bbox=True) - c.plot_matplotlib() + c.plot_klayout() @@ -708,7 +708,7 @@ mzi import ubcpdk c = ubcpdk.components.mzi(delta_length=10.0, length_y=2.0, length_x=0.1, with_splitter=True, port_e1_splitter='o2', port_e0_splitter='o3', port_e1_combiner='o2', port_e0_combiner='o3', nbends=2, cross_section='strip', mirror_bot=False, add_optical_ports_arms=False) - c.plot_matplotlib() + c.plot_klayout() @@ -723,7 +723,7 @@ mzi_heater import ubcpdk c = ubcpdk.components.mzi_heater(delta_length=10.0, length_y=2.0, length_x=200, straight_x_top='straight_heater_metal', with_splitter=True, port_e1_splitter='o2', port_e0_splitter='o3', port_e1_combiner='o2', port_e0_combiner='o3', nbends=2, cross_section='strip', mirror_bot=False, add_optical_ports_arms=False) - c.plot_matplotlib() + c.plot_klayout() @@ -738,7 +738,7 @@ pad_array import ubcpdk c = ubcpdk.components.pad_array(spacing=(125, 125), columns=6, rows=1, orientation=270) - c.plot_matplotlib() + c.plot_klayout() @@ -753,7 +753,7 @@ photonic_wirebond_surfacetaper_1310 import ubcpdk c = ubcpdk.components.photonic_wirebond_surfacetaper_1310() - c.plot_matplotlib() + c.plot_klayout() @@ -768,7 +768,7 @@ photonic_wirebond_surfacetaper_1550 import ubcpdk c = ubcpdk.components.photonic_wirebond_surfacetaper_1550() - c.plot_matplotlib() + c.plot_klayout() @@ -782,8 +782,8 @@ ring_double_heater import ubcpdk - c = ubcpdk.components.ring_double_heater(gap=0.2, radius=10.0, length_x=0.01, length_y=0.01, cross_section_heater='heater_metal', cross_section_waveguide_heater='strip_heater_metal', cross_section='strip', port_orientation=90, via_stack_offset=(0, 0)) - c.plot_matplotlib() + c = ubcpdk.components.ring_double_heater(gap=0.2, radius=10.0, length_x=0.01, length_y=0.01, cross_section_heater='heater_metal', cross_section_waveguide_heater='strip_heater_metal', cross_section='strip', via_stack_offset=(0, 0)) + c.plot_klayout() @@ -798,7 +798,7 @@ ring_single import ubcpdk c = ubcpdk.components.ring_single(gap=0.2, radius=10.0, length_x=4.0, length_y=0.6, cross_section='strip') - c.plot_matplotlib() + c.plot_klayout() @@ -812,8 +812,8 @@ ring_single_heater import ubcpdk - c = ubcpdk.components.ring_single_heater(gap=0.2, radius=10.0, length_x=4.0, length_y=0.6, cross_section_waveguide_heater='strip_heater_metal', cross_section='strip', port_orientation=90, via_stack_offset=(0, 0)) - c.plot_matplotlib() + c = ubcpdk.components.ring_single_heater(gap=0.2, radius=10.0, length_x=4.0, length_y=0.6, cross_section_waveguide_heater='strip_heater_metal', cross_section='strip', via_stack_offset=(0, 0)) + c.plot_klayout() @@ -828,7 +828,7 @@ ring_with_crossing import ubcpdk c = ubcpdk.components.ring_with_crossing(gap=0.2, length_x=4, length_y=0, radius=5.0, with_component=True, port_name='o4') - c.plot_matplotlib() + c.plot_klayout() @@ -843,7 +843,7 @@ spiral import ubcpdk c = ubcpdk.components.spiral(N=6, x_inner_length_cutback=300.0, x_inner_offset=0.0, y_straight_inner_top=0.0, xspacing=3.0, yspacing=3.0, cross_section='strip', with_inner_ports=False, y_straight_outer_offset=0.0, inner_loop_spacing_offset=0.0) - c.plot_matplotlib() + c.plot_klayout() @@ -858,7 +858,7 @@ straight import ubcpdk c = ubcpdk.components.straight(length=10.0, npoints=2, with_bbox=True, cross_section='strip') - c.plot_matplotlib() + c.plot_klayout() @@ -873,7 +873,7 @@ straight_one_pin import ubcpdk c = ubcpdk.components.straight_one_pin(length=1) - c.plot_matplotlib() + c.plot_klayout() @@ -888,7 +888,7 @@ taper import ubcpdk c = ubcpdk.components.taper(length=10.0, width1=0.5, with_bbox=True, with_two_ports=True, cross_section='strip') - c.plot_matplotlib() + c.plot_klayout() @@ -903,7 +903,7 @@ terminator_short import ubcpdk c = ubcpdk.components.terminator_short() - c.plot_matplotlib() + c.plot_klayout() @@ -918,7 +918,7 @@ thermal_phase_shifter0 import ubcpdk c = ubcpdk.components.thermal_phase_shifter0() - c.plot_matplotlib() + c.plot_klayout() @@ -933,7 +933,7 @@ thermal_phase_shifter1 import ubcpdk c = ubcpdk.components.thermal_phase_shifter1() - c.plot_matplotlib() + c.plot_klayout() @@ -948,7 +948,7 @@ thermal_phase_shifter2 import ubcpdk c = ubcpdk.components.thermal_phase_shifter2() - c.plot_matplotlib() + c.plot_klayout() @@ -963,7 +963,7 @@ thermal_phase_shifter3 import ubcpdk c = ubcpdk.components.thermal_phase_shifter3() - c.plot_matplotlib() + c.plot_klayout() @@ -978,4 +978,4 @@ via_stack_heater_mtop import ubcpdk c = ubcpdk.components.via_stack_heater_mtop(size=(10, 10), layers=((11, 0), (12, 0)), vias=(None, None), correct_size=True) - c.plot_matplotlib() + c.plot_klayout() diff --git a/docs/notebooks b/docs/notebooks new file mode 120000 index 00000000..f1ec2756 --- /dev/null +++ b/docs/notebooks @@ -0,0 +1 @@ +../ubcpdk/samples/notebooks \ No newline at end of file diff --git a/docs/notebooks/11_sparameters.py b/docs/notebooks/11_sparameters.py deleted file mode 100644 index 1bd1a949..00000000 --- a/docs/notebooks/11_sparameters.py +++ /dev/null @@ -1,105 +0,0 @@ -# --- -# jupyter: -# jupytext: -# text_representation: -# extension: .py -# format_name: light -# format_version: '1.5' -# jupytext_version: 1.14.5 -# kernelspec: -# display_name: Python 3 (ipykernel) -# language: python -# name: python3 -# --- - -# # Component FDTD simulations -# -# Thanks to the GDSFactory plugin you can directly run simulations in different FDTD solvers. -# -# See [tutorial](https://gdsfactory.github.io/gdsfactory/plugins_fdtd.html) - -# ## Tidy3d -# -# You can read about the [tidy3d gdsfactory plugin](https://gdsfactory.github.io/gdsfactory/notebooks/plugins/tidy3d/00_tidy3d.html) - -# + -import gdsfactory.simulation as sim -import gdsfactory.simulation.gtidy3d as gt - -import ubcpdk -import ubcpdk.components as pdk - -# - - -c = pdk.ebeam_y_1550() -c - -sp = gt.write_sparameters(c) - -sp.keys() - -sim.plot.plot_sparameters(sp) - -sim.plot.plot_loss1x2(sp) - -sim.plot.plot_imbalance1x2(sp) - -# ## Lumerical FDTD -# -# You can write the [Sparameters](https://en.wikipedia.org/wiki/Scattering_parameters) for all components in the UBC `ubcpdk.components` PDK using lumerical FDTD plugin in gdsfactory - -# To run simulations uncomment the following lines - -import gdsfactory.simulation as sim -import ubcpdk.components as pdk - -for f in [ - pdk.bend_euler, - pdk.coupler, - pdk.coupler_ring, - pdk.ebeam_y_1550, - pdk.ebeam_crossing4, -]: - component = f() - component.plot() - # ls.write_sparameters_lumerical(component=component) - - -# + -# sp = ls.read.read_sparameters_lumerical(component=ubcpdk.components.straight()) - -# + -# sim.plot_sparameters(sp) -# - - -# ## MEEP FDTD -# -# Meep in an open source FDTD library developed at MIT. -# See [docs](https://meep.readthedocs.io/en/latest/Python_Tutorials/GDSII_Import/) and [code](https://github.com/NanoComp/meep). -# -# You can use the gdsfactory meep plugin to run simulation using meep. You can run examples with `resolution=20` so they run fast. -# -# The resolution is in pixels/um so you need to run with at least `resolution=100` for 1/100 um/pixel (10 nm/ pixel). - -import gdsfactory as gf -import gdsfactory.simulation.gmeep as gm - -c = ubcpdk.components.straight(length=3) -c - -df = gm.write_sparameters_meep_1x1(component=c, run=False) - -df = gm.write_sparameters_meep_1x1(component=c, run=True) - -gm.plot.plot_sparameters(df) - -gm.plot.plot_sparameters(df, logscale=False) - -c = ubcpdk.components.ebeam_y_1550() -c - -df = gm.write_sparameters_meep(component=c, run=False) # lr stands for left-right ports - -df = gm.write_sparameters_meep( - gf.components.coupler_ring(), xmargin=3, ymargin_bot=3, run=False -) # lr stands for left-right ports diff --git a/install_tech.py b/install_tech.py index 42f63d32..658cb5dc 100644 --- a/install_tech.py +++ b/install_tech.py @@ -1,8 +1,8 @@ """Symlink tech to klayout.""" -import sys import os -import shutil import pathlib +import shutil +import sys def remove_path_or_dir(dest: pathlib.Path): diff --git a/pyproject.toml b/pyproject.toml index 591e46fc..671edb61 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,58 +1,45 @@ # https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html + [build-system] -requires = ["flit_core >=3.2,<4"] build-backend = "flit_core.buildapi" +requires = ["flit_core >=3.2,<4"] [project] -name="ubcpdk" -description="ubcpdk pdk" +authors = [ + {name = "gdsfactory", email = "contact@gdsfactory.com"} +] classifiers = [ - "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Operating System :: OS Independent", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Operating System :: OS Independent" ] -version="1.21.4" -authors = [ - {name = "gdsfactory", email = "contact@gdsfactory.com"}, +dependencies = [ + "gdsfactory>=7.1.0,<7.2.0", + "gplugins[tidy3d]>=0.0.3,<0.1.0" ] +description = "ubcpdk pdk" keywords = ["python"] license = {file = "LICENSE"} -dependencies = [ - "gdsfactory[cad,kfactory]==6.109.2", - "modes", -] +name = "ubcpdk" readme = "README.md" -requires-python = ">=3.7" +requires-python = ">=3.10" +version = "1.21.3" [project.optional-dependencies] -full = [ - "gdsfactory[full]==6.109.2", - "modes", - ] - dev = [ - "pytest", - "pytest-cov", - "pytest_regressions", - "femwell" - ] + "pytest", + "pytest-cov", + "pytest_regressions", + "pre-commit" +] docs = [ "autodoc_pydantic", "jupytext", - "jupyter-book==0.15.1", - ] - -[tool.setuptools.packages] -find = {} + "jupyter-book==0.15.1" +] [tool.black] -line-length = 88 -target-version = ['py310'] -include = '\.pyi?$' exclude = ''' # Specify the files/dirs that should be ignored by the black formatter /( \.eggs @@ -68,83 +55,63 @@ exclude = ''' # Specify the files/dirs that should be ignored by the black form | dist )/ ''' - -[tool.pytest.ini_options] -# testpaths = ["tests"] -testpaths = ["ubcpdk/samples", "tests"] -# addopts = --tb=no -# addopts = '--tb=short' -python_files = ["ubcpdk/samples*.py", "tests/*.py"] -# python_files = ["tests/*.py"] -# norecursedirs = ["extra/*.py", 'ubcdpk/simulations/*.py'] - -[tool.flake8] -max-line-length = 88 -max-complexity = 57 -select = ["B","C","E","F","W","T4","B9"] -ignore = [ "E501", "E503", "E722", "W503", "W503", "E203", "B950", "B305", "B018", "B902", "B020", "B905"] -extend-ignore = "RST303" - -exclude = [ - ".git", - "__pycache__", - "lib", - "docs/source/conf.py", - "build", - "dist", - ".ipynb_checkpoints", - ".tox", - "extra", - "deprecated", - ".mypy_cache", - "venv", - "devsim", - ] - -[tool.commitizen] -name = "cz_conventional_commits" -version = "0.1.0" -version_files = [ - "pyproject.toml:version", -] +include = '\.pyi?$' +line-length = 88 +target-version = ['py310'] [tool.mypy] python_version = "3.10" strict = true +[tool.pydocstyle] +add-ignore = ["D100", "D101", "D102", "D103", "D104", "D203", "D405", "D417"] +convention = "google" +inherit = false +match = "(?!test).*\\.py" + [tool.pylsp-mypy] enabled = true live_mode = true strict = true -[tool.isort] -multi_line_output = 3 -line_length = 88 -include_trailing_comma = true - -[tool.setuptools.package-data] -mypkg = ["*.csv", "*.yaml"] - -[tool.pydocstyle] -inherit = false -match = "(?!test).*\\.py" -add-ignore = ["D100","D101","D102","D103","D104","D203","D405","D417"] -convention = "google" +[tool.pytest.ini_options] +# testpaths = ["ubcpdk/samples", "tests"] +# addopts = --tb=no +# addopts = '--tb=short' +# python_files = ["ubcpdk/samples*.py", "tests/*.py"] +python_files = ["tests/*.py"] +testpaths = ["tests"] [tool.ruff] -select = [ - "E", # pycodestyle errors - "W", # pycodestyle warnings - "F", # pyflakes - # "I", # isort - "C", # flake8-comprehensions - "B", # flake8-bugbear -] +extend-exclude = ["docs/notebooks"] ignore = [ - "E501", # line too long, handled by black - "B008", # do not perform function calls in argument defaults - "C901", # too complex - "B905", # `zip()` without an explicit `strict=` parameter - "C408", # C408 Unnecessary `dict` call (rewrite as a literal) + "E501", # line too long, handled by black + "B008", # do not perform function calls in argument defaults + "C901", # too complex + "B905", # `zip()` without an explicit `strict=` parameter + "C408" # C408 Unnecessary `dict` call (rewrite as a literal) ] -extend-exclude = ["docs/notebooks"] +select = [ + "E", # pycodestyle errors + "W", # pycodestyle warnings + "F", # pyflakes + "I", # isort + "C", # flake8-comprehensions + "B", # flake8-bugbear + "UP" +] + +[tool.ruff.per-file-ignores] +"ubcpdk/samples/notebooks/11_sparameters.py" = ['E402'] +"ubcpdk/samples/notebooks/12_sim_plugins_tidy3d.py" = ['E402'] +"ubcpdk/samples/notebooks/13_sim_plugins.py" = ['E402'] +"ubcpdk/samples/notebooks/14_sax_tidy3d.py" = ['E402'] +"ubcpdk/samples/notebooks/21_schematic_driven_layout.py" = ['E402'] +"ubcpdk/samples/notebooks/31_data_analysis_mzi.py" = ['E402'] +"ubcpdk/samples/notebooks/33_data_analysis_dbr.py" = ['E402'] + +[tool.setuptools.package-data] +mypkg = ["*.csv", "*.yaml"] + +[tool.setuptools.packages] +find = {} diff --git a/sparameters/straight_length3_d34ef86b690da3f9c50cb80b5cf3ff11.npz b/sparameters/straight_length3_d34ef86b690da3f9c50cb80b5cf3ff11.npz new file mode 100644 index 00000000..dbf73d5e Binary files /dev/null and b/sparameters/straight_length3_d34ef86b690da3f9c50cb80b5cf3ff11.npz differ diff --git a/sparameters/straight_length3_d34ef86b690da3f9c50cb80b5cf3ff11.yml b/sparameters/straight_length3_d34ef86b690da3f9c50cb80b5cf3ff11.yml new file mode 100644 index 00000000..56d99879 --- /dev/null +++ b/sparameters/straight_length3_d34ef86b690da3f9c50cb80b5cf3ff11.yml @@ -0,0 +1,368 @@ +component: + name: straight_length3 + ports: + o1: + center: + - 0.0 + - 0.0 + layer: + - 1 + - 0 + name: o1 + orientation: 180.0 + port_type: optical + shear_angle: null + width: 0.5 + o2: + center: + - 3.0 + - 0.0 + layer: + - 1 + - 0 + name: o2 + orientation: 0.0 + port_type: optical + shear_angle: null + width: 0.5 + settings: + changed: + length: 3 + child: null + default: + cross_section: strip + length: 10.0 + npoints: 2 + with_bbox: true + full: + cross_section: strip + length: 3 + npoints: 2 + with_bbox: true + function_name: straight + info: + cross_section: strip + function_name: cross_section + length: 3.0 + route_info: + length: 3.0 + type: + auto_widen: false + auto_widen_minimum_length: 200.0 + bbox_layers: [] + bbox_offsets: [] + cladding_layers: + - DEVREC + cladding_offsets: + - 0.0 + cladding_simplify: null + end_straight_length: 0.01 + gap: 3.0 + info: + function_name: cross_section + settings: + add_bbox: null + add_pins: + function: add_pins_siepic + auto_widen: false + auto_widen_minimum_length: 200.0 + bbox_layers: null + bbox_offsets: null + cladding_layers: + - DEVREC + cladding_offsets: + - 0 + cladding_simplify: null + decorator: null + end_straight_length: 0.01 + gap: 3.0 + info: null + layer: WG + min_length: 0.01 + mirror: false + name: null + offset: 0 + port_names: + - o1 + - o2 + port_types: + - optical + - optical + radius: 10.0 + sections: null + snap_to_grid: null + start_straight_length: 0.01 + taper_length: 10.0 + width: 0.5 + width_wide: null + layer: WG + min_length: 0.01 + mirror: false + name: null + offset: 0.0 + port_names: + - o1 + - o2 + port_types: + - optical + - optical + radius: 10.0 + sections: [] + simplify: null + snap_to_grid: null + start_straight_length: 0.01 + taper_length: 10.0 + width: 0.5 + width_wide: null + weight: 3.0 + ? '{''layer'': ''WG'', ''width'': 0.5, ''offset'': 0.0, ''radius'': 10.0, + ''width_wide'': None, ''simplify'': None, ''auto_widen'': False, ''auto_widen_minimum_length'': + 200.0, ''taper_length'': 10.0, ''bbox_layers'': [], ''bbox_offsets'': [], + ''cladding_layers'': [''DEVREC''], ''cladding_offsets'': [0.0], ''cladding_simplify'': + None, ''sections'': [], ''port_names'': [''o1'', ''o2''], ''port_types'': + [''optical'', ''optical''], ''gap'': 3.0, ''min_length'': 0.01, ''start_straight_length'': + 0.01, ''end_straight_length'': 0.01, ''snap_to_grid'': None, ''info'': {''settings'': + {''width'': 0.5, ''offset'': 0, ''layer'': ''WG'', ''width_wide'': None, + ''auto_widen'': False, ''auto_widen_minimum_length'': 200.0, ''taper_length'': + 10.0, ''radius'': 10.0, ''sections'': None, ''port_names'': [''o1'', ''o2''], + ''port_types'': [''optical'', ''optical''], ''gap'': 3.0, ''min_length'': + 0.01, ''start_straight_length'': 0.01, ''end_straight_length'': 0.01, ''snap_to_grid'': + None, ''bbox_layers'': None, ''bbox_offsets'': None, ''cladding_layers'': + [''DEVREC''], ''cladding_offsets'': [0], ''cladding_simplify'': None, ''info'': + None, ''decorator'': None, ''add_pins'': {''function'': ''add_pins_siepic''}, + ''add_bbox'': None, ''mirror'': False, ''name'': None}, ''function_name'': + ''cross_section''}, ''name'': None, ''mirror'': False}_length' + : 3.0 + settings: + add_bbox: null + add_pins: + function: add_pins_siepic + auto_widen: false + auto_widen_minimum_length: 200.0 + bbox_layers: null + bbox_offsets: null + cladding_layers: + - DEVREC + cladding_offsets: + - 0 + cladding_simplify: null + decorator: null + end_straight_length: 0.01 + gap: 3.0 + info: null + layer: WG + min_length: 0.01 + mirror: false + name: null + offset: 0 + port_names: + - o1 + - o2 + port_types: + - optical + - optical + radius: 10.0 + sections: null + snap_to_grid: null + start_straight_length: 0.01 + taper_length: 10.0 + width: 0.5 + width_wide: null + width: 0.5 + info_version: 2 + module: gdsfactory.components.straight + name: straight_length3 +compute_time_minutes: 0.1275598446528117 +compute_time_seconds: 7.653590679168701 +dispersive: false +is_3d: false +layer_stack: + box: + background_doping_concentration: null + background_doping_ion: null + bias: null + derived_layer: null + info: + mesh_order: 99 + into: null + layer: !!python/tuple + - 99999 + - 0 + layer_type: grow + material: sio2 + mesh_order: 3 + mode: null + orientation: '100' + resistivity: null + sidewall_angle: 0.0 + sidewall_angle_tolerance: null + thickness: 3.0 + thickness_tolerance: null + width_to_z: 0.0 + z_to_bias: null + zmin: -3.0 + zmin_tolerance: null + clad: + background_doping_concentration: null + background_doping_ion: null + bias: null + derived_layer: null + info: + mesh_order: 100 + into: null + layer: !!python/tuple + - 99999 + - 0 + layer_type: grow + material: sio2 + mesh_order: 3 + mode: null + orientation: '100' + resistivity: null + sidewall_angle: 0.0 + sidewall_angle_tolerance: null + thickness: 1.8000000000000003 + thickness_tolerance: null + width_to_z: 0.0 + z_to_bias: null + zmin: 0.0 + zmin_tolerance: null + core: + background_doping_concentration: null + background_doping_ion: null + bias: null + derived_layer: null + info: + mesh_order: 1 + into: null + layer: !!python/tuple + - 1 + - 0 + layer_type: grow + material: si + mesh_order: 3 + mode: null + orientation: '100' + resistivity: null + sidewall_angle: 10.0 + sidewall_angle_tolerance: null + thickness: 0.22 + thickness_tolerance: null + width_to_z: 0.5 + z_to_bias: null + zmin: 0.0 + zmin_tolerance: null + core2: + background_doping_concentration: null + background_doping_ion: null + bias: null + derived_layer: null + info: + mesh_order: 1 + into: null + layer: !!python/tuple + - 31 + - 0 + layer_type: grow + material: si + mesh_order: 3 + mode: null + orientation: '100' + resistivity: null + sidewall_angle: 10.0 + sidewall_angle_tolerance: null + thickness: 0.22 + thickness_tolerance: null + width_to_z: 0.5 + z_to_bias: null + zmin: 0.0 + zmin_tolerance: null + heater: + background_doping_concentration: null + background_doping_ion: null + bias: null + derived_layer: null + info: + mesh_order: 1 + into: null + layer: !!python/tuple + - 11 + - 0 + layer_type: grow + material: TiN + mesh_order: 3 + mode: null + orientation: '100' + resistivity: null + sidewall_angle: 0.0 + sidewall_angle_tolerance: null + thickness: 0.75 + thickness_tolerance: null + width_to_z: 0.0 + z_to_bias: null + zmin: 1.1 + zmin_tolerance: null + metal2: + background_doping_concentration: null + background_doping_ion: null + bias: null + derived_layer: null + info: + mesh_order: 2 + into: null + layer: !!python/tuple + - 12 + - 0 + layer_type: grow + material: Aluminum + mesh_order: 3 + mode: null + orientation: '100' + resistivity: null + sidewall_angle: 0.0 + sidewall_angle_tolerance: null + thickness: 0.7000000000000001 + thickness_tolerance: null + width_to_z: 0.0 + z_to_bias: null + zmin: 1.8000000000000003 + zmin_tolerance: null + substrate: + background_doping_concentration: null + background_doping_ion: null + bias: null + derived_layer: null + info: + mesh_order: 99 + into: null + layer: !!python/tuple + - 99999 + - 0 + layer_type: grow + material: si + mesh_order: 3 + mode: null + orientation: '100' + resistivity: null + sidewall_angle: 0.0 + sidewall_angle_tolerance: null + thickness: 10.0 + thickness_tolerance: null + width_to_z: 0.0 + z_to_bias: null + zmin: -13.0 + zmin_tolerance: null +port_margin: 2 +port_monitor_offset: -0.1 +port_source_offset: -0.1 +port_symmetries: + o2@0,o1@0: + - o1@0,o2@0 +resolution: 30 +wavelength_points: 50 +wavelength_start: 1.5 +wavelength_stop: 1.6 +xmargin_left: 0 +xmargin_right: 0 +ymargin_bot: 3 +ymargin_top: 3 diff --git a/test.schem.yml b/test.schem.yml new file mode 100644 index 00000000..6db43a95 --- /dev/null +++ b/test.schem.yml @@ -0,0 +1,12 @@ +instances: + s1: + component: straight + settings: {length: 20} + s2: + component: straight + settings: {length: 40} +schematic_placements: + s1: {x: null, y: null, port: null, rotation: 0, dx: null, dy: null, mirror: null} + s2: {x: null, y: null, port: null, rotation: 0, dx: null, dy: null, mirror: null} +nets: [] +ports: {} diff --git a/tests/ref/add_fiber_array_pads_rf.gds b/tests/ref/add_fiber_array_pads_rf.gds index 5d0ec0f9..ee6639b7 100644 Binary files a/tests/ref/add_fiber_array_pads_rf.gds and b/tests/ref/add_fiber_array_pads_rf.gds differ diff --git a/tests/ref/dbg.gds b/tests/ref/dbg.gds index 0d35e742..991818e0 100644 Binary files a/tests/ref/dbg.gds and b/tests/ref/dbg.gds differ diff --git a/tests/ref/dbr_cavity.gds b/tests/ref/dbr_cavity.gds index 32093144..8b316ea3 100644 Binary files a/tests/ref/dbr_cavity.gds and b/tests/ref/dbr_cavity.gds differ diff --git a/tests/ref/dbr_cavity_add_fiber_ar_f2ab6ad2.gds b/tests/ref/dbr_cavity_add_fiber_ar_f2ab6ad2.gds index 11fb5110..0ceb2122 100644 Binary files a/tests/ref/dbr_cavity_add_fiber_ar_f2ab6ad2.gds and b/tests/ref/dbr_cavity_add_fiber_ar_f2ab6ad2.gds differ diff --git a/tests/ref/mzi_ab5edfa6.gds b/tests/ref/mzi_ab5edfa6.gds index 35063f1b..109de17e 100644 Binary files a/tests/ref/mzi_ab5edfa6.gds and b/tests/ref/mzi_ab5edfa6.gds differ diff --git a/tests/ref/pad_array_71569d1c.gds b/tests/ref/pad_array_71569d1c.gds index 53709355..71b20d4f 100644 Binary files a/tests/ref/pad_array_71569d1c.gds and b/tests/ref/pad_array_71569d1c.gds differ diff --git a/tests/ref/ring_double_heater_171f554b.gds b/tests/ref/ring_double_heater_171f554b.gds index 32de60a2..eb9c9e05 100644 Binary files a/tests/ref/ring_double_heater_171f554b.gds and b/tests/ref/ring_double_heater_171f554b.gds differ diff --git a/tests/ref/ring_single_heater_171f554b.gds b/tests/ref/ring_single_heater_171f554b.gds index e9fed9bc..f2693a74 100644 Binary files a/tests/ref/ring_single_heater_171f554b.gds and b/tests/ref/ring_single_heater_171f554b.gds differ diff --git a/tests/ref/ring_single_heater_171f_5dab5bcc.gds b/tests/ref/ring_single_heater_171f_5dab5bcc.gds index d7361c84..cf18a780 100644 Binary files a/tests/ref/ring_single_heater_171f_5dab5bcc.gds and b/tests/ref/ring_single_heater_171f_5dab5bcc.gds differ diff --git a/tests/ref/ring_single_heater_171f_ac60d9ba.gds b/tests/ref/ring_single_heater_171f_ac60d9ba.gds index b8627121..2c164004 100644 Binary files a/tests/ref/ring_single_heater_171f_ac60d9ba.gds and b/tests/ref/ring_single_heater_171f_ac60d9ba.gds differ diff --git a/tests/ref/via_stack_627f28a4.gds b/tests/ref/via_stack_627f28a4.gds index f0864f7d..8abc2b4b 100644 Binary files a/tests/ref/via_stack_627f28a4.gds and b/tests/ref/via_stack_627f28a4.gds differ diff --git a/tests/test_components.py b/tests/test_components.py index cf7a091f..58279767 100644 --- a/tests/test_components.py +++ b/tests/test_components.py @@ -1,11 +1,11 @@ import pathlib -import pytest -from pytest_regressions.data_regression import DataRegressionFixture +import pytest from gdsfactory.component import Component from gdsfactory.difftest import difftest -from ubcpdk import cells +from pytest_regressions.data_regression import DataRegressionFixture +from ubcpdk import cells skip_test = { "add_siepic_labels", @@ -36,8 +36,8 @@ def test_pdk_settings( component: Component, data_regression: DataRegressionFixture ) -> None: """Avoid regressions when exporting settings.""" - data_regression.check(component.to_dict()) + data_regression.check(component.to_dict(with_ports=False)) -def test_assert_ports_on_grid(component: Component): +def test_assert_ports_on_grid(component: Component) -> None: component.assert_ports_on_grid() diff --git a/tests/test_components/test_pdk_settings_add_fiber_array_.yml b/tests/test_components/test_pdk_settings_add_fiber_array_.yml index 4ea919fa..07b7cccd 100644 --- a/tests/test_components/test_pdk_settings_add_fiber_array_.yml +++ b/tests/test_components/test_pdk_settings_add_fiber_array_.yml @@ -1,29 +1,4 @@ name: straight_add_fiber_arra_448312f9 -ports: - opt-mirror_948d7eaf_gc_te1550-straight-o1: - center: - - -16.2 - - 58.5 - layer: - - 1 - - 0 - name: opt-mirror_948d7eaf_gc_te1550-straight-o1 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 - opt-mirror_948d7eaf_gc_te1550-straight-o2: - center: - - -16.2 - - -68.5 - layer: - - 1 - - 0 - name: opt-mirror_948d7eaf_gc_te1550-straight-o2 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: {} child: @@ -62,6 +37,96 @@ settings: cross_section: strip function_name: cross_section length: 10.0 + route_info: + length: 10.0 + type: + auto_widen: false + auto_widen_minimum_length: 200.0 + bbox_layers: [] + bbox_offsets: [] + cladding_layers: + - DEVREC + cladding_offsets: + - 0.0 + cladding_simplify: null + end_straight_length: 0.01 + gap: 3.0 + info: + function_name: cross_section + settings: + add_bbox: null + add_pins: + function: add_pins_siepic + auto_widen: false + auto_widen_minimum_length: 200.0 + bbox_layers: null + bbox_offsets: null + cladding_layers: + - DEVREC + cladding_offsets: + - 0 + cladding_simplify: null + decorator: null + end_straight_length: 0.01 + gap: 3.0 + info: null + layer: WG + min_length: 0.01 + mirror: false + name: null + offset: 0 + port_names: + - o1 + - o2 + port_types: + - optical + - optical + radius: 10.0 + sections: null + snap_to_grid: null + start_straight_length: 0.01 + taper_length: 10.0 + width: 0.5 + width_wide: null + layer: WG + min_length: 0.01 + mirror: false + name: null + offset: 0.0 + port_names: + - o1 + - o2 + port_types: + - optical + - optical + radius: 10.0 + sections: [] + simplify: null + snap_to_grid: null + start_straight_length: 0.01 + taper_length: 10.0 + width: 0.5 + width_wide: null + weight: 10.0 + ? '{''layer'': ''WG'', ''width'': 0.5, ''offset'': 0.0, ''radius'': 10.0, + ''width_wide'': None, ''simplify'': None, ''auto_widen'': False, ''auto_widen_minimum_length'': + 200.0, ''taper_length'': 10.0, ''bbox_layers'': [], ''bbox_offsets'': + [], ''cladding_layers'': [''DEVREC''], ''cladding_offsets'': [0.0], ''cladding_simplify'': + None, ''sections'': [], ''port_names'': [''o1'', ''o2''], ''port_types'': + [''optical'', ''optical''], ''gap'': 3.0, ''min_length'': 0.01, ''start_straight_length'': + 0.01, ''end_straight_length'': 0.01, ''snap_to_grid'': None, ''info'': + {''settings'': {''width'': 0.5, ''offset'': 0, ''layer'': ''WG'', ''width_wide'': + None, ''auto_widen'': False, ''auto_widen_minimum_length'': 200.0, ''taper_length'': + 10.0, ''radius'': 10.0, ''sections'': None, ''port_names'': [''o1'', ''o2''], + ''port_types'': [''optical'', ''optical''], ''gap'': 3.0, ''min_length'': + 0.01, ''start_straight_length'': 0.01, ''end_straight_length'': 0.01, + ''snap_to_grid'': None, ''bbox_layers'': None, ''bbox_offsets'': None, + ''cladding_layers'': [''DEVREC''], ''cladding_offsets'': [0], ''cladding_simplify'': + None, ''info'': None, ''decorator'': None, ''add_pins'': {''function'': + ''add_pins_siepic''}, ''add_bbox'': None, ''mirror'': False, ''name'': + None}, ''function_name'': ''cross_section''}, ''name'': None, ''mirror'': + False}_length' + : 10.0 settings: add_bbox: null add_pins: @@ -118,7 +183,7 @@ settings: settings: polarization: te taper_angle: 35 - layer_label: TEXT + layer_label: LABEL select_ports: function: select_ports settings: @@ -158,6 +223,95 @@ settings: polarization: te wavelength: 1.55 length: 10.0 + route_info: + length: 10.0 + type: + auto_widen: false + auto_widen_minimum_length: 200.0 + bbox_layers: [] + bbox_offsets: [] + cladding_layers: + - DEVREC + cladding_offsets: + - 0.0 + cladding_simplify: null + end_straight_length: 0.01 + gap: 3.0 + info: + function_name: cross_section + settings: + add_bbox: null + add_pins: + function: add_pins_siepic + auto_widen: false + auto_widen_minimum_length: 200.0 + bbox_layers: null + bbox_offsets: null + cladding_layers: + - DEVREC + cladding_offsets: + - 0 + cladding_simplify: null + decorator: null + end_straight_length: 0.01 + gap: 3.0 + info: null + layer: WG + min_length: 0.01 + mirror: false + name: null + offset: 0 + port_names: + - o1 + - o2 + port_types: + - optical + - optical + radius: 10.0 + sections: null + snap_to_grid: null + start_straight_length: 0.01 + taper_length: 10.0 + width: 0.5 + width_wide: null + layer: WG + min_length: 0.01 + mirror: false + name: null + offset: 0.0 + port_names: + - o1 + - o2 + port_types: + - optical + - optical + radius: 10.0 + sections: [] + simplify: null + snap_to_grid: null + start_straight_length: 0.01 + taper_length: 10.0 + width: 0.5 + width_wide: null + weight: 10.0 + ? '{''layer'': ''WG'', ''width'': 0.5, ''offset'': 0.0, ''radius'': 10.0, + ''width_wide'': None, ''simplify'': None, ''auto_widen'': False, ''auto_widen_minimum_length'': + 200.0, ''taper_length'': 10.0, ''bbox_layers'': [], ''bbox_offsets'': [], + ''cladding_layers'': [''DEVREC''], ''cladding_offsets'': [0.0], ''cladding_simplify'': + None, ''sections'': [], ''port_names'': [''o1'', ''o2''], ''port_types'': + [''optical'', ''optical''], ''gap'': 3.0, ''min_length'': 0.01, ''start_straight_length'': + 0.01, ''end_straight_length'': 0.01, ''snap_to_grid'': None, ''info'': {''settings'': + {''width'': 0.5, ''offset'': 0, ''layer'': ''WG'', ''width_wide'': None, + ''auto_widen'': False, ''auto_widen_minimum_length'': 200.0, ''taper_length'': + 10.0, ''radius'': 10.0, ''sections'': None, ''port_names'': [''o1'', ''o2''], + ''port_types'': [''optical'', ''optical''], ''gap'': 3.0, ''min_length'': + 0.01, ''start_straight_length'': 0.01, ''end_straight_length'': 0.01, ''snap_to_grid'': + None, ''bbox_layers'': None, ''bbox_offsets'': None, ''cladding_layers'': + [''DEVREC''], ''cladding_offsets'': [0], ''cladding_simplify'': None, ''info'': + None, ''decorator'': None, ''add_pins'': {''function'': ''add_pins_siepic''}, + ''add_bbox'': None, ''mirror'': False, ''name'': None}, ''function_name'': + ''cross_section''}, ''name'': None, ''mirror'': False}_length' + : 10.0 settings: add_bbox: null add_pins: @@ -243,6 +397,95 @@ settings: polarization: te wavelength: 1.55 length: 10.0 + route_info: + length: 10.0 + type: + auto_widen: false + auto_widen_minimum_length: 200.0 + bbox_layers: [] + bbox_offsets: [] + cladding_layers: + - DEVREC + cladding_offsets: + - 0.0 + cladding_simplify: null + end_straight_length: 0.01 + gap: 3.0 + info: + function_name: cross_section + settings: + add_bbox: null + add_pins: + function: add_pins_siepic + auto_widen: false + auto_widen_minimum_length: 200.0 + bbox_layers: null + bbox_offsets: null + cladding_layers: + - DEVREC + cladding_offsets: + - 0 + cladding_simplify: null + decorator: null + end_straight_length: 0.01 + gap: 3.0 + info: null + layer: WG + min_length: 0.01 + mirror: false + name: null + offset: 0 + port_names: + - o1 + - o2 + port_types: + - optical + - optical + radius: 10.0 + sections: null + snap_to_grid: null + start_straight_length: 0.01 + taper_length: 10.0 + width: 0.5 + width_wide: null + layer: WG + min_length: 0.01 + mirror: false + name: null + offset: 0.0 + port_names: + - o1 + - o2 + port_types: + - optical + - optical + radius: 10.0 + sections: [] + simplify: null + snap_to_grid: null + start_straight_length: 0.01 + taper_length: 10.0 + width: 0.5 + width_wide: null + weight: 10.0 + ? '{''layer'': ''WG'', ''width'': 0.5, ''offset'': 0.0, ''radius'': 10.0, ''width_wide'': + None, ''simplify'': None, ''auto_widen'': False, ''auto_widen_minimum_length'': + 200.0, ''taper_length'': 10.0, ''bbox_layers'': [], ''bbox_offsets'': [], + ''cladding_layers'': [''DEVREC''], ''cladding_offsets'': [0.0], ''cladding_simplify'': + None, ''sections'': [], ''port_names'': [''o1'', ''o2''], ''port_types'': + [''optical'', ''optical''], ''gap'': 3.0, ''min_length'': 0.01, ''start_straight_length'': + 0.01, ''end_straight_length'': 0.01, ''snap_to_grid'': None, ''info'': {''settings'': + {''width'': 0.5, ''offset'': 0, ''layer'': ''WG'', ''width_wide'': None, ''auto_widen'': + False, ''auto_widen_minimum_length'': 200.0, ''taper_length'': 10.0, ''radius'': + 10.0, ''sections'': None, ''port_names'': [''o1'', ''o2''], ''port_types'': + [''optical'', ''optical''], ''gap'': 3.0, ''min_length'': 0.01, ''start_straight_length'': + 0.01, ''end_straight_length'': 0.01, ''snap_to_grid'': None, ''bbox_layers'': + None, ''bbox_offsets'': None, ''cladding_layers'': [''DEVREC''], ''cladding_offsets'': + [0], ''cladding_simplify'': None, ''info'': None, ''decorator'': None, ''add_pins'': + {''function'': ''add_pins_siepic''}, ''add_bbox'': None, ''mirror'': False, + ''name'': None}, ''function_name'': ''cross_section''}, ''name'': None, ''mirror'': + False}_length' + : 10.0 settings: add_bbox: null add_pins: diff --git a/tests/test_components/test_pdk_settings_add_fiber_array_pads_rf_.yml b/tests/test_components/test_pdk_settings_add_fiber_array_pads_rf_.yml index d598b974..bf074037 100644 --- a/tests/test_components/test_pdk_settings_add_fiber_array_pads_rf_.yml +++ b/tests/test_components/test_pdk_settings_add_fiber_array_pads_rf_.yml @@ -1,53 +1,4 @@ name: add_fiber_array_pads_rf -ports: - e1: - center: - - 160.055 - - -60.5 - layer: - - 12 - - 0 - name: e1 - orientation: 180 - port_type: electrical - shear_angle: null - width: 75 - e2: - center: - - 160.055 - - 64.5 - layer: - - 12 - - 0 - name: e2 - orientation: 180 - port_type: electrical - shear_angle: null - width: 75 - opt-mirror_948d7eaf_gc_te1550-ring_single_heater_171f554b-o1: - center: - - -21.0 - - 65.5 - layer: - - 1 - - 0 - name: opt-mirror_948d7eaf_gc_te1550-ring_single_heater_171f554b-o1 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 - opt-mirror_948d7eaf_gc_te1550-ring_single_heater_171f554b-o2: - center: - - -21.0 - - -61.5 - layer: - - 1 - - 0 - name: opt-mirror_948d7eaf_gc_te1550-ring_single_heater_171f554b-o2 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_add_pads_dc_.yml b/tests/test_components/test_pdk_settings_add_pads_dc_.yml index cfcb9a1e..9fee3316 100644 --- a/tests/test_components/test_pdk_settings_add_pads_dc_.yml +++ b/tests/test_components/test_pdk_settings_add_pads_dc_.yml @@ -1,53 +1,4 @@ name: ring_single_heater_171f_5dab5bcc -ports: - elec-ring_single_heater_171f554b-0: - center: - - -64.5 - - 160.055 - layer: - - 12 - - 0 - name: elec-ring_single_heater_171f554b-0 - orientation: 270 - port_type: electrical - shear_angle: null - width: 75 - elec-ring_single_heater_171f554b-1: - center: - - 60.5 - - 160.055 - layer: - - 12 - - 0 - name: elec-ring_single_heater_171f554b-1 - orientation: 270 - port_type: electrical - shear_angle: null - width: 75 - o1: - center: - - -17.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - 13.0 - - 0.0 - layer: - - 1 - - 0 - name: o2 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: component: ring_single_heater @@ -105,7 +56,7 @@ settings: gap: 0.2 length_x: 4.0 length_y: 0.6 - port_orientation: 90 + port_orientation: null radius: 10.0 via_stack: function: via_stack @@ -139,7 +90,7 @@ settings: gap: 0.2 length_x: 4.0 length_y: 0.6 - port_orientation: 90 + port_orientation: null radius: 10.0 via_stack: function: via_stack diff --git a/tests/test_components/test_pdk_settings_add_pads_rf_.yml b/tests/test_components/test_pdk_settings_add_pads_rf_.yml index 7c0b7063..bc1eaa05 100644 --- a/tests/test_components/test_pdk_settings_add_pads_rf_.yml +++ b/tests/test_components/test_pdk_settings_add_pads_rf_.yml @@ -1,53 +1,4 @@ name: ring_single_heater_171f_ac60d9ba -ports: - elec-ring_single_heater_171f554b-1: - center: - - 60.5 - - 160.055 - layer: - - 12 - - 0 - name: elec-ring_single_heater_171f554b-1 - orientation: 270 - port_type: electrical - shear_angle: null - width: 75 - elec-ring_single_heater_171f554b-2: - center: - - -64.5 - - 160.055 - layer: - - 12 - - 0 - name: elec-ring_single_heater_171f554b-2 - orientation: 270 - port_type: electrical - shear_angle: null - width: 75 - o1: - center: - - -17.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - 13.0 - - 0.0 - layer: - - 1 - - 0 - name: o2 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: component: ring_single_heater @@ -105,7 +56,7 @@ settings: gap: 0.2 length_x: 4.0 length_y: 0.6 - port_orientation: 90 + port_orientation: null radius: 10.0 via_stack: function: via_stack @@ -139,7 +90,7 @@ settings: gap: 0.2 length_x: 4.0 length_y: 0.6 - port_orientation: 90 + port_orientation: null radius: 10.0 via_stack: function: via_stack diff --git a/tests/test_components/test_pdk_settings_bend_.yml b/tests/test_components/test_pdk_settings_bend_.yml index e22ee971..cd418723 100644 --- a/tests/test_components/test_pdk_settings_bend_.yml +++ b/tests/test_components/test_pdk_settings_bend_.yml @@ -1,29 +1,4 @@ name: bend_euler -ports: - o1: - center: - - 0.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - 10.0 - - 10.0 - layer: - - 1 - - 0 - name: o2 - orientation: 90 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: {} child: null @@ -50,6 +25,12 @@ settings: length: 16.637 radius: 10.0 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + strip_length: 16.637 + type: strip + weight: 16.637 settings: add_bbox: null add_pins: diff --git a/tests/test_components/test_pdk_settings_bend_euler_.yml b/tests/test_components/test_pdk_settings_bend_euler_.yml index c101a680..7be5b665 100644 --- a/tests/test_components/test_pdk_settings_bend_euler_.yml +++ b/tests/test_components/test_pdk_settings_bend_euler_.yml @@ -1,29 +1,4 @@ name: bend_euler_npoints100 -ports: - o1: - center: - - 0.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - 10.0 - - 10.0 - layer: - - 1 - - 0 - name: o2 - orientation: 90 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: npoints: 100 @@ -51,6 +26,12 @@ settings: length: 16.637 radius: 10.0 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + strip_length: 16.637 + type: strip + weight: 16.637 settings: add_bbox: null add_pins: diff --git a/tests/test_components/test_pdk_settings_bend_s_.yml b/tests/test_components/test_pdk_settings_bend_s_.yml index 6aa79100..e96b3c98 100644 --- a/tests/test_components/test_pdk_settings_bend_s_.yml +++ b/tests/test_components/test_pdk_settings_bend_s_.yml @@ -1,29 +1,4 @@ name: bezier_c3570097_bend_s -ports: - o1: - center: - - 0.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - 11.0 - - 2.0 - layer: - - 1 - - 0 - name: o2 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: {} child: diff --git a/tests/test_components/test_pdk_settings_coupler_.yml b/tests/test_components/test_pdk_settings_coupler_.yml index e22cf23c..c837fbac 100644 --- a/tests/test_components/test_pdk_settings_coupler_.yml +++ b/tests/test_components/test_pdk_settings_coupler_.yml @@ -1,53 +1,4 @@ name: coupler_50c22d89 -ports: - o1: - center: - - -10.0 - - -1.632 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - -10.0 - - 2.368 - layer: - - 1 - - 0 - name: o2 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o3: - center: - - 30.0 - - 2.368 - layer: - - 1 - - 0 - name: o3 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 - o4: - center: - - 30.0 - - -1.632 - layer: - - 1 - - 0 - name: o4 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: cross_section: diff --git a/tests/test_components/test_pdk_settings_coupler_ring_.yml b/tests/test_components/test_pdk_settings_coupler_ring_.yml index 285ff5da..b674ce32 100644 --- a/tests/test_components/test_pdk_settings_coupler_ring_.yml +++ b/tests/test_components/test_pdk_settings_coupler_ring_.yml @@ -1,53 +1,4 @@ name: coupler_ring -ports: - o1: - center: - - -12.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - -9.0 - - 5.7 - layer: - - 1 - - 0 - name: o2 - orientation: 90 - port_type: optical - shear_angle: null - width: 0.5 - o3: - center: - - 5.0 - - 5.7 - layer: - - 1 - - 0 - name: o3 - orientation: 90 - port_type: optical - shear_angle: null - width: 0.5 - o4: - center: - - 8.0 - - 0.0 - layer: - - 1 - - 0 - name: o4 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_dbg_.yml b/tests/test_components/test_pdk_settings_dbg_.yml index 474d9f40..8525fe6f 100644 --- a/tests/test_components/test_pdk_settings_dbg_.yml +++ b/tests/test_components/test_pdk_settings_dbg_.yml @@ -1,29 +1,4 @@ name: dbg -ports: - o1: - center: - - -0.079 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - 15.879 - - 0.0 - layer: - - 1 - - 0 - name: o2 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_dbr_cavity_.yml b/tests/test_components/test_pdk_settings_dbr_cavity_.yml index 68220f4a..70bdbbac 100644 --- a/tests/test_components/test_pdk_settings_dbr_cavity_.yml +++ b/tests/test_components/test_pdk_settings_dbr_cavity_.yml @@ -1,29 +1,4 @@ name: dbr_cavity -ports: - o1: - center: - - -10.0 - - -1.65 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - 10.1 - - -1.65 - layer: - - 1 - - 0 - name: o2 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_dbr_cavity_te_.yml b/tests/test_components/test_pdk_settings_dbr_cavity_te_.yml index fb24ad33..2e536242 100644 --- a/tests/test_components/test_pdk_settings_dbr_cavity_te_.yml +++ b/tests/test_components/test_pdk_settings_dbr_cavity_te_.yml @@ -1,29 +1,4 @@ name: dbr_cavity_add_fiber_ar_f2ab6ad2 -ports: - opt-mirror_948d7eaf_gc_te1550-dbr_cavity-o1: - center: - - -17.9 - - 63.5 - layer: - - 1 - - 0 - name: opt-mirror_948d7eaf_gc_te1550-dbr_cavity-o1 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 - opt-mirror_948d7eaf_gc_te1550-dbr_cavity-o2: - center: - - -17.9 - - -63.5 - layer: - - 1 - - 0 - name: opt-mirror_948d7eaf_gc_te1550-dbr_cavity-o2 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: component: @@ -73,7 +48,7 @@ settings: settings: polarization: te taper_angle: 35 - layer_label: TEXT + layer_label: LABEL select_ports: function: select_ports settings: diff --git a/tests/test_components/test_pdk_settings_ebeam_BondPad_.yml b/tests/test_components/test_pdk_settings_ebeam_BondPad_.yml index 3716504b..a6cf540f 100644 --- a/tests/test_components/test_pdk_settings_ebeam_BondPad_.yml +++ b/tests/test_components/test_pdk_settings_ebeam_BondPad_.yml @@ -1,53 +1,4 @@ name: ebeam_BondPad -ports: - e1: - center: - - -50.0 - - 0.0 - layer: - - 1 - - 11 - name: e1 - orientation: 180 - port_type: electrical - shear_angle: null - width: 15.0 - e2: - center: - - 0.0 - - 50.0 - layer: - - 1 - - 11 - name: e2 - orientation: 90 - port_type: electrical - shear_angle: null - width: 15.0 - e3: - center: - - 50.0 - - 0.0 - layer: - - 1 - - 11 - name: e3 - orientation: 0 - port_type: electrical - shear_angle: null - width: 15.0 - e4: - center: - - 0.0 - - -50.0 - layer: - - 1 - - 11 - name: e4 - orientation: 270 - port_type: electrical - shear_angle: null - width: 15.0 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_ebeam_adiabatic_te1550_.yml b/tests/test_components/test_pdk_settings_ebeam_adiabatic_te1550_.yml index 4e933811..4f6c280b 100644 --- a/tests/test_components/test_pdk_settings_ebeam_adiabatic_te1550_.yml +++ b/tests/test_components/test_pdk_settings_ebeam_adiabatic_te1550_.yml @@ -1,53 +1,4 @@ name: ebeam_adiabatic_te1550 -ports: - o1: - center: - - 0.1 - - -1.5 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - 0.1 - - 1.5 - layer: - - 1 - - 0 - name: o2 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o3: - center: - - 195.9 - - 1.5 - layer: - - 1 - - 0 - name: o3 - orientation: 0 - port_type: optical - shear_angle: null - width: 0.5 - o4: - center: - - 195.9 - - -1.5 - layer: - - 1 - - 0 - name: o4 - orientation: 0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_ebeam_adiabatic_tm1550_.yml b/tests/test_components/test_pdk_settings_ebeam_adiabatic_tm1550_.yml index bf8f0abf..215384f5 100644 --- a/tests/test_components/test_pdk_settings_ebeam_adiabatic_tm1550_.yml +++ b/tests/test_components/test_pdk_settings_ebeam_adiabatic_tm1550_.yml @@ -1,53 +1,4 @@ name: ebeam_adiabatic_tm1550 -ports: - o1: - center: - - 0.1 - - -1.5 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - 0.1 - - 1.5 - layer: - - 1 - - 0 - name: o2 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o3: - center: - - 217.9 - - 1.5 - layer: - - 1 - - 0 - name: o3 - orientation: 0 - port_type: optical - shear_angle: null - width: 0.5 - o4: - center: - - 217.9 - - -1.5 - layer: - - 1 - - 0 - name: o4 - orientation: 0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_ebeam_bdc_te1550_.yml b/tests/test_components/test_pdk_settings_ebeam_bdc_te1550_.yml index 7ed22a05..d7b19a21 100644 --- a/tests/test_components/test_pdk_settings_ebeam_bdc_te1550_.yml +++ b/tests/test_components/test_pdk_settings_ebeam_bdc_te1550_.yml @@ -1,53 +1,4 @@ name: ebeam_bdc_te1550 -ports: - o1: - center: - - -35.45 - - -2.35 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - -35.45 - - 2.35 - layer: - - 1 - - 0 - name: o2 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o3: - center: - - 35.3 - - 2.35 - layer: - - 1 - - 0 - name: o3 - orientation: 0 - port_type: optical - shear_angle: null - width: 0.5 - o4: - center: - - 35.3 - - -2.35 - layer: - - 1 - - 0 - name: o4 - orientation: 0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_ebeam_bdc_tm1550_.yml b/tests/test_components/test_pdk_settings_ebeam_bdc_tm1550_.yml index 3c2f97d9..0b848934 100644 --- a/tests/test_components/test_pdk_settings_ebeam_bdc_tm1550_.yml +++ b/tests/test_components/test_pdk_settings_ebeam_bdc_tm1550_.yml @@ -1,53 +1,4 @@ name: ebeam_bdc_tm1550 -ports: - o1: - center: - - 0.1 - - 2.4 - layer: - - 1 - - 0 - name: o1 - orientation: 0 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - 35.7 - - 2.4 - layer: - - 1 - - 0 - name: o2 - orientation: 0 - port_type: optical - shear_angle: null - width: 0.5 - o3: - center: - - 0.1 - - -2.4 - layer: - - 1 - - 0 - name: o3 - orientation: 0 - port_type: optical - shear_angle: null - width: 0.5 - o4: - center: - - 35.7 - - -2.4 - layer: - - 1 - - 0 - name: o4 - orientation: 0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_ebeam_crossing4_.yml b/tests/test_components/test_pdk_settings_ebeam_crossing4_.yml index 1ea02118..3d4e8b6f 100644 --- a/tests/test_components/test_pdk_settings_ebeam_crossing4_.yml +++ b/tests/test_components/test_pdk_settings_ebeam_crossing4_.yml @@ -1,53 +1,4 @@ name: ebeam_crossing4 -ports: - o1: - center: - - -4.8 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - 0.0 - - 4.8 - layer: - - 1 - - 0 - name: o2 - orientation: 90 - port_type: optical - shear_angle: null - width: 0.5 - o3: - center: - - 4.8 - - 0.0 - layer: - - 1 - - 0 - name: o3 - orientation: 0 - port_type: optical - shear_angle: null - width: 0.5 - o4: - center: - - 0.0 - - -4.8 - layer: - - 1 - - 0 - name: o4 - orientation: 270 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_ebeam_crossing4_2ports_.yml b/tests/test_components/test_pdk_settings_ebeam_crossing4_2ports_.yml index a29a6daf..bbe9c5c2 100644 --- a/tests/test_components/test_pdk_settings_ebeam_crossing4_2ports_.yml +++ b/tests/test_components/test_pdk_settings_ebeam_crossing4_2ports_.yml @@ -1,29 +1,4 @@ name: ebeam_crossing4_2ports -ports: - o1: - center: - - -4.8 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o4: - center: - - 4.8 - - 0.0 - layer: - - 1 - - 0 - name: o4 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_ebeam_dc_halfring_straight_.yml b/tests/test_components/test_pdk_settings_ebeam_dc_halfring_straight_.yml index 48f56bc8..f984fcc7 100644 --- a/tests/test_components/test_pdk_settings_ebeam_dc_halfring_straight_.yml +++ b/tests/test_components/test_pdk_settings_ebeam_dc_halfring_straight_.yml @@ -1,53 +1,4 @@ name: ebeam_dc_halfring_straight -ports: - o1: - center: - - -12.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - -9.0 - - 5.7 - layer: - - 1 - - 0 - name: o2 - orientation: 90 - port_type: optical - shear_angle: null - width: 0.5 - o3: - center: - - 5.0 - - 5.7 - layer: - - 1 - - 0 - name: o3 - orientation: 90 - port_type: optical - shear_angle: null - width: 0.5 - o4: - center: - - 8.0 - - 0.0 - layer: - - 1 - - 0 - name: o4 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_ebeam_dc_te1550_.yml b/tests/test_components/test_pdk_settings_ebeam_dc_te1550_.yml index ab74048b..a0e7a922 100644 --- a/tests/test_components/test_pdk_settings_ebeam_dc_te1550_.yml +++ b/tests/test_components/test_pdk_settings_ebeam_dc_te1550_.yml @@ -1,53 +1,4 @@ name: coupler_d51b16db -ports: - o1: - center: - - -10.0 - - -1.632 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - -10.0 - - 2.368 - layer: - - 1 - - 0 - name: o2 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o3: - center: - - 30.0 - - 2.368 - layer: - - 1 - - 0 - name: o3 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 - o4: - center: - - 30.0 - - -1.632 - layer: - - 1 - - 0 - name: o4 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: decorator: diff --git a/tests/test_components/test_pdk_settings_ebeam_splitter_adiabatic_swg_te1550_.yml b/tests/test_components/test_pdk_settings_ebeam_splitter_adiabatic_swg_te1550_.yml index 5a8b6851..5ddc00b8 100644 --- a/tests/test_components/test_pdk_settings_ebeam_splitter_adiabatic_swg_te1550_.yml +++ b/tests/test_components/test_pdk_settings_ebeam_splitter_adiabatic_swg_te1550_.yml @@ -1,53 +1,4 @@ name: ebeam_splitter_adiabati_f8376e78 -ports: - o1: - center: - - 0.0 - - 20.31 - layer: - - 1 - - 0 - name: o1 - orientation: 90 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - 0.0 - - -20.31 - layer: - - 1 - - 0 - name: o2 - orientation: 90 - port_type: optical - shear_angle: null - width: 0.5 - o3: - center: - - 82.0 - - 20.31 - layer: - - 1 - - 0 - name: o3 - orientation: 90 - port_type: optical - shear_angle: null - width: 0.5 - o4: - center: - - 82.0 - - -20.31 - layer: - - 1 - - 0 - name: o4 - orientation: 270 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_ebeam_splitter_swg_assist_te1310_.yml b/tests/test_components/test_pdk_settings_ebeam_splitter_swg_assist_te1310_.yml index 46f36f28..fb197526 100644 --- a/tests/test_components/test_pdk_settings_ebeam_splitter_swg_assist_te1310_.yml +++ b/tests/test_components/test_pdk_settings_ebeam_splitter_swg_assist_te1310_.yml @@ -1,53 +1,4 @@ name: ebeam_splitter_swg_assist_te1310 -ports: - o1: - center: - - -63.001 - - -2.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.35 - o2: - center: - - -63.001 - - 2.0 - layer: - - 1 - - 0 - name: o2 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.35 - o3: - center: - - 63.001 - - 2.0 - layer: - - 1 - - 0 - name: o3 - orientation: 0 - port_type: optical - shear_angle: null - width: 0.35 - o4: - center: - - 63.001 - - -2.0 - layer: - - 1 - - 0 - name: o4 - orientation: 0 - port_type: optical - shear_angle: null - width: 0.35 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_ebeam_splitter_swg_assist_te1550_.yml b/tests/test_components/test_pdk_settings_ebeam_splitter_swg_assist_te1550_.yml index 9e00c807..6bfa80f7 100644 --- a/tests/test_components/test_pdk_settings_ebeam_splitter_swg_assist_te1550_.yml +++ b/tests/test_components/test_pdk_settings_ebeam_splitter_swg_assist_te1550_.yml @@ -1,41 +1,4 @@ name: ebeam_splitter_swg_assist_te1550 -ports: - o1: - center: - - -63.001 - - -1.975 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - -63.001 - - 1.975 - layer: - - 1 - - 0 - name: o2 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o3: - center: - - 63.001 - - -1.975 - layer: - - 1 - - 0 - name: o3 - orientation: 0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_ebeam_swg_edgecoupler_.yml b/tests/test_components/test_pdk_settings_ebeam_swg_edgecoupler_.yml index ae4a2a93..9c3d7de1 100644 --- a/tests/test_components/test_pdk_settings_ebeam_swg_edgecoupler_.yml +++ b/tests/test_components/test_pdk_settings_ebeam_swg_edgecoupler_.yml @@ -1,17 +1,4 @@ name: ebeam_swg_edgecoupler -ports: - o1: - center: - - -79.3 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_ebeam_terminator_te1310_.yml b/tests/test_components/test_pdk_settings_ebeam_terminator_te1310_.yml index 71e59328..081c9017 100644 --- a/tests/test_components/test_pdk_settings_ebeam_terminator_te1310_.yml +++ b/tests/test_components/test_pdk_settings_ebeam_terminator_te1310_.yml @@ -1,17 +1,4 @@ name: ebeam_terminator_te1310 -ports: - o1: - center: - - 0.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.35 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_ebeam_terminator_te1550_.yml b/tests/test_components/test_pdk_settings_ebeam_terminator_te1550_.yml index 1906ff4b..f279b0a5 100644 --- a/tests/test_components/test_pdk_settings_ebeam_terminator_te1550_.yml +++ b/tests/test_components/test_pdk_settings_ebeam_terminator_te1550_.yml @@ -1,17 +1,4 @@ name: ebeam_terminator_te1550 -ports: - o1: - center: - - 0.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_ebeam_terminator_tm1550_.yml b/tests/test_components/test_pdk_settings_ebeam_terminator_tm1550_.yml index 2a4a40ff..de0478fd 100644 --- a/tests/test_components/test_pdk_settings_ebeam_terminator_tm1550_.yml +++ b/tests/test_components/test_pdk_settings_ebeam_terminator_tm1550_.yml @@ -1,17 +1,4 @@ name: ebeam_terminator_tm1550 -ports: - o1: - center: - - 0.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_ebeam_y_1550_.yml b/tests/test_components/test_pdk_settings_ebeam_y_1550_.yml index 0aa5240e..2aec46be 100644 --- a/tests/test_components/test_pdk_settings_ebeam_y_1550_.yml +++ b/tests/test_components/test_pdk_settings_ebeam_y_1550_.yml @@ -1,41 +1,4 @@ name: ebeam_y_1550 -ports: - o1: - center: - - -7.4 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - 7.4 - - 2.75 - layer: - - 1 - - 0 - name: o2 - orientation: 0 - port_type: optical - shear_angle: null - width: 0.5 - o3: - center: - - 7.4 - - -2.75 - layer: - - 1 - - 0 - name: o3 - orientation: 0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_ebeam_y_adiabatic_.yml b/tests/test_components/test_pdk_settings_ebeam_y_adiabatic_.yml index 4feb1d9a..21e9ef3b 100644 --- a/tests/test_components/test_pdk_settings_ebeam_y_adiabatic_.yml +++ b/tests/test_components/test_pdk_settings_ebeam_y_adiabatic_.yml @@ -1,41 +1,4 @@ name: ebeam_y_adiabatic -ports: - o1: - center: - - 0.05 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.45 - o2: - center: - - 50.05 - - 1.25 - layer: - - 1 - - 0 - name: o2 - orientation: 0 - port_type: optical - shear_angle: null - width: 0.45 - o3: - center: - - 50.05 - - -1.25 - layer: - - 1 - - 0 - name: o3 - orientation: 0 - port_type: optical - shear_angle: null - width: 0.45 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_ebeam_y_adiabatic_1310_.yml b/tests/test_components/test_pdk_settings_ebeam_y_adiabatic_1310_.yml index 262a16e5..d2acc807 100644 --- a/tests/test_components/test_pdk_settings_ebeam_y_adiabatic_1310_.yml +++ b/tests/test_components/test_pdk_settings_ebeam_y_adiabatic_1310_.yml @@ -1,41 +1,4 @@ name: ebeam_y_adiabatic_1310 -ports: - o1: - center: - - 0.05 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.35 - o2: - center: - - 52.05 - - 1.25 - layer: - - 1 - - 0 - name: o2 - orientation: 0 - port_type: optical - shear_angle: null - width: 0.35 - o3: - center: - - 52.05 - - -1.25 - layer: - - 1 - - 0 - name: o3 - orientation: 0 - port_type: optical - shear_angle: null - width: 0.35 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_ebeam_y_adiabatic_tapers_.yml b/tests/test_components/test_pdk_settings_ebeam_y_adiabatic_tapers_.yml index 50858978..c4446aab 100644 --- a/tests/test_components/test_pdk_settings_ebeam_y_adiabatic_tapers_.yml +++ b/tests/test_components/test_pdk_settings_ebeam_y_adiabatic_tapers_.yml @@ -1,41 +1,4 @@ name: ebeam_y_adiabatic_tapers -ports: - o1: - center: - - -9.95 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - 60.05 - - 1.25 - layer: - - 1 - - 0 - name: o2 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 - o3: - center: - - 60.05 - - -1.25 - layer: - - 1 - - 0 - name: o3 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_gc_te1310_.yml b/tests/test_components/test_pdk_settings_gc_te1310_.yml index bd4f951a..d8a081bf 100644 --- a/tests/test_components/test_pdk_settings_gc_te1310_.yml +++ b/tests/test_components/test_pdk_settings_gc_te1310_.yml @@ -1,29 +1,4 @@ name: mirror_b611a4d8_gc_te1310 -ports: - o1: - center: - - 0.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.35 - opt_in_TE_1310_device_JoaquinMatres: - center: - - 25.0 - - 0.0 - layer: - - 1 - - 0 - name: opt_in_TE_1310_device_JoaquinMatres - orientation: null - port_type: opt_in_TE_1310_device_JoaquinMatres - shear_angle: null - width: 9 settings: changed: {} child: diff --git a/tests/test_components/test_pdk_settings_gc_te1310_8deg_.yml b/tests/test_components/test_pdk_settings_gc_te1310_8deg_.yml index 46d93d72..99784c09 100644 --- a/tests/test_components/test_pdk_settings_gc_te1310_8deg_.yml +++ b/tests/test_components/test_pdk_settings_gc_te1310_8deg_.yml @@ -1,29 +1,4 @@ name: mirror_58e2a10b_gc_te1310_8deg -ports: - o1: - center: - - 0.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.35 - opt_in_TE_1310_device_JoaquinMatres: - center: - - 25.0 - - 0.0 - layer: - - 1 - - 0 - name: opt_in_TE_1310_device_JoaquinMatres - orientation: null - port_type: opt_in_TE_1310_device_JoaquinMatres - shear_angle: null - width: 9 settings: changed: {} child: diff --git a/tests/test_components/test_pdk_settings_gc_te1310_broadband_.yml b/tests/test_components/test_pdk_settings_gc_te1310_broadband_.yml index a8e866a5..a644be88 100644 --- a/tests/test_components/test_pdk_settings_gc_te1310_broadband_.yml +++ b/tests/test_components/test_pdk_settings_gc_te1310_broadband_.yml @@ -1,29 +1,4 @@ name: mirror_cd7472ae_gc_te13_d32e5c2e -ports: - o1: - center: - - 0.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.35 - opt_in_TE_1310_device_JoaquinMatres: - center: - - 25.0 - - 0.0 - layer: - - 1 - - 0 - name: opt_in_TE_1310_device_JoaquinMatres - orientation: null - port_type: opt_in_TE_1310_device_JoaquinMatres - shear_angle: null - width: 9 settings: changed: {} child: diff --git a/tests/test_components/test_pdk_settings_gc_te1550_.yml b/tests/test_components/test_pdk_settings_gc_te1550_.yml index 3e32ce8a..55231c5b 100644 --- a/tests/test_components/test_pdk_settings_gc_te1550_.yml +++ b/tests/test_components/test_pdk_settings_gc_te1550_.yml @@ -1,29 +1,4 @@ name: mirror_948d7eaf_gc_te1550 -ports: - o1: - center: - - 0.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - opt_in_TE_1550_device_JoaquinMatres: - center: - - 25.0 - - 0.0 - layer: - - 1 - - 0 - name: opt_in_TE_1550_device_JoaquinMatres - orientation: null - port_type: opt_in_TE_1550_device_JoaquinMatres - shear_angle: null - width: 9 settings: changed: {} child: diff --git a/tests/test_components/test_pdk_settings_gc_te1550_90nmSlab_.yml b/tests/test_components/test_pdk_settings_gc_te1550_90nmSlab_.yml index 80ab080a..a016429e 100644 --- a/tests/test_components/test_pdk_settings_gc_te1550_90nmSlab_.yml +++ b/tests/test_components/test_pdk_settings_gc_te1550_90nmSlab_.yml @@ -1,29 +1,4 @@ name: mirror_d2cc2b58_gc_te15_311df1af -ports: - o1: - center: - - 0.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - opt_in_TE_1550_device_JoaquinMatres: - center: - - 25.0 - - 0.0 - layer: - - 1 - - 0 - name: opt_in_TE_1550_device_JoaquinMatres - orientation: null - port_type: opt_in_TE_1550_device_JoaquinMatres - shear_angle: null - width: 9 settings: changed: {} child: diff --git a/tests/test_components/test_pdk_settings_gc_te1550_broadband_.yml b/tests/test_components/test_pdk_settings_gc_te1550_broadband_.yml index 1eee3bce..cd6aa54d 100644 --- a/tests/test_components/test_pdk_settings_gc_te1550_broadband_.yml +++ b/tests/test_components/test_pdk_settings_gc_te1550_broadband_.yml @@ -1,29 +1,4 @@ name: mirror_a38c0f84_gc_te15_79b73d72 -ports: - o1: - center: - - 0.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - opt_in_TE_1550_device_JoaquinMatres: - center: - - 25.0 - - 0.0 - layer: - - 1 - - 0 - name: opt_in_TE_1550_device_JoaquinMatres - orientation: null - port_type: opt_in_TE_1550_device_JoaquinMatres - shear_angle: null - width: 9 settings: changed: {} child: diff --git a/tests/test_components/test_pdk_settings_gc_tm1550_.yml b/tests/test_components/test_pdk_settings_gc_tm1550_.yml index 2d7ebc3b..0686b0bd 100644 --- a/tests/test_components/test_pdk_settings_gc_tm1550_.yml +++ b/tests/test_components/test_pdk_settings_gc_tm1550_.yml @@ -1,29 +1,4 @@ name: mirror_355ecc08_gc_tm1550 -ports: - o1: - center: - - 0.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - opt_in_TM_1550_device_JoaquinMatres: - center: - - 25.0 - - 0.0 - layer: - - 1 - - 0 - name: opt_in_TM_1550_device_JoaquinMatres - orientation: null - port_type: opt_in_TM_1550_device_JoaquinMatres - shear_angle: null - width: 9 settings: changed: {} child: diff --git a/tests/test_components/test_pdk_settings_metal_via_.yml b/tests/test_components/test_pdk_settings_metal_via_.yml index 256df153..7b50d5d5 100644 --- a/tests/test_components/test_pdk_settings_metal_via_.yml +++ b/tests/test_components/test_pdk_settings_metal_via_.yml @@ -1,53 +1,4 @@ name: metal_via -ports: - e1: - center: - - -7.5 - - 0.0 - layer: - - 1 - - 11 - name: e1 - orientation: 180 - port_type: electrical - shear_angle: null - width: 15.0 - e2: - center: - - 0.0 - - 7.5 - layer: - - 1 - - 11 - name: e2 - orientation: 90 - port_type: electrical - shear_angle: null - width: 15.0 - e3: - center: - - 7.5 - - 0.0 - layer: - - 1 - - 11 - name: e3 - orientation: 0 - port_type: electrical - shear_angle: null - width: 15.0 - e4: - center: - - 0.0 - - -7.5 - layer: - - 1 - - 11 - name: e4 - orientation: 270 - port_type: electrical - shear_angle: null - width: 15.0 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_mmi1x2_.yml b/tests/test_components/test_pdk_settings_mmi1x2_.yml index b3e02b05..eda61b47 100644 --- a/tests/test_components/test_pdk_settings_mmi1x2_.yml +++ b/tests/test_components/test_pdk_settings_mmi1x2_.yml @@ -1,41 +1,4 @@ name: mmi1x2_50c22d89 -ports: - o1: - center: - - -10.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - 15.5 - - 0.625 - layer: - - 1 - - 0 - name: o2 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 - o3: - center: - - 15.5 - - -0.625 - layer: - - 1 - - 0 - name: o3 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: cross_section: @@ -55,6 +18,8 @@ settings: gap_mmi: 0.25 length_mmi: 5.5 length_taper: 10.0 + straight: + function: straight taper: function: taper width: null @@ -76,6 +41,8 @@ settings: gap_mmi: 0.25 length_mmi: 5.5 length_taper: 10.0 + straight: + function: straight taper: function: taper width: null diff --git a/tests/test_components/test_pdk_settings_mzi_.yml b/tests/test_components/test_pdk_settings_mzi_.yml index 88aa2867..203ccd78 100644 --- a/tests/test_components/test_pdk_settings_mzi_.yml +++ b/tests/test_components/test_pdk_settings_mzi_.yml @@ -1,29 +1,4 @@ name: mzi_55c1098f -ports: - o1: - center: - - -7.4 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - 62.325 - - 0.0 - layer: - - 1 - - 0 - name: o2 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: bend: diff --git a/tests/test_components/test_pdk_settings_mzi_heater_.yml b/tests/test_components/test_pdk_settings_mzi_heater_.yml index 652c22db..9deca562 100644 --- a/tests/test_components/test_pdk_settings_mzi_heater_.yml +++ b/tests/test_components/test_pdk_settings_mzi_heater_.yml @@ -1,53 +1,4 @@ name: mzi_ab5edfa6 -ports: - o1: - center: - - -7.4 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - 262.225 - - 0.0 - layer: - - 1 - - 0 - name: o2 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 - top_e1: - center: - - 12.395 - - 24.75 - layer: - - 12 - - 0 - name: top_e1 - orientation: 180 - port_type: electrical - shear_angle: null - width: 10 - top_e2: - center: - - 242.405 - - 24.75 - layer: - - 12 - - 0 - name: top_e2 - orientation: 0.0 - port_type: electrical - shear_angle: null - width: 10 settings: changed: length_x: 200 diff --git a/tests/test_components/test_pdk_settings_pad_array_.yml b/tests/test_components/test_pdk_settings_pad_array_.yml index 7ca21327..d3da77f1 100644 --- a/tests/test_components/test_pdk_settings_pad_array_.yml +++ b/tests/test_components/test_pdk_settings_pad_array_.yml @@ -1,77 +1,4 @@ name: pad_array_71569d1c -ports: - e11: - center: - - 0.0 - - 0.0 - layer: - - 12 - - 0 - name: e11 - orientation: 270 - port_type: electrical - shear_angle: null - width: 75 - e12: - center: - - 125.0 - - 0.0 - layer: - - 12 - - 0 - name: e12 - orientation: 270 - port_type: electrical - shear_angle: null - width: 75 - e13: - center: - - 250.0 - - 0.0 - layer: - - 12 - - 0 - name: e13 - orientation: 270 - port_type: electrical - shear_angle: null - width: 75 - e14: - center: - - 375.0 - - 0.0 - layer: - - 12 - - 0 - name: e14 - orientation: 270 - port_type: electrical - shear_angle: null - width: 75 - e15: - center: - - 500.0 - - 0.0 - layer: - - 12 - - 0 - name: e15 - orientation: 270 - port_type: electrical - shear_angle: null - width: 75 - e16: - center: - - 625.0 - - 0.0 - layer: - - 12 - - 0 - name: e16 - orientation: 270 - port_type: electrical - shear_angle: null - width: 75 settings: changed: pad: diff --git a/tests/test_components/test_pdk_settings_photonic_wirebond_surfacetaper_1310_.yml b/tests/test_components/test_pdk_settings_photonic_wirebond_surfacetaper_1310_.yml index 0983264c..20c33e40 100644 --- a/tests/test_components/test_pdk_settings_photonic_wirebond_surfacetaper_1310_.yml +++ b/tests/test_components/test_pdk_settings_photonic_wirebond_surfacetaper_1310_.yml @@ -1,17 +1,4 @@ name: photonic_wirebond_surfa_b165631b -ports: - o1: - center: - - 110.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 0 - port_type: optical - shear_angle: null - width: 0.35 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_photonic_wirebond_surfacetaper_1550_.yml b/tests/test_components/test_pdk_settings_photonic_wirebond_surfacetaper_1550_.yml index c99288f1..11c0b9d5 100644 --- a/tests/test_components/test_pdk_settings_photonic_wirebond_surfacetaper_1550_.yml +++ b/tests/test_components/test_pdk_settings_photonic_wirebond_surfacetaper_1550_.yml @@ -1,17 +1,4 @@ name: photonic_wirebond_surfa_8365a94f -ports: - o1: - center: - - 110.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_ring_double_heater_.yml b/tests/test_components/test_pdk_settings_ring_double_heater_.yml index 252a98dd..b78ea14c 100644 --- a/tests/test_components/test_pdk_settings_ring_double_heater_.yml +++ b/tests/test_components/test_pdk_settings_ring_double_heater_.yml @@ -1,77 +1,4 @@ name: ring_double_heater_171f554b -ports: - e1: - center: - - -5.01 - - 5.0 - layer: - - 12 - - 0 - name: e1 - orientation: 90 - port_type: electrical - shear_angle: null - width: 10 - e2: - center: - - 5.0 - - 5.0 - layer: - - 12 - - 0 - name: e2 - orientation: 90 - port_type: electrical - shear_angle: null - width: 10 - o1: - center: - - -13.01 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - -13.01 - - 21.41 - layer: - - 1 - - 0 - name: o2 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o3: - center: - - 13.0 - - 21.41 - layer: - - 1 - - 0 - name: o3 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 - o4: - center: - - 13.0 - - 0.0 - layer: - - 1 - - 0 - name: o4 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: via_stack: @@ -94,13 +21,14 @@ settings: function: bend_euler coupler_ring: function: coupler_ring + coupler_ring_top: null cross_section: strip cross_section_heater: heater_metal cross_section_waveguide_heater: strip_heater_metal gap: 0.2 length_x: 0.01 length_y: 0.01 - port_orientation: 90 + port_orientation: null radius: 10.0 straight: function: straight @@ -131,13 +59,14 @@ settings: function: bend_euler coupler_ring: function: coupler_ring + coupler_ring_top: null cross_section: strip cross_section_heater: heater_metal cross_section_waveguide_heater: strip_heater_metal gap: 0.2 length_x: 0.01 length_y: 0.01 - port_orientation: 90 + port_orientation: null radius: 10.0 straight: function: straight diff --git a/tests/test_components/test_pdk_settings_ring_single_.yml b/tests/test_components/test_pdk_settings_ring_single_.yml index 331c9f7f..5fe67485 100644 --- a/tests/test_components/test_pdk_settings_ring_single_.yml +++ b/tests/test_components/test_pdk_settings_ring_single_.yml @@ -1,29 +1,4 @@ name: ring_single -ports: - o1: - center: - - -17.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - 13.0 - - 0.0 - layer: - - 1 - - 0 - name: o2 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_ring_single_heater_.yml b/tests/test_components/test_pdk_settings_ring_single_heater_.yml index b9c1e7c9..e131fb58 100644 --- a/tests/test_components/test_pdk_settings_ring_single_heater_.yml +++ b/tests/test_components/test_pdk_settings_ring_single_heater_.yml @@ -1,53 +1,4 @@ name: ring_single_heater_171f554b -ports: - e1: - center: - - -9.0 - - 5.0 - layer: - - 12 - - 0 - name: e1 - orientation: 90 - port_type: electrical - shear_angle: null - width: 10 - e2: - center: - - 5.0 - - 5.0 - layer: - - 12 - - 0 - name: e2 - orientation: 90 - port_type: electrical - shear_angle: null - width: 10 - o1: - center: - - -17.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - 13.0 - - 0.0 - layer: - - 1 - - 0 - name: o2 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: via_stack: @@ -75,7 +26,7 @@ settings: gap: 0.2 length_x: 4.0 length_y: 0.6 - port_orientation: 90 + port_orientation: null radius: 10.0 via_stack: function: via_stack @@ -109,7 +60,7 @@ settings: gap: 0.2 length_x: 4.0 length_y: 0.6 - port_orientation: 90 + port_orientation: null radius: 10.0 via_stack: function: via_stack diff --git a/tests/test_components/test_pdk_settings_ring_with_crossing_.yml b/tests/test_components/test_pdk_settings_ring_with_crossing_.yml index 34f7fe3b..29db1354 100644 --- a/tests/test_components/test_pdk_settings_ring_with_crossing_.yml +++ b/tests/test_components/test_pdk_settings_ring_with_crossing_.yml @@ -1,29 +1,4 @@ name: ring_single_dut_2f65884a -ports: - o1: - center: - - -12.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - 8.0 - - 0.0 - layer: - - 1 - - 0 - name: o2 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: bend: diff --git a/tests/test_components/test_pdk_settings_spiral_.yml b/tests/test_components/test_pdk_settings_spiral_.yml index c054a327..c62430cb 100644 --- a/tests/test_components/test_pdk_settings_spiral_.yml +++ b/tests/test_components/test_pdk_settings_spiral_.yml @@ -1,29 +1,4 @@ name: spiral_external_io -ports: - o1: - center: - - 383.0 - - -43.0 - layer: - - 1 - - 0 - name: o1 - orientation: 270 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - 386.0 - - -46.0 - layer: - - 1 - - 0 - name: o2 - orientation: 270 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_straight_.yml b/tests/test_components/test_pdk_settings_straight_.yml index 6f1909f6..3dd448fb 100644 --- a/tests/test_components/test_pdk_settings_straight_.yml +++ b/tests/test_components/test_pdk_settings_straight_.yml @@ -1,29 +1,4 @@ name: straight -ports: - o1: - center: - - 0.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - 10.0 - - 0.0 - layer: - - 1 - - 0 - name: o2 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: {} child: null @@ -42,6 +17,95 @@ settings: cross_section: strip function_name: cross_section length: 10.0 + route_info: + length: 10.0 + type: + auto_widen: false + auto_widen_minimum_length: 200.0 + bbox_layers: [] + bbox_offsets: [] + cladding_layers: + - DEVREC + cladding_offsets: + - 0.0 + cladding_simplify: null + end_straight_length: 0.01 + gap: 3.0 + info: + function_name: cross_section + settings: + add_bbox: null + add_pins: + function: add_pins_siepic + auto_widen: false + auto_widen_minimum_length: 200.0 + bbox_layers: null + bbox_offsets: null + cladding_layers: + - DEVREC + cladding_offsets: + - 0 + cladding_simplify: null + decorator: null + end_straight_length: 0.01 + gap: 3.0 + info: null + layer: WG + min_length: 0.01 + mirror: false + name: null + offset: 0 + port_names: + - o1 + - o2 + port_types: + - optical + - optical + radius: 10.0 + sections: null + snap_to_grid: null + start_straight_length: 0.01 + taper_length: 10.0 + width: 0.5 + width_wide: null + layer: WG + min_length: 0.01 + mirror: false + name: null + offset: 0.0 + port_names: + - o1 + - o2 + port_types: + - optical + - optical + radius: 10.0 + sections: [] + simplify: null + snap_to_grid: null + start_straight_length: 0.01 + taper_length: 10.0 + width: 0.5 + width_wide: null + weight: 10.0 + ? '{''layer'': ''WG'', ''width'': 0.5, ''offset'': 0.0, ''radius'': 10.0, ''width_wide'': + None, ''simplify'': None, ''auto_widen'': False, ''auto_widen_minimum_length'': + 200.0, ''taper_length'': 10.0, ''bbox_layers'': [], ''bbox_offsets'': [], + ''cladding_layers'': [''DEVREC''], ''cladding_offsets'': [0.0], ''cladding_simplify'': + None, ''sections'': [], ''port_names'': [''o1'', ''o2''], ''port_types'': + [''optical'', ''optical''], ''gap'': 3.0, ''min_length'': 0.01, ''start_straight_length'': + 0.01, ''end_straight_length'': 0.01, ''snap_to_grid'': None, ''info'': {''settings'': + {''width'': 0.5, ''offset'': 0, ''layer'': ''WG'', ''width_wide'': None, ''auto_widen'': + False, ''auto_widen_minimum_length'': 200.0, ''taper_length'': 10.0, ''radius'': + 10.0, ''sections'': None, ''port_names'': [''o1'', ''o2''], ''port_types'': + [''optical'', ''optical''], ''gap'': 3.0, ''min_length'': 0.01, ''start_straight_length'': + 0.01, ''end_straight_length'': 0.01, ''snap_to_grid'': None, ''bbox_layers'': + None, ''bbox_offsets'': None, ''cladding_layers'': [''DEVREC''], ''cladding_offsets'': + [0], ''cladding_simplify'': None, ''info'': None, ''decorator'': None, ''add_pins'': + {''function'': ''add_pins_siepic''}, ''add_bbox'': None, ''mirror'': False, + ''name'': None}, ''function_name'': ''cross_section''}, ''name'': None, ''mirror'': + False}_length' + : 10.0 settings: add_bbox: null add_pins: diff --git a/tests/test_components/test_pdk_settings_straight_one_pin_.yml b/tests/test_components/test_pdk_settings_straight_one_pin_.yml index bee2bf90..1f873d9a 100644 --- a/tests/test_components/test_pdk_settings_straight_one_pin_.yml +++ b/tests/test_components/test_pdk_settings_straight_one_pin_.yml @@ -1,29 +1,4 @@ name: straight_one_pin -ports: - o1: - center: - - 0.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - 1.0 - - 0.0 - layer: - - 1 - - 0 - name: o2 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_taper_.yml b/tests/test_components/test_pdk_settings_taper_.yml index 1e4e8267..cf22722b 100644 --- a/tests/test_components/test_pdk_settings_taper_.yml +++ b/tests/test_components/test_pdk_settings_taper_.yml @@ -1,29 +1,4 @@ name: taper -ports: - o1: - center: - - 0.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - 10.0 - - 0.0 - layer: - - 1 - - 0 - name: o2 - orientation: 0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_terminator_short_.yml b/tests/test_components/test_pdk_settings_terminator_short_.yml index fda2951f..6b6fe5d2 100644 --- a/tests/test_components/test_pdk_settings_terminator_short_.yml +++ b/tests/test_components/test_pdk_settings_terminator_short_.yml @@ -1,17 +1,4 @@ name: terminator_short -ports: - o1: - center: - - 0.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_thermal_phase_shifter0_.yml b/tests/test_components/test_pdk_settings_thermal_phase_shifter0_.yml index f107ae8f..4d1c2a7f 100644 --- a/tests/test_components/test_pdk_settings_thermal_phase_shifter0_.yml +++ b/tests/test_components/test_pdk_settings_thermal_phase_shifter0_.yml @@ -1,53 +1,4 @@ name: thermal_phase_shifter0 -ports: - e1: - center: - - 492.5 - - -3.0 - layer: - - 1 - - 11 - name: e1 - orientation: 270 - port_type: electrical - shear_angle: null - width: 15.0 - e2: - center: - - 7.5 - - -3.0 - layer: - - 1 - - 11 - name: e2 - orientation: 270 - port_type: electrical - shear_angle: null - width: 15.0 - o1: - center: - - 0.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 3.0 - o2: - center: - - 500.0 - - 0.0 - layer: - - 1 - - 0 - name: o2 - orientation: 0 - port_type: optical - shear_angle: null - width: 3.0 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_thermal_phase_shifter1_.yml b/tests/test_components/test_pdk_settings_thermal_phase_shifter1_.yml index d0f7c57f..941f9336 100644 --- a/tests/test_components/test_pdk_settings_thermal_phase_shifter1_.yml +++ b/tests/test_components/test_pdk_settings_thermal_phase_shifter1_.yml @@ -1,53 +1,4 @@ name: thermal_phase_shifter1 -ports: - e1: - center: - - 492.5 - - -3.0 - layer: - - 1 - - 11 - name: e1 - orientation: 270 - port_type: electrical - shear_angle: null - width: 15.0 - e2: - center: - - 7.5 - - -3.0 - layer: - - 1 - - 11 - name: e2 - orientation: 270 - port_type: electrical - shear_angle: null - width: 15.0 - o1: - center: - - 0.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.35 - o2: - center: - - 500.0 - - 0.0 - layer: - - 1 - - 0 - name: o2 - orientation: 0 - port_type: optical - shear_angle: null - width: 0.35 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_thermal_phase_shifter2_.yml b/tests/test_components/test_pdk_settings_thermal_phase_shifter2_.yml index a5b8acdf..06ba2110 100644 --- a/tests/test_components/test_pdk_settings_thermal_phase_shifter2_.yml +++ b/tests/test_components/test_pdk_settings_thermal_phase_shifter2_.yml @@ -1,53 +1,4 @@ name: thermal_phase_shifter2 -ports: - e1: - center: - - 492.5 - - -3.0 - layer: - - 1 - - 11 - name: e1 - orientation: 270 - port_type: electrical - shear_angle: null - width: 15.0 - e2: - center: - - 7.5 - - -3.0 - layer: - - 1 - - 11 - name: e2 - orientation: 270 - port_type: electrical - shear_angle: null - width: 15.0 - o1: - center: - - 0.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.35 - o2: - center: - - 500.0 - - 0.0 - layer: - - 1 - - 0 - name: o2 - orientation: 0 - port_type: optical - shear_angle: null - width: 0.35 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_thermal_phase_shifter3_.yml b/tests/test_components/test_pdk_settings_thermal_phase_shifter3_.yml index ae7339f8..29007e21 100644 --- a/tests/test_components/test_pdk_settings_thermal_phase_shifter3_.yml +++ b/tests/test_components/test_pdk_settings_thermal_phase_shifter3_.yml @@ -1,53 +1,4 @@ name: thermal_phase_shifter3 -ports: - e1: - center: - - 492.5 - - -3.0 - layer: - - 1 - - 11 - name: e1 - orientation: 270 - port_type: electrical - shear_angle: null - width: 15.0 - e2: - center: - - 7.5 - - -3.0 - layer: - - 1 - - 11 - name: e2 - orientation: 270 - port_type: electrical - shear_angle: null - width: 15.0 - o1: - center: - - 0.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - 500.0 - - 0.0 - layer: - - 1 - - 0 - name: o2 - orientation: 0 - port_type: optical - shear_angle: null - width: 0.5 settings: changed: {} child: null diff --git a/tests/test_components/test_pdk_settings_via_stack_heater_mtop_.yml b/tests/test_components/test_pdk_settings_via_stack_heater_mtop_.yml index 828506da..d7cdf023 100644 --- a/tests/test_components/test_pdk_settings_via_stack_heater_mtop_.yml +++ b/tests/test_components/test_pdk_settings_via_stack_heater_mtop_.yml @@ -1,53 +1,4 @@ name: via_stack_627f28a4 -ports: - e1: - center: - - -5.0 - - 0.0 - layer: - - 12 - - 0 - name: e1 - orientation: 180 - port_type: electrical - shear_angle: null - width: 10 - e2: - center: - - 0.0 - - 5.0 - layer: - - 12 - - 0 - name: e2 - orientation: 90 - port_type: electrical - shear_angle: null - width: 10 - e3: - center: - - 5.0 - - 0.0 - layer: - - 12 - - 0 - name: e3 - orientation: 0.0 - port_type: electrical - shear_angle: null - width: 10 - e4: - center: - - 0.0 - - -5.0 - layer: - - 12 - - 0 - name: e4 - orientation: 270 - port_type: electrical - shear_angle: null - width: 10 settings: changed: layers: diff --git a/ubcpdk/__init__.py b/ubcpdk/__init__.py index 3aa62f52..8cfebc34 100644 --- a/ubcpdk/__init__.py +++ b/ubcpdk/__init__.py @@ -1,31 +1,16 @@ """UBC Siepic Ebeam PDK from edx course.""" import pathlib -import warnings import gdsfactory as gf from gdsfactory.config import logger from gdsfactory.get_factories import get_cells from gdsfactory.pdk import Pdk +from ubcpdk import components, data, tech from ubcpdk.config import CONFIG, PATH, module -from ubcpdk.tech import LAYER, strip, LAYER_STACK, LAYER_VIEWS -from ubcpdk import components -from ubcpdk import tech -from ubcpdk import data +from ubcpdk.tech import LAYER, LAYER_STACK, LAYER_VIEWS, cross_sections, strip -from ubcpdk.tech import cross_sections - -warnings.warn( - """ -The latest versions of ubcpdk work with Python 3.10 and above. -If you are using Python 3.9 or below, please install ubcpdk==1.21.4 -However we recommend you to upgrade to Python 3.10 or above so you can use the latest ubcpdk and gdsfactory features. -""", - stacklevel=2, -) - - -__version__ = "1.21.4" +__version__ = "1.21.3" __all__ = [ "CONFIG", diff --git a/ubcpdk/circuits/grating.pic.yml b/ubcpdk/circuits/grating.pic.yml deleted file mode 100644 index cdf5f9a4..00000000 --- a/ubcpdk/circuits/grating.pic.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: sample_different_factory - -settings: - taper_length: -50 - -instances: - bl: - component: pad - tl: - component: pad - br: - component: pad - tr: - component: pad - -placements: - tl: - x: 0 - y: 200 - - br: - x: 400 - y: 400 - - tr: - x: 400 - y: 600 - -routes: - electrical: - settings: - separation: 20 - layer: [31, 0] - width: 10 - links: - tl,e3: tr,e1 - bl,e3: br,e1 - optical: - settings: - radius: 100 - links: - bl,e4: br,e3 diff --git a/ubcpdk/circuits/mask.pic.yml b/ubcpdk/circuits/mask.pic.yml deleted file mode 100644 index 120ca7f1..00000000 --- a/ubcpdk/circuits/mask.pic.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: mask_compact -pdk: ubcpdk - -instances: - rings: - component: pack_doe - settings: - doe: ring_single - settings: - radius: [30, 50, 20, 40] - length_x: [1, 2, 3] - do_permutations: True - function: - function: add_fiber_array - settings: - fanout_length: 200 - - mzis: - component: pack_doe_grid - settings: - doe: mzi - settings: - delta_length: [10, 100, 300, 500, 600] - do_permutations: True - spacing: [10, 10] - function: add_fiber_single - - mmis: - component: pack_doe_grid - settings: - doe: dbr_cavity - settings: - n: [10, 100] - do_permutations: True - spacing: [10, 10] - function: add_fiber_single - -placements: - rings: - xmin: 50 - - mzis: - xmin: rings,east - - mmis: - xmin: mzis,east diff --git a/ubcpdk/circuits/mzi_lattice_filter.pic.yml b/ubcpdk/circuits/mzi_lattice_filter.pic.yml deleted file mode 100644 index b63edb97..00000000 --- a/ubcpdk/circuits/mzi_lattice_filter.pic.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: mzi_lattice_ubcpdk -pdk: ubcpdk - -instances: - mzi1: - component: mzi_ubcpdk - settings: - dy: -100 - - mzi2: - component: mzi_ubcpdk - settings: - dy: -500 - - gc1: - component: ebeam_gc_te1550 - - gc2: - component: ebeam_gc_te1550 - -placements: - mzi2: - ymax: mzi1,north - dy: 100 - xmin: mzi1,east - dx: 50 - - gc1: - xmax: mzi1,west - mirror: True - dx: -100 - dy: -20 - - gc2: - xmin: mzi2,east - dx: 100 - dy: 100 - -routes: - optical: - links: - mzi1,o2: mzi2,o1 - settings: - auto_widen: True - - gc1: - links: - gc1,o1: mzi1,o1 - - gc2: - links: - gc2,o1: mzi2,o2 diff --git a/ubcpdk/circuits/mzi_ubcpdk.pic.yml b/ubcpdk/circuits/mzi_ubcpdk.pic.yml deleted file mode 100644 index 36a123af..00000000 --- a/ubcpdk/circuits/mzi_ubcpdk.pic.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: mzi_ubcpdk -pdk: ubcpdk - -settings: - dy: -100 - -info: - polarization: te - wavelength: 1.55 - description: mzi for ubcpdk - -instances: - yr: - component: ebeam_y_1550 - yl: - component: ebeam_y_1550 - -placements: - yr: - rotation: 180 - x: 100 - y: 0 - -routes: - route_top: - links: - yl,o2: yr,o3 - settings: - cross_section: strip - route_bot: - links: - yl,o3: yr,o2 - routing_strategy: get_bundle_from_steps - settings: - steps: [dx: 30, dy: "${settings.dy}", dx: 20] - cross_section: strip - -ports: - o1: yl,o1 - o2: yr,o1 diff --git a/ubcpdk/circuits/pads.pic.yml b/ubcpdk/circuits/pads.pic.yml deleted file mode 100644 index adfcf160..00000000 --- a/ubcpdk/circuits/pads.pic.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: sample_different_factory -pdk: ubcpdk - -instances: - bl: - component: pad - tl: - component: pad - br: - component: pad - tr: - component: pad - -placements: - tl: - x: -100 - y: 200 - - br: - x: 400 - y: 400 - - tr: - x: 400 - y: 600 - - -routes: - electrical: - settings: - separation: 20 - layer: M2_ROUTER - width: 10 - links: - tl,e3: tr,e1 - bl,e3: br,e1 - optical: - settings: - radius: 10 - links: - bl,e4: br,e3 diff --git a/ubcpdk/components.py b/ubcpdk/components.py index 963d473c..6ae929a5 100644 --- a/ubcpdk/components.py +++ b/ubcpdk/components.py @@ -1,30 +1,31 @@ """Cells imported from the PDK.""" from functools import partial + import gdsfactory as gf +from gdsfactory import Component from gdsfactory.typings import ( Callable, ComponentReference, ComponentSpec, CrossSectionSpec, + Label, LayerSpec, List, Optional, Port, Tuple, - Label, ) -from gdsfactory import Component -from ubcpdk.config import CONFIG -from ubcpdk.import_gds import import_gds, import_gc from ubcpdk import tech +from ubcpdk.config import CONFIG +from ubcpdk.import_gds import import_gc, import_gds from ubcpdk.tech import ( - strip, - LAYER_STACK, LAYER, + LAYER_STACK, add_pins_bbox_siepic, add_pins_bbox_siepic_remove_layers, add_pins_siepic_metal, + strip, ) um = 1e-6 @@ -432,7 +433,7 @@ def get_input_label_text( "TM", ], f"Not valid polarization {polarization.upper()!r} in [TE, TM]" assert ( - isinstance(wavelength, (int, float)) and 1.0 < wavelength < 2.0 + isinstance(wavelength, int | float) and 1.0 < wavelength < 2.0 ), f"{wavelength} is Not valid 1000 < wavelength < 2000" name = component_name or port.parent.metadata_child.get("name") diff --git a/ubcpdk/config.py b/ubcpdk/config.py index ef71e406..5d712a35 100644 --- a/ubcpdk/config.py +++ b/ubcpdk/config.py @@ -10,7 +10,6 @@ from omegaconf import OmegaConf - default_config = io.StringIO( """ username: JoaquinMatres diff --git a/ubcpdk/data/find_bandwidth.py b/ubcpdk/data/find_bandwidth.py index 6f4f7dff..b023e216 100644 --- a/ubcpdk/data/find_bandwidth.py +++ b/ubcpdk/data/find_bandwidth.py @@ -41,8 +41,8 @@ def plot_bandwidth(x, y, threshold: float = 3) -> None: if __name__ == "__main__": - from ubcpdk.data.dbr import dbrs from ubcpdk.data.chop import chop + from ubcpdk.data.dbr import dbrs from ubcpdk.data.read_mat import read_mat w, p = read_mat(dbrs["1_5"], port=1) diff --git a/ubcpdk/data/read_mat.py b/ubcpdk/data/read_mat.py index 32bd4c1b..57db56ef 100644 --- a/ubcpdk/data/read_mat.py +++ b/ubcpdk/data/read_mat.py @@ -1,6 +1,6 @@ -from gdsfactory.typings import Tuple, PathType -from scipy.io import loadmat import numpy as np +from gdsfactory.typings import PathType, Tuple +from scipy.io import loadmat def read_mat(filename: PathType, port: int = 0) -> Tuple[np.ndarray, np.ndarray]: @@ -28,6 +28,7 @@ def read_mat(filename: PathType, port: int = 0) -> Tuple[np.ndarray, np.ndarray] if __name__ == "__main__": import matplotlib.pyplot as plt + import ubcpdk w, p = read_mat(ubcpdk.PATH.mzi1) diff --git a/ubcpdk/data/remove_baseline.py b/ubcpdk/data/remove_baseline.py index 5025640e..e208ab1a 100644 --- a/ubcpdk/data/remove_baseline.py +++ b/ubcpdk/data/remove_baseline.py @@ -1,4 +1,5 @@ import numpy as np + from ubcpdk.data.read_mat import read_mat @@ -17,6 +18,7 @@ def remove_baseline(wavelength: np.ndarray, power: np.ndarray, deg: int = 4): if __name__ == "__main__": import matplotlib.pyplot as plt + import ubcpdk w, p = read_mat(ubcpdk.PATH.mzi1) diff --git a/ubcpdk/data/windowed_mean.py b/ubcpdk/data/windowed_mean.py index 1d881a7a..d6607241 100644 --- a/ubcpdk/data/windowed_mean.py +++ b/ubcpdk/data/windowed_mean.py @@ -16,10 +16,11 @@ def windowed_mean(data: np.array, n: int = 60) -> np.array: if __name__ == "__main__": - from ubcpdk.data.read_mat import read_mat - from ubcpdk.config import PATH import matplotlib.pyplot as plt + from ubcpdk.config import PATH + from ubcpdk.data.read_mat import read_mat + wavelength, power = read_mat(PATH.ring_te_r3_g100) power_envelope = windowed_mean(power, 60) plt.plot(wavelength, power, label="power") diff --git a/ubcpdk/import_gds.py b/ubcpdk/import_gds.py index 91519fa8..05269b67 100644 --- a/ubcpdk/import_gds.py +++ b/ubcpdk/import_gds.py @@ -1,14 +1,10 @@ -from typing import Optional - -from numpy import ndarray -from numpy import arctan2, degrees, isclose - import gdsfactory as gf from gdsfactory.component import Component from gdsfactory.typings import LayerSpec -from ubcpdk.tech import LAYER -from ubcpdk.config import PATH +from numpy import arctan2, degrees, isclose, ndarray +from ubcpdk.config import PATH +from ubcpdk.tech import LAYER layer = LAYER.WG port_width = 0.5 @@ -80,9 +76,9 @@ def add_ports(component: Component) -> Component: def add_ports_from_siepic_pins( component: Component, pin_layer_optical: LayerSpec = "PORT", - port_layer_optical: Optional[LayerSpec] = None, + port_layer_optical: LayerSpec | None = None, pin_layer_electrical: LayerSpec = "PORTE", - port_layer_electrical: Optional[LayerSpec] = None, + port_layer_electrical: LayerSpec | None = None, ) -> Component: """Add ports from SiEPIC-type cells, where the pins are defined as paths. diff --git a/ubcpdk/import_pdk.py b/ubcpdk/import_pdk.py index df4ce341..fea688dc 100644 --- a/ubcpdk/import_pdk.py +++ b/ubcpdk/import_pdk.py @@ -1,6 +1,6 @@ import gdsfactory as gf -from ubcpdk.config import PATH +from ubcpdk.config import PATH if __name__ == "__main__": print( diff --git a/docs/notebooks/00_layout.py b/ubcpdk/samples/notebooks/00_layout.py similarity index 100% rename from docs/notebooks/00_layout.py rename to ubcpdk/samples/notebooks/00_layout.py diff --git a/ubcpdk/samples/notebooks/11_sparameters.py b/ubcpdk/samples/notebooks/11_sparameters.py new file mode 100644 index 00000000..06ea6d3a --- /dev/null +++ b/ubcpdk/samples/notebooks/11_sparameters.py @@ -0,0 +1,83 @@ +# --- +# jupyter: +# jupytext: +# custom_cell_magics: kql +# text_representation: +# extension: .py +# format_name: percent +# format_version: '1.3' +# jupytext_version: 1.11.2 +# kernelspec: +# display_name: Python 3 (ipykernel) +# language: python +# name: python3 +# --- + +# %% [markdown] +# # Component FDTD simulations +# +# Thanks to the GDSFactory plugin you can directly run simulations in different FDTD solvers. +# +# See [tutorial](https://gdsfactory.github.io/gdsfactory/plugins_fdtd.html) + +# %% [markdown] +# ## Tidy3d +# +# You can read about the [tidy3d gdsfactory plugin](https://gdsfactory.github.io/gdsfactory/notebooks/plugins/tidy3d/00_tidy3d.html) + +# %% +import gplugins as sim +import gplugins.gtidy3d as gt + +import ubcpdk.components as pdk + +# %% +c = pdk.ebeam_y_1550() +c.plot() + +# %% +sp = gt.write_sparameters(c) + +# %% +sp.keys() + +# %% +sim.plot.plot_sparameters(sp) + +# %% +sim.plot.plot_loss1x2(sp) + +# %% +sim.plot.plot_imbalance1x2(sp) + +# %% [markdown] +# ## Lumerical FDTD +# +# You can write the [Sparameters](https://en.wikipedia.org/wiki/Scattering_parameters) for all components in the UBC `ubcpdk.components` PDK using lumerical FDTD plugin in gplugins + +# %% [markdown] +# To run simulations uncomment the following lines + +# %% +import gplugins as sim + +import ubcpdk.components as pdk + +# %% +for f in [ + pdk.bend_euler, + pdk.coupler, + pdk.coupler_ring, + pdk.ebeam_y_1550, + pdk.ebeam_crossing4, +]: + component = f() + component.plot() + # ls.write_sparameters_lumerical(component=component) + + +# %% +# sp = ls.read.read_sparameters_lumerical(component=ubcpdk.components.straight()) + +# %% +# sim.plot_sparameters(sp) diff --git a/docs/notebooks/11_sparameters_gratings.py b/ubcpdk/samples/notebooks/11_sparameters_gratings.py similarity index 83% rename from docs/notebooks/11_sparameters_gratings.py rename to ubcpdk/samples/notebooks/11_sparameters_gratings.py index f872fdf3..d0914a8b 100644 --- a/docs/notebooks/11_sparameters_gratings.py +++ b/ubcpdk/samples/notebooks/11_sparameters_gratings.py @@ -23,14 +23,15 @@ # ## tidy3d # %% -import numpy as np +import gplugins.gtidy3d as gt import matplotlib.pyplot as plt +import numpy as np -import gdsfactory.simulation.gtidy3d as gt import ubcpdk.components as pdk +from ubcpdk.config import PATH c = pdk.gc_te1550() -c +c.plot() # %% fiber_angle_deg = -31 @@ -50,6 +51,7 @@ is_3d=False, fiber_angle_deg=fiber_angle_deg, fiber_xoffset=fiber_xoffset, + dirpath=PATH.sparameters, ) for fiber_xoffset in offsets ] @@ -64,7 +66,11 @@ def log(x): # %% for offset in offsets: sp = gt.write_sparameters_grating_coupler( - c, is_3d=False, fiber_angle_deg=fiber_angle_deg, fiber_xoffset=offset + c, + is_3d=False, + fiber_angle_deg=fiber_angle_deg, + fiber_xoffset=offset, + dirpath=PATH.sparameters, ) plt.plot( sp["wavelengths"], @@ -78,15 +84,4 @@ def log(x): plt.legend() # %% -# gt.write_sparameters_grating_coupler? - -# %% -sparams = [ - gt.write_sparameters_grating_coupler( - component=c, - is_3d=False, - fiber_angle_deg=fiber_angle_deg, - fiber_xoffset=fiber_xoffset, - ) - for fiber_xoffset in offsets -] +help(gt.write_sparameters_grating_coupler) diff --git a/docs/notebooks/12_sim_plugins_tidy3d.py b/ubcpdk/samples/notebooks/12_sim_plugins_tidy3d.py similarity index 87% rename from docs/notebooks/12_sim_plugins_tidy3d.py rename to ubcpdk/samples/notebooks/12_sim_plugins_tidy3d.py index beb07d8f..33732332 100644 --- a/docs/notebooks/12_sim_plugins_tidy3d.py +++ b/ubcpdk/samples/notebooks/12_sim_plugins_tidy3d.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # --- # jupyter: # jupytext: @@ -27,13 +26,6 @@ # # We will be using SAX which is open source and tidy3d which requires you to create an account to run simulations in tidy3d cloud. # -# -# ``` -# set PIP_FIND_LINKS="https://whls.blob.core.windows.net/unstable/index.html" -# pip install sax jax sklearn -# pip install "jaxlib[cuda111]" -f https://whls.blob.core.windows.net/unstable/index.html --use-deprecated legacy-resolver -# pip install "gdsfactory[tidy3d,sax]" -# ``` # %% [markdown] # ## tidy3d FDTD simulations @@ -47,15 +39,15 @@ # ![cloud_model](https://i.imgur.com/5VTCPLR.png) # %% -import gdsfactory.simulation as sim import gdsfactory as gf -import gdsfactory.simulation.gtidy3d as gt -import ubcpdk.components as pdk +import gplugins as sim +import gplugins.gtidy3d as gt +import ubcpdk.components as pdk # %% c = pdk.ebeam_y_1550() -c +c.plot() # %% sp = gt.write_sparameters(c) @@ -72,17 +64,16 @@ # %% mzi10 = gf.components.mzi(splitter=c, delta_length=10) -mzi10 +mzi10.plot() # %% +import gdsfactory as gf +import gplugins.sax as gsax +import jax.numpy as jnp import matplotlib.pyplot as plt import numpy as np -import jax.numpy as jnp import sax -import gdsfactory as gf -import gdsfactory.simulation.sax as gsax - # %% def straight(wl=1.5, length=10.0, neff=2.4) -> sax.SDict: @@ -121,7 +112,7 @@ def bend_euler(wl=1.5, length=20.0): # %% mzi20 = gf.components.mzi(splitter=c, delta_length=20) -mzi20 +mzi20.plot() # %% netlist = mzi20.get_netlist() @@ -144,5 +135,3 @@ def bend_euler(wl=1.5, length=20.0): plt.ylabel("T") plt.grid(True) plt.show() - -# %% diff --git a/docs/notebooks/13_sim_plugins.py b/ubcpdk/samples/notebooks/13_sim_plugins.py similarity index 95% rename from docs/notebooks/13_sim_plugins.py rename to ubcpdk/samples/notebooks/13_sim_plugins.py index 1443641f..9def6ad6 100644 --- a/docs/notebooks/13_sim_plugins.py +++ b/ubcpdk/samples/notebooks/13_sim_plugins.py @@ -25,9 +25,9 @@ # ## MEEP FDTD # + -import gdsfactory.simulation.gmeep as gm -import gdsfactory.simulation as sim import gdsfactory as gf +import gplugins as sim +import gplugins.gmeep as gm import ubcpdk as pdk @@ -130,7 +130,8 @@ # ## 3D rendering # + -from gdsfactory.simulation.add_simulation_markers import add_simulation_markers +from gplugins.add_simulation_markers import add_simulation_markers + import ubcpdk as pdk y = pdk.components.ebeam_y_1550() @@ -157,15 +158,14 @@ mzi10 # + +import gdsfactory as gf +import gplugins.gmeep as gm +import gplugins.sax as gsax +import jax.numpy as jnp import matplotlib.pyplot as plt import numpy as np -import jax.numpy as jnp import sax -import gdsfactory as gf -import gdsfactory.simulation.sax as gsax -import gdsfactory.simulation.gmeep as gm - import ubcpdk as pdk # - diff --git a/docs/notebooks/14_sax_tidy3d.py b/ubcpdk/samples/notebooks/14_sax_tidy3d.py similarity index 92% rename from docs/notebooks/14_sax_tidy3d.py rename to ubcpdk/samples/notebooks/14_sax_tidy3d.py index e7d2d21d..67a55cf8 100644 --- a/docs/notebooks/14_sax_tidy3d.py +++ b/ubcpdk/samples/notebooks/14_sax_tidy3d.py @@ -1,17 +1,19 @@ # --- # jupyter: # jupytext: +# custom_cell_magics: kql # text_representation: # extension: .py -# format_name: light -# format_version: '1.5' -# jupytext_version: 1.14.5 +# format_name: percent +# format_version: '1.3' +# jupytext_version: 1.11.2 # kernelspec: # display_name: Python 3 (ipykernel) # language: python # name: python3 # --- +# %% [markdown] # # SAX circuit simulator # # [SAX](https://flaport.github.io/sax/) is a circuit solver written in JAX, writing your component models in SAX enables you not only to get the function values but the gradients, this is useful for circuit optimization. @@ -21,24 +23,21 @@ # You can install sax with pip (read the SAX install instructions [here](https://github.com/flaport/sax#installation)) # # ``` -# pip install 'gdsfactory[sax]' +# pip install 'gplugins[sax]' # ``` -# + +# %% from pprint import pprint -import numpy as np -import matplotlib.pyplot as plt -import jax.numpy as jnp import gdsfactory as gf -import gdsfactory.simulation.sax as gs +import gplugins.gtidy3d as gt +import gplugins.sax as gs +import jax.numpy as jnp +import matplotlib.pyplot as plt +import numpy as np import sax -import gdsfactory.simulation.gtidy3d as gt - -gf.config.set_plot_options(show_subports=False) -# - - +# %% [markdown] # ## Scatter *dictionaries* # # The core datastructure for specifying scatter parameters in SAX is a dictionary... more specifically a dictionary which maps a port combination (2-tuple) to a scatter parameter (or an array of scatter parameters when considering multiple wavelengths for example). Such a specific dictionary mapping is called ann `SDict` in SAX (`SDict ≈ Dict[Tuple[str,str], float]`). @@ -53,6 +52,7 @@ # o1 o4 # ``` +# %% nm = 1e-3 coupling = 0.5 kappa = coupling**0.5 @@ -69,9 +69,10 @@ } coupler_dict +# %% [markdown] # it can still be tedious to specify every port in the circuit manually. SAX therefore offers the `reciprocal` function, which auto-fills the reverse connection if the forward connection exist. For example: -# + +# %% coupler_dict = sax.reciprocal( { ("o1", "o4"): tau, @@ -83,16 +84,14 @@ coupler_dict - -# - - +# %% [markdown] # ## Parametrized Models # # Constructing such an `SDict` is easy, however, usually we're more interested in having parametrized models for our components. To parametrize the coupler `SDict`, just wrap it in a function to obtain a SAX `Model`, which is a keyword-only function mapping to an `SDict`: # -# + +# %% def coupler(coupling=0.5) -> sax.SDict: kappa = coupling**0.5 tau = (1 - coupling) ** 0.5 @@ -109,9 +108,7 @@ def coupler(coupling=0.5) -> sax.SDict: coupler(coupling=0.3) -# - - - +# %% def waveguide(wl=1.55, wl0=1.55, neff=2.34, ng=3.4, length=10.0, loss=0.0) -> sax.SDict: dwl = wl - wl0 dneff_dwl = (ng - neff) / wl0 @@ -125,12 +122,15 @@ def waveguide(wl=1.55, wl0=1.55, neff=2.34, ng=3.4, length=10.0, loss=0.0) -> sa ) +# %% [markdown] # ### Waveguide model # # You can create a dispersive waveguide model in SAX. +# %% [markdown] # Lets compute the effective index `neff` and group index `ng` for a 1550nm 500nm straight waveguide +# %% strip = gt.modes.Waveguide( wavelength=1.55, core_width=0.5, @@ -140,27 +140,37 @@ def waveguide(wl=1.55, wl0=1.55, neff=2.34, ng=3.4, length=10.0, loss=0.0) -> sa clad_material="sio2", group_index_step=10 * nm, ) -strip.plot_field(mode_index=0, field_type="Ex") # TE +strip.plot_field(field_name="Ex", mode_index=0) # TE -neff = strip.neffs[0].real -neff +# %% +neff = strip.n_eff[0] +print(neff) + +# %% ng = strip.n_group[0] +print(ng) +# %% straight_sc = gf.partial(gs.models.straight, neff=neff, ng=ng) +# %% gs.plot_model(straight_sc) plt.ylim(-1, 1) +# %% gs.plot_model(straight_sc, phase=True) +# %% [markdown] # ### Coupler model # # Lets define the model for an evanescent coupler +# %% c = gf.components.coupler(length=10, gap=0.2) -c +c.plot() +# %% nm = 1e-3 cp = gt.modes.WaveguideCoupler( wavelength=1.55, @@ -171,29 +181,37 @@ def waveguide(wl=1.55, wl0=1.55, neff=2.34, ng=3.4, length=10.0, loss=0.0) -> sa core_material="si", clad_material="sio2", ) -cp.plot_field(mode_index=0, field_type="Ex") # even mode -cp.plot_field(mode_index=1, field_type="Ex") # odd mode + +cp.plot_field(field_name="Ex", mode_index=0) # even mode +cp.plot_field(field_name="Ex", mode_index=1) # odd mode +# %% [markdown] # For a 200nm gap the effective index difference `dn` is `0.026`, which means that there is 100% power coupling over 29.4 +# %% [markdown] # If we ignore the coupling from the bend `coupling0 = 0` we know that for a 3dB coupling we need half of the `lc` length, which is the length needed to coupler `100%` of power. +# %% coupler_sc = gf.partial(gs.models.coupler, dn=0.026, length=29.4 / 2, coupling0=0) gs.plot_model(coupler_sc) +# %% [markdown] # ## SAX gdsfactory Compatibility # > From Layout to Circuit Model # # If you define your SAX S parameter models for your components, you can directly simulate your circuits from gdsfactory +# %% mzi = gf.components.mzi(delta_length=10) -mzi +mzi.plot() +# %% netlist = mzi.get_netlist() pprint(netlist["connections"]) +# %% [markdown] # The netlist has three different components: # # 1. straight @@ -203,7 +221,7 @@ def waveguide(wl=1.55, wl0=1.55, neff=2.34, ng=3.4, length=10.0, loss=0.0) -> sa # You need models for each subcomponents to simulate the Component. -# + +# %% def straight(wl=1.5, length=10.0, neff=2.4) -> sax.SDict: return sax.reciprocal({("o1", "o2"): jnp.exp(2j * jnp.pi * neff * length / wl)}) @@ -228,11 +246,11 @@ def bend_euler(wl=1.5, length=20.0): "mmi1x2": mmi1x2, "straight": straight, } -# - +# %% circuit, _ = sax.circuit(netlist=netlist, models=models) -# + +# %% circuit, _ = sax.circuit(netlist=netlist, models=models) wl = np.linspace(1.5, 1.6) S = circuit(wl=wl) @@ -244,12 +262,12 @@ def bend_euler(wl=1.5, length=20.0): plt.ylabel("T") plt.grid(True) plt.show() -# - +# %% mzi = gf.components.mzi(delta_length=20) # Double the length, reduces FSR by 1/2 -mzi +mzi.plot() -# + +# %% circuit, _ = sax.circuit(netlist=mzi.get_netlist(), models=models) wl = np.linspace(1.5, 1.6, 256) @@ -262,20 +280,21 @@ def bend_euler(wl=1.5, length=20.0): plt.ylabel("T") plt.grid(True) plt.show() -# - +# %% [markdown] # ## Heater model # # You can make a phase shifter model that depends on the applied volage. For that you need first to figure out what's the model associated to your phase shifter, and what is the parameter that you need to tune. +# %% delta_length = 10 mzi_component = gf.components.mzi_phase_shifter_top_heater_metal( delta_length=delta_length ) -fig = mzi_component.plot() +mzi_component.plot() -# + +# %% def straight(wl=1.5, length=10.0, neff=2.4) -> sax.SDict: return sax.reciprocal({("o1", "o2"): jnp.exp(2j * jnp.pi * neff * length / wl)}) @@ -320,8 +339,8 @@ def phase_shifter_heater( "straight": straight, "straight_heater_metal_undercut": phase_shifter_heater, } -# - +# %% mzi_component = gf.components.mzi_phase_shifter_top_heater_metal( delta_length=delta_length ) @@ -330,7 +349,7 @@ def phase_shifter_heater( S = mzi_circuit(wl=1.55) S -# + +# %% wl = np.linspace(1.5, 1.6, 256) S = mzi_circuit(wl=wl) @@ -341,26 +360,30 @@ def phase_shifter_heater( plt.ylabel("T") plt.grid(True) plt.show() -# - +# %% [markdown] # Now you can tune the phase shift applied to one of the arms. # # How do you find out what's the name of the netlist component that you want to tune? # # You can backannotate the netlist and read the labels on the backannotated netlist or you can plot the netlist +# %% mzi_component.plot_netlist() +# %% [markdown] # As you can see the top phase shifter instance `sxt` is hard to see on the netlist. # You can also reconstruct the component using the netlist and look at the labels in klayout. +# %% mzi_yaml = mzi_component.get_netlist_yaml() mzi_component2 = gf.read.from_yaml(mzi_yaml) fig = mzi_component2.plot(label_aliases=True) +# %% [markdown] # The best way to get a deterministic name of the `instance` is naming the reference on your Pcell. -# + +# %% voltages = np.linspace(-1, 1, num=5) voltages = [-0.5, 0, 0.5] @@ -378,9 +401,7 @@ def phase_shifter_heater( plt.title("MZI vs voltage") plt.legend() - -# - - +# %% [markdown] # ## Variable splitter # # You can build a variable splitter by adding a delta length between two 50% power splitters @@ -390,7 +411,7 @@ def phase_shifter_heater( # For example adding a 60um delta length you can build a 90% power splitter -# + +# %% @gf.cell def variable_splitter(delta_length: float, splitter=gf.c.mmi2x2): return gf.c.mzi2x2_2x2(splitter=splitter, delta_length=delta_length) @@ -398,9 +419,9 @@ def variable_splitter(delta_length: float, splitter=gf.c.mmi2x2): nm = 1e-3 c = variable_splitter(delta_length=60 * nm, cache=False) -c +c.plot() -# + +# %% models = { "bend_euler": gs.models.bend, "mmi2x2": gs.models.mmi2x2, @@ -419,25 +440,28 @@ def variable_splitter(delta_length: float, splitter=gf.c.mmi2x2): plt.ylabel("T") plt.grid(True) plt.show() -# - +# %% [markdown] # ## Coupler sim # # Lets compare one coupler versus two coupler +# %% c = gf.components.coupler(length=29.4, gap=0.2) -c +c.plot() +# %% coupler50 = gf.partial(gs.models.coupler, dn=0.026, length=29.4 / 2, coupling0=0) gs.plot_model(coupler50) +# %% [markdown] # As you can see the 50% coupling is only at one wavelength (1550nm) # # You can chain two couplers to increase the wavelength range for 50% operation. -# + +# %% @gf.cell def broadband_coupler(delta_length=0, splitter=gf.c.coupler): return gf.c.mzi2x2_2x2( @@ -446,9 +470,9 @@ def broadband_coupler(delta_length=0, splitter=gf.c.coupler): c = broadband_coupler(delta_length=120 * nm, cache=False) -c +c.plot() -# + +# %% c = broadband_coupler(delta_length=164 * nm, cache=False) models = { "bend_euler": gs.models.bend, @@ -470,6 +494,6 @@ def broadband_coupler(delta_length=0, splitter=gf.c.coupler): plt.ylabel("T") plt.legend() plt.grid(True) -# - +# %% [markdown] # As you can see two couplers have more broadband response diff --git a/docs/notebooks/21_schematic_driven_layout.py b/ubcpdk/samples/notebooks/21_schematic_driven_layout.py similarity index 97% rename from docs/notebooks/21_schematic_driven_layout.py rename to ubcpdk/samples/notebooks/21_schematic_driven_layout.py index 3bdcc488..3d689018 100644 --- a/docs/notebooks/21_schematic_driven_layout.py +++ b/ubcpdk/samples/notebooks/21_schematic_driven_layout.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # --- # jupyter: # jupytext: @@ -22,11 +21,10 @@ # The Jupyter notebook interface allows you to get the best of both worlds of GUI and python driven based flows. # %% -from bokeh.io import output_notebook - import gdsfactory as gf -from gdsfactory.schematic_editor import SchematicEditor +from bokeh.io import output_notebook from gdsfactory.config import rich_output +from gplugins.schematic_editor import SchematicEditor # %env BOKEH_ALLOW_WS_ORIGIN=localhost:8888 @@ -159,10 +157,10 @@ # ## Circuit simulations # %% -import numpy as np -import matplotlib.pyplot as plt -import gdsfactory.simulation.sax as gs +import gplugins.sax as gs import jax.numpy as jnp +import matplotlib.pyplot as plt +import numpy as np import sax netlist = c.get_netlist() diff --git a/docs/notebooks/31_data_analysis_mzi.py b/ubcpdk/samples/notebooks/31_data_analysis_mzi.py similarity index 93% rename from docs/notebooks/31_data_analysis_mzi.py rename to ubcpdk/samples/notebooks/31_data_analysis_mzi.py index 75fc905d..d6e1a753 100644 --- a/docs/notebooks/31_data_analysis_mzi.py +++ b/ubcpdk/samples/notebooks/31_data_analysis_mzi.py @@ -1,17 +1,19 @@ # --- # jupyter: # jupytext: +# custom_cell_magics: kql # text_representation: # extension: .py -# format_name: light -# format_version: '1.5' -# jupytext_version: 1.14.5 +# format_name: percent +# format_version: '1.3' +# jupytext_version: 1.11.2 # kernelspec: # display_name: Python 3 (ipykernel) # language: python # name: python3 # --- +# %% [markdown] # # Data analysis MZI # # We analyze the following MZI samples from the edx course @@ -63,35 +65,43 @@ # dL_wg = dL_path + 2*pi*r - 4*2*r ; dL_wg # = 219.366 +# %% import matplotlib.pyplot as plt import numpy as np + import ubcpdk from ubcpdk.simulation.circuits.mzi_spectrum import mzi_spectrum +# %% w, p = ubcpdk.data.read_mat(ubcpdk.PATH.mzi1, port=0) plt.plot(w, p) +# %% [markdown] # For some reason this MZI has an interference pattern. This is strange because the lengths of both arms are the same. This means that there was a strong height variation on the chip. +# %% w, p = ubcpdk.data.read_mat(ubcpdk.PATH.mzi3, port=0) plt.plot(w, p) +# %% wr = np.linspace(1520, 1580, 1200) * 1e-3 pr = mzi_spectrum(L1_um=0, L2_um=214.215, wavelength_um=wr) plt.plot(wr * 1e3, 10 * np.log10(pr)) +# %% w, p = ubcpdk.data.read_mat(ubcpdk.PATH.mzi3, port=0) pb = ubcpdk.data.remove_baseline(w, p) plt.plot(w, pb) +# %% plt.plot(w, pb, label="measurement") plt.plot(wr * 1e3, 10 * np.log10(pr), label="analytical") plt.legend() -# + +# %% # ms.sweep_wavelength? -# + +# %% from scipy.optimize import curve_fit L1_um = 40 @@ -120,17 +130,19 @@ def mzi_logscale(wavelength_um, alpha, n1, n2, n3): plt.plot(w, pb, label="data") plt.plot(w, mzi_logscale(wum, *p0), label="initial condition") plt.legend() -# - +# %% params, params_covariance = curve_fit(mzi_logscale, wum, pb, p0=[1e-3, 2.4, -1, 0]) +# %% params +# %% plt.plot(w, pb, label="data") plt.plot(w, mzi_logscale(wum, *params), label="fit") plt.legend() -# + +# %% L1_um = 40 L2_um = L1_um + 215.932 @@ -156,10 +168,11 @@ def mzi(wavelength_um, alpha, n1, n2, n3): plt.plot(w, pb_linear, label="data") plt.plot(w, mzi(wum, *p0), label="initial condition") plt.legend() -# - +# %% params, params_covariance = curve_fit(mzi, wum, pb, p0=p0) +# %% plt.plot(w, pb_linear, label="data") plt.plot(w, mzi(wum, *params), label="fit") plt.legend() diff --git a/docs/notebooks/32_data_analysis_ring.py b/ubcpdk/samples/notebooks/32_data_analysis_ring.py similarity index 99% rename from docs/notebooks/32_data_analysis_ring.py rename to ubcpdk/samples/notebooks/32_data_analysis_ring.py index 1521e1c1..ae093241 100644 --- a/docs/notebooks/32_data_analysis_ring.py +++ b/ubcpdk/samples/notebooks/32_data_analysis_ring.py @@ -32,6 +32,7 @@ # + attributes={"classes": [], "id": "", "n": "2"} import matplotlib.pyplot as plt + import ubcpdk # + attributes={"classes": [], "id": "", "n": "3"} diff --git a/docs/notebooks/33_data_analysis_dbr.py b/ubcpdk/samples/notebooks/33_data_analysis_dbr.py similarity index 99% rename from docs/notebooks/33_data_analysis_dbr.py rename to ubcpdk/samples/notebooks/33_data_analysis_dbr.py index 9150cfb4..b2a9daf8 100644 --- a/docs/notebooks/33_data_analysis_dbr.py +++ b/ubcpdk/samples/notebooks/33_data_analysis_dbr.py @@ -20,6 +20,7 @@ # + attributes={"classes": [], "id": "", "n": "2"} import matplotlib.pyplot as plt + import ubcpdk from ubcpdk.data.dbr import dbrs @@ -37,8 +38,9 @@ plt.xlim([1530, 1600]) # + -import numpy as np import matplotlib.pyplot as plt +import numpy as np + from ubcpdk import data from ubcpdk.data.dbr import dbrs diff --git a/docs/notebooks/Makefile b/ubcpdk/samples/notebooks/Makefile similarity index 100% rename from docs/notebooks/Makefile rename to ubcpdk/samples/notebooks/Makefile diff --git a/docs/notebooks/sdl_demo.pic.yml b/ubcpdk/samples/notebooks/sdl_demo.pic.yml similarity index 100% rename from docs/notebooks/sdl_demo.pic.yml rename to ubcpdk/samples/notebooks/sdl_demo.pic.yml diff --git a/docs/notebooks/test.schem.yml b/ubcpdk/samples/notebooks/test.schem.yml similarity index 100% rename from docs/notebooks/test.schem.yml rename to ubcpdk/samples/notebooks/test.schem.yml diff --git a/ubcpdk/samples/report/EBeam_JoaquinMatres.ipynb b/ubcpdk/samples/report/EBeam_JoaquinMatres.ipynb deleted file mode 100644 index d61eb0ba..00000000 --- a/ubcpdk/samples/report/EBeam_JoaquinMatres.ipynb +++ /dev/null @@ -1,472 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "---\n", - "title: Process control monitors\n", - "author: \"Joaquin Matres\"\n", - "numbersections: true\n", - "autoEqnLabels: true\n", - "geometry:\n", - "- top=30mm\n", - "- left=20mm\n", - "- right=20mm\n", - "- bottom=30mm\n", - "bibliography: library.bib\n", - "header-includes:\n", - " - \\usepackage{float}\n", - "\n", - "---\n", - "\n", - "# Report\n", - "\n", - "## Motivation\n", - "\n", - "As we build more complex photonic systems we need to understand how the\n", - "variability of each component affects the performance of the overall system. In\n", - "this paper we add process control monitor the width and height control for the\n", - "Ebeam process.\n", - "\n", - "Here is a list of components included in the mask\n", - "\n", - "- low and high order MZI to extract group index and effective index\n", - "- different length spirals to extract propagation loss (dB/cm) versus wavelength\n", - "- ring resonators to extract group and effective index variations\n", - "\n", - "\n", - "All the code used, included this report can be found in [this github\n", - "repo](https://github.com/gdsfactory/ubc), which contains:\n", - "\n", - "- GDS layout and circuit models for the components\n", - "- mask code to build GDS, together with JSON metadata\n", - "\n", - "Links:\n", - "\n", - "- [gdsfactory documentation](https://gdsfactory.readthedocs.io/en/latest/)\n", - "[@gdsfactory]\n", - "- [simphony](https://simphonyphotonics.readthedocs.io/en/latest/) for circuit\n", - "simulation.[@simphony]\n", - "- [SiPANN](https://sipann.readthedocs.io/en/latest/) which uses a neural network\n", - "to fit the component models. [@sipann]\n", - "- [modes](https://modes.readthedocs.io/en/latest/index.html)\n", - "\n", - "\n", - "## MZI interferometers\n", - "\n", - "We follow the method described in [@Xing2018] to extract the group index and\n", - "effective index, where we use a low (m=15) and high order (m=150) MZI to extract\n", - "the group and effective index of the waveguide, from which we can extract the\n", - "waveguide width and height.\n", - "\n", - "\n", - "$$m \\lambda_{res} = n_{eff} \\Delta L$$\n", - "\n", - "$$\\Delta L = m \\lambda_{res} / n_{eff}$$\n", - "\n", - "\n", - "According to the ANT [website](https://www.appliednt.com/), waveguides have a\n", - "sidewall angle of 82°. The fabricated 500x220 nm waveguides neff is 2.495 and\n", - "group index 4.12" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import modes\n", - "import gdsfactory as gf\n", - "import ubcpdk.simulation.circuits_simphony as cm\n", - "import gdsfactory.simulation.simphony as gs\n", - "import ubcpdk" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "s = modes.mode_solver_full(angle=82,\n", - " width=500e-3,\n", - " thickness=220e-3,\n", - " plot=True,\n", - " fields_to_write=('Ex',),\n", - " n_modes=1)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "ng = modes.group_index(thickness=220e-3, width=470e-3, angle=82)\n", - "print(f'group index ng = {ng[0]:.2f}')" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "neff = 2.495\n", - "delta_length_short = 15 * 1.55 / neff\n", - "delta_length_long = 150 * 1.55 / neff\n", - "print(f'MZI short = {delta_length_short:.2f} MZI long = {delta_length_long:.2f}')" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We can now layout and simulate the MZI responses together with grating couplers." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "ubcpdk.components.mzi(delta_length=delta_length_long)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "ubcpdk.components.mzi(delta_length=delta_length_short)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "attributes": { - "classes": [], - "id": "", - "n": "1" - } - }, - "outputs": [], - "source": [ - "\n", - "mzi_circuit_short = cm.mzi(delta_length=delta_length_short)\n", - "gs.plot_circuit(mzi_circuit_short)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "mzi_circuit_long = cm.mzi(delta_length=delta_length_long)\n", - "gs.plot_circuit(mzi_circuit_long)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Ring resonators\n", - "\n", - "We add another method to extract group and effective index using Ring resonators\n", - "as described in [@Lu2017].\n", - "\n", - "The ring resonators from the paper had 500 x 220nm waveguides, 4.5um coupler\n", - "length, 200nm gap and 12um bend radius." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "ubcpdk.components.ring_single(length_x=4.5, gap=0.2, radius=12)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import ubcpdk.simulation.circuits_simphony as siepic\n", - "import matplotlib.pyplot as plt\n", - "\n", - "c = siepic.ebeam_dc_halfring_straight(\n", - " gap=200e-9,\n", - " radius=12e-6,\n", - " width=500e-9,\n", - " thickness=220e-9,\n", - " couple_length=4e-6\n", - ")\n", - "gs.plot_model(c, pin_in='o1', pins=('o2', 'o3', 'o4'))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We use [simphony](https://simphonyphotonics.readthedocs.io/en/latest/) for\n", - "circuit simulation. As simphony misses Sparameters for some coupler designs, we\n", - "use [SiPANN](https://sipann.readthedocs.io/en/latest/) which uses a neural\n", - "network to interpolate missing Sparameter values." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import numpy as np\n", - "from SiPANN import nn\n", - "\n", - "\n", - "def f(radius,\n", - " couplerLength,\n", - " gap,\n", - " width,\n", - " thickness,\n", - " sw_angle,\n", - " couplerWidth,\n", - " wavelength=np.squeeze(np.linspace(1.5,1.6,5000))):\n", - " \"\"\" units in um\n", - " \"\"\" \n", - " E, alpha, t, alpha_s, _ = nn.racetrack_AP_RR_TF(wavelength,\n", - " widthCoupler=couplerWidth,\n", - " radius=radius,\n", - " sw_angle=sw_angle,\n", - " couplerLength=couplerLength,\n", - " gap=gap,\n", - " width=width,\n", - " thickness=thickness)\n", - " \n", - " input = np.squeeze([1,0])\n", - " throughPort = 10*np.log10(np.abs(np.squeeze(E)) ** 2)\n", - " #throughPort = np.unwrap(np.angle(np.squeeze(E)))\n", - "\n", - " plt.figure()\n", - " plt.plot(wavelength, (throughPort), label='Through Port')\n", - " plt.xlabel('Wavelength ($\\mu$m)')\n", - " plt.ylabel('Power (a.u.)')\n", - " plt.grid(True)\n", - " plt.title(f'couplerLength = {couplerLength}')\n", - " plt.legend()\n", - " #plt.ylim(-30, 0.1)\n", - " #plt.xlim(1.55,1.56)\n", - " plt.tight_layout()\n", - " plt.show()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "f(radius=12, couplerLength=4.5, gap=0.2, width=0.5, thickness=.22, sw_angle=82, couplerWidth=.5)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "f(radius=12, couplerLength=6, gap=0.2, width=0.5, thickness=.22, sw_angle=82, couplerWidth=.5)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "f(radius=12, couplerLength=2.5, gap=0.2, width=0.5, thickness=.22, sw_angle=82, couplerWidth=.5)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "As we can see it's hard to distinguish undercoupled from overcoupled regimes, so\n", - "we plot both amplitude and phase." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import numpy as np\n", - "from SiPANN import nn\n", - "\n", - "wavelength = np.squeeze(np.linspace(1.5,1.6,5000))\n", - "\n", - "def f(radius,couplerLength,gap,width,thickness,sw_angle,couplerWidth):\n", - " \"\"\" units in um\n", - " \"\"\"\n", - " E, alpha, t, alpha_s, _ = nn.racetrack_AP_RR_TF(wavelength,\n", - " widthCoupler=couplerWidth,\n", - " radius=radius,\n", - " sw_angle=sw_angle,\n", - " couplerLength=couplerLength,\n", - " gap=gap,\n", - " width=width,\n", - " thickness=thickness)\n", - "\n", - "\n", - " f, (ax1, ax2) = plt.subplots(2, 1, sharex=True)\n", - " # Evaluate response\n", - " input = np.squeeze([1,0])\n", - " throughPort = 10*np.log10(np.abs(np.squeeze(E)) ** 2)\n", - " throughPort_angle = np.unwrap(np.angle(np.squeeze(E)))\n", - "\n", - " ax1.plot(wavelength, (throughPort), label='Through Port')\n", - " ax1.set_ylabel('Power (dB)')\n", - " ax1.grid()\n", - " \n", - " ax2.plot(wavelength, (throughPort_angle), label='Through Port')\n", - " \n", - " plt.xlabel('Wavelength ($\\mu$m)')\n", - " plt.ylabel('Angle (rad)')\n", - " plt.grid(True)\n", - " #plt.legend()\n", - " ax1.set_ylim(-30, 0.1)\n", - " #plt.xlim(1.55,1.56)\n", - " plt.tight_layout()\n", - " ax1.set_title(f'couplerLength = {couplerLength}')\n", - "\n", - " plt.show()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "f(radius=12, couplerLength=4.5, gap=0.2, width=0.5, thickness=.22, sw_angle=82, couplerWidth=.5)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "f(radius=12, couplerLength=2.5, gap=0.2, width=0.5, thickness=.22, sw_angle=82, couplerWidth=.5)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "f(radius=12, couplerLength=6.5, gap=0.2, width=0.5, thickness=.22, sw_angle=82, couplerWidth=.5)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Spirals for waveguide loss\n", - "\n", - "For measuring waveguide loss for different wavelengths we added 3 spirals with\n", - "different length" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "N = 15\n", - "radius = 15\n", - "\n", - "s1 = gf.components.spiral_external_io(\n", - " N=N,\n", - " radius=radius,\n", - " y_straight_inner_top=0,\n", - " x_inner_length_cutback=0,\n", - ")\n", - "\n", - "s2 = gf.components.spiral_external_io(\n", - " N=N,\n", - " radius=radius,\n", - " y_straight_inner_top=30,\n", - " x_inner_length_cutback=85,\n", - ")\n", - "\n", - "print(f\"spiral 1 length = {s1.info['length']/1e4:.2f} cm\")\n", - "s1" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "print(f\"spiral 2 length = {s2.info['length']/1e4:.2f} cm\")\n", - "s2" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## References\n", - "\n", - "- [1] “Gdsfactory — gdsfactory documentation.” [Online]. Available:\n", - "https://gdsfactory.readthedocs.io/en/latest/.\n", - "- [2] “Simphony Documentation — Simphony Manual.” [Online]. Available:\n", - "https://simphonyphotonics.readthedocs/io/en/latest/.\n", - "- [3] “SiPANN documentation.” [Online]. Available:\n", - "https://sipann.readthedocs.io/en/latest/.\n", - "- [4] Y. Xing, J. Dong, S. Dwivedi, U. Khan, and W. Bogaerts, “Accurate\n", - "extraction of fabricated geometry using optical measurement,” Photonics\n", - "Research, vol. 6, no. 11, p. 1008, 2018, doi: 10.1364/prj.6.001008.\n", - "- [5] Z. Lu et al., “Performance prediction for silicon photonics integrated\n", - "circuits with layout-dependent correlated manufacturing variability,” Optics\n", - "Express, vol. 25, no. 9, p. 9712, 2017, doi: 10.1364/oe.25.009712.\n", - "- [6] [Modes documentation](https://modes.readthedocs.io/en/latest/index.html)" - ] - } - ], - "metadata": { - "kernelspec": { - "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.10.5" - } - }, - "nbformat": 4, - "nbformat_minor": 4 -} diff --git a/ubcpdk/samples/report/Makefile b/ubcpdk/samples/report/Makefile deleted file mode 100644 index 619f4143..00000000 --- a/ubcpdk/samples/report/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -md: - jupyter nbconvert --to markdown report.ipynb - -pdf: - pandoc --highlight=tango --filter pandoc-crossref --filter pandoc-citeproc --csl ieee.csl --bibliography=library.bib JoaquinMatres.md -o JoaquinMatres.pdf - -open: - zathura report.pdf - -pdfc: - jupyter nbconvert --to pdf report.ipynb - -bib: - cp $(HOME)/wikis/library.bib . - - -execute: - jupyter nbconvert --to notebook --execute my_notebook.ipynb - - -clean: - rm *.aux *.tex *.log *.odt *.blg *.out *.html *.json *.epub *.docx *.latex - - -.PHONY: all clean paper diff --git a/ubcpdk/samples/report/ieee.csl b/ubcpdk/samples/report/ieee.csl deleted file mode 100644 index 861bf350..00000000 --- a/ubcpdk/samples/report/ieee.csl +++ /dev/null @@ -1,387 +0,0 @@ - - - diff --git a/ubcpdk/samples/report/requirements.txt b/ubcpdk/samples/report/requirements.txt deleted file mode 100644 index d20f11cc..00000000 --- a/ubcpdk/samples/report/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -modes -SiPANN diff --git a/ubcpdk/samples/report/splitter_length.py b/ubcpdk/samples/report/splitter_length.py deleted file mode 100644 index d0d9ceeb..00000000 --- a/ubcpdk/samples/report/splitter_length.py +++ /dev/null @@ -1,43 +0,0 @@ -"""Equations for MZI. - -w = 1.55 -io/ii = 1/2*(1+cos(beta*dl)) -beta = 2*np.pi*n/w - -beta*l = np.pi -beta = 2*np.pi*n/w - -2*np.pi*n*l/w = np.pi -l = w/2/n -l = np.pi/beta -""" -import numpy as np - - -def get_pi_length(w: float = 1.55, n: float = 2.4) -> float: - return w / 2 / n - - -def get_length(power_per_cent: float = 80, w: float = 1.55, n: float = 2.4) -> float: - """Returns length for a MZI based variable. - - io/ii = 1/2*(1+cos(beta*dl)) = sqrt(power_per_cent) - 1+cos(beta*dl) = 2* power_per_cent - cos(beta*dl) = 2* power_per_cent - 1 - beta*dl = np.arcos(2* power_per_cent - 1) - dl = (np.arcos(2* power_per_cent - 1))/beta - - .. code:: - L+dl - ______ - input __| |__ output - ===____________== - L - """ - beta = 2 * np.pi * n / w - return (np.arccos(2 * power_per_cent / 100 - 1)) / beta - - -if __name__ == "__main__": - # print(get_pi_length()) - print(get_length() * 1e3) diff --git a/ubcpdk/samples/test_masks.py b/ubcpdk/samples/test_masks.py index 9b74745a..28c77d78 100644 --- a/ubcpdk/samples/test_masks.py +++ b/ubcpdk/samples/test_masks.py @@ -1,10 +1,10 @@ """Write all mask for the course.""" import shutil -from ubcpdk.config import PATH -import ubcpdk.samples.ubc_joaquin_matres1 as m11 import ubcpdk.samples.ubc_helge as m12 +import ubcpdk.samples.ubc_joaquin_matres1 as m11 import ubcpdk.samples.ubc_simon as m13 +from ubcpdk.config import PATH def test_masks_2023_v1(): diff --git a/ubcpdk/samples/ubc_helge.py b/ubcpdk/samples/ubc_helge.py index 4147bfbd..7b714968 100644 --- a/ubcpdk/samples/ubc_helge.py +++ b/ubcpdk/samples/ubc_helge.py @@ -2,8 +2,8 @@ import ubcpdk import ubcpdk.components as pdk +from ubcpdk.samples.write_mask import pack, size, write_mask_gds_with_metadata from ubcpdk.tech import LAYER -from ubcpdk.samples.write_mask import write_mask_gds_with_metadata, pack, size add_gc = ubcpdk.components.add_fiber_array nm = 1e-3 diff --git a/ubcpdk/samples/ubc_joaquin_matres1.py b/ubcpdk/samples/ubc_joaquin_matres1.py index c195d618..0007b09b 100644 --- a/ubcpdk/samples/ubc_joaquin_matres1.py +++ b/ubcpdk/samples/ubc_joaquin_matres1.py @@ -4,11 +4,10 @@ import ubcpdk import ubcpdk.components as pdk - from ubcpdk import tech -from ubcpdk.tech import LAYER -from ubcpdk.samples.write_mask import write_mask_gds_with_metadata, add_gc, pack, size from ubcpdk.cutback_2x2 import cutback_2x2 +from ubcpdk.samples.write_mask import add_gc, pack, size, write_mask_gds_with_metadata +from ubcpdk.tech import LAYER def test_mask1(): @@ -177,9 +176,9 @@ def test_mask7(): if __name__ == "__main__": # gf.clear_cache() # m, tm = test_mask1() # dbr and mzi - m, tm = test_mask2() # spirals + # m, tm = test_mask2() # spirals # m, tm = test_mask3() # coupler and crossing - # m, tm = test_mask4() # heated mzis + m, tm = test_mask4() # heated mzis # m, tm = test_mask5() # heated rings # m, tm = test_mask6() # 1x2 mmis # m, tm = test_mask7() # 2x2mmis diff --git a/ubcpdk/samples/ubc_simon.py b/ubcpdk/samples/ubc_simon.py index d885ef7b..91f34d64 100644 --- a/ubcpdk/samples/ubc_simon.py +++ b/ubcpdk/samples/ubc_simon.py @@ -1,20 +1,18 @@ """Sample mask for the edx course Q1 2023.""" -from typing import Optional, List - -import ubcpdk -import ubcpdk.components as pdk -from ubcpdk.tech import LAYER -from ubcpdk.samples.write_mask import write_mask_gds_with_metadata import gdsfactory as gf from gdsfactory.components.bend_euler import bend_euler from gdsfactory.components.coupler_ring import coupler_ring as _coupler_ring -from gdsfactory.components.via_stack import via_stack_heater_m3 from gdsfactory.components.straight import straight - +from gdsfactory.components.via_stack import via_stack_heater_m3 from gdsfactory.typings import ComponentSpec, CrossSectionSpec, Float2 +import ubcpdk +import ubcpdk.components as pdk +from ubcpdk.samples.write_mask import write_mask_gds_with_metadata +from ubcpdk.tech import LAYER + via_stack_heater_m3_mini = gf.partial(via_stack_heater_m3, size=(4, 4)) @@ -35,7 +33,7 @@ def ring_single_heater( cross_section_waveguide_heater: CrossSectionSpec = "strip_heater_metal", cross_section: CrossSectionSpec = "strip", via_stack: ComponentSpec = via_stack_heater_m3_mini, - port_orientation: Optional[List[float]] = (180, 0), + port_orientation: list[float] | None = (180, 0), via_stack_offset: Float2 = (0, 0), **kwargs, ) -> gf.Component: diff --git a/ubcpdk/samples/write_mask.py b/ubcpdk/samples/write_mask.py index e39050ad..8582479a 100644 --- a/ubcpdk/samples/write_mask.py +++ b/ubcpdk/samples/write_mask.py @@ -1,14 +1,13 @@ """Sample mask for the course.""" from functools import partial - -from typing import Tuple from pathlib import Path -from omegaconf import OmegaConf + import gdsfactory as gf +from omegaconf import OmegaConf import ubcpdk -from ubcpdk.tech import LAYER from ubcpdk.config import PATH +from ubcpdk.tech import LAYER size = (440, 470) add_gc = ubcpdk.components.add_fiber_array @@ -17,7 +16,7 @@ ) -def write_mask_gds_with_metadata(m) -> Tuple[Path, Path]: +def write_mask_gds_with_metadata(m) -> tuple[Path, Path]: """Returns""" gdspath = PATH.mask / f"{m.name}.gds" m.write_gds_with_metadata(gdspath=gdspath) diff --git a/ubcpdk/simulation/circuits/mzi_spectrum.py b/ubcpdk/simulation/circuits/mzi_spectrum.py index 6df7e88f..8a2d9b99 100644 --- a/ubcpdk/simulation/circuits/mzi_spectrum.py +++ b/ubcpdk/simulation/circuits/mzi_spectrum.py @@ -4,6 +4,7 @@ """ import numpy as np + from ubcpdk.simulation.circuits.waveguide import beta, neff, wavelength_um diff --git a/ubcpdk/simulation/circuits_simphony.py b/ubcpdk/simulation/circuits_simphony.py deleted file mode 100644 index c640ab6c..00000000 --- a/ubcpdk/simulation/circuits_simphony.py +++ /dev/null @@ -1,68 +0,0 @@ -from functools import partial - -import gdsfactory.simulation.simphony as gs -from simphony.libraries import siepic - - -def ebeam_y_1550(**kwargs): - c = siepic.YBranch(**kwargs) - c.rename_pins("o1", "o2", "o3") - return c - - -def ebeam_bdc_te1550(**kwargs): - c = siepic.BidirectionalCoupler(**kwargs) - c.rename_pins("o1", "o2", "o4", "o3") - return c - - -def ebeam_dc_halfring_straight(**kwargs): - c = siepic.HalfRing(**kwargs) - c.rename_pins("o1", "o2", "o4", "o3") - return c - - -def ebeam_dc_te1550(**kwargs): - c = siepic.DirectionalCoupler(**kwargs) - c.rename_pins("o1", "o2", "o4", "o3") - return c - - -def ebeam_gc_te1550(**kwargs): - c = siepic.GratingCoupler(**kwargs) - c.rename_pins("o1", "o2") - return c - - -def ebeam_terminator_te1550(**kwargs): - c = siepic.Terminator(**kwargs) - c.rename_pins( - "o1", - ) - return c - - -mzi = partial( - gs.components.mzi, - splitter=ebeam_y_1550, -) - - -model_factory = dict( - ebeam_y_1550=ebeam_y_1550, - ebeam_bdc_te1550=ebeam_bdc_te1550, - ebeam_dc_halfring_straight=ebeam_dc_halfring_straight, - ebeam_dc_te1550=ebeam_dc_te1550, - ebeam_gc_te1550=ebeam_gc_te1550, - ebeam_terminator_te1550=ebeam_terminator_te1550, -) - -circuit_factory = dict(mzi=mzi) - - -if __name__ == "__main__": - # from gdsfactory.simulation.simphony.plot_circuit import plot_circuit - # c = mzi() - # plot_circuit(c) - - gs.plot_model(ebeam_gc_te1550) diff --git a/ubcpdk/simulation/modes_waveguide.py b/ubcpdk/simulation/modes_waveguide.py index 09c1aef1..6eff4bc4 100644 --- a/ubcpdk/simulation/modes_waveguide.py +++ b/ubcpdk/simulation/modes_waveguide.py @@ -1,9 +1,9 @@ """MPB mode simulations.""" import gdsfactory as gf -import gdsfactory.simulation.modes as gm -from ubcpdk.config import PATH +import gplugins.modes as gm +from ubcpdk.config import PATH nm = 1e-3 diff --git a/ubcpdk/tech.py b/ubcpdk/tech.py index 56735a48..a4e2def0 100644 --- a/ubcpdk/tech.py +++ b/ubcpdk/tech.py @@ -7,14 +7,13 @@ import sys from functools import partial -from pydantic import BaseModel - import gdsfactory as gf -from gdsfactory.cross_section import get_cross_section_factories -from gdsfactory.technology import LayerStack, LayerLevel -from gdsfactory.typings import Layer, LayerSpec, Callable, LayerSpecs, Optional from gdsfactory.add_pins import add_pin_path from gdsfactory.component import Component +from gdsfactory.cross_section import get_cross_section_factories +from gdsfactory.technology import LayerLevel, LayerStack +from gdsfactory.typings import Callable, Layer, LayerSpec, LayerSpecs, Optional +from pydantic import BaseModel from ubcpdk.config import PATH