Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to latest gdsfactory #351

Merged
merged 11 commits into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 10 additions & 16 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,22 @@
name: Sphinx docs to gh-pages

on:
pull_request:
push:
branches:
- main
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-docs:
runs-on: ubuntu-latest
name: Sphinx docs to gh-pages
container: ghcr.io/gdsfactory/gdsfactory:main
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
- uses: actions/checkout@v4
- name: Installing the library
env:
TIDY3D_USER: ${{ secrets.TIDY3D_EMAIL }}
Expand All @@ -34,7 +27,7 @@ jobs:
GDSFACTORY_DISPLAY_TYPE: klayout
shell: bash -l {0}
run: |
make dev
make install
make docs
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
Expand All @@ -43,6 +36,7 @@ jobs:

deploy-docs:
needs: build-docs
if: ${{ github.ref == 'refs/heads/main' }}
permissions:
pages: write
id-token: write
Expand All @@ -55,4 +49,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4
15 changes: 3 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@ jobs:
release_pypi:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
container: ghcr.io/gdsfactory/gdsfactory:main
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x
cache-dependency-path: pyproject.toml
- uses: actions/checkout@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -29,16 +25,11 @@ jobs:
release_environment:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
container: ghcr.io/gdsfactory/gdsfactory:main
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: "pip"
cache-dependency-path: pyproject.toml
- name: Install dependencies
run: |
pip install .
Expand Down
78 changes: 17 additions & 61 deletions .github/workflows/test_code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,34 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: pre-commit/action@v3.0.0
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Test pre-commit hooks
run: |
python -m pip install --upgrade pip
pip install pre-commit
pre-commit run -a
test_code:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 12
matrix:
python-version: ["3.11"]
os: [ubuntu-latest]

runs-on: ubuntu-latest
container: ghcr.io/gdsfactory/gdsfactory:main
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: pyproject.toml
- uses: actions/checkout@v4
- name: Install dependencies
run: |
make dev
make install
- name: Test with pytest
run: pytest tests/
test_code_coverage:
runs-on: ubuntu-latest

container: ghcr.io/gdsfactory/gdsfactory:main
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: "pip"
cache-dependency-path: pyproject.toml
- uses: actions/checkout@v4
- name: Install dependencies
run: |
make dev
make install
- name: Test with pytest
run: |
pytest --cov=ubcpdk tests/
Expand All @@ -56,37 +46,3 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
test_docs:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 12
matrix:
python-version: [3.11]
os: [ubuntu-latest]

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
- name: Install dependencies
run: |
make dev
pip freeze > requirements.txt
- uses: actions/upload-artifact@v3
with:
name: requirements
path: requirements.txt
- name: Test documentation
env:
TIDY3D_USER: ${{ secrets.TIDY3D_EMAIL }}
TIDY3D_PASS: ${{ secrets.TIDY3D_PASSWORD }}
DISPLAY: 1.0
DOCS: True
GDSFACTORY_DISPLAY_TYPE: klayout
run: |
mkdir -p $HOME/.tidy3d
make docs
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ubcpdk/tests/test_components.gds/gds_run/
ubcpdk/tests/test_components.gds/gds_diff/
.dvc/
.virtual_documents
tests/ref/*.oas

# C extensions
*.so
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
install:
pip install -e .[dev,docs]
pip install pre-commit
pre-commit install
python install_tech.py

dev: install
pre-commit install

update-pre:
pre-commit autoupdate
Expand Down
3 changes: 3 additions & 0 deletions docs/components.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Cells summary
bend_euler180_sc
bend_euler_sc
bend_s
coupler
coupler_ring
dbg
dbr
Expand All @@ -33,6 +34,7 @@ Cells summary
ebeam_crossing4
ebeam_crossing4_2ports
ebeam_dc_halfring_straight
ebeam_dc_te1550
ebeam_splitter_adiabatic_swg_te1550
ebeam_splitter_swg_assist_te1310
ebeam_splitter_swg_assist_te1550
Expand All @@ -55,6 +57,7 @@ Cells summary
mmi1x2
mzi
mzi_heater
pad
pad_array
photonic_wirebond_surfacetaper_1310
photonic_wirebond_surfacetaper_1550
Expand Down
53 changes: 49 additions & 4 deletions docs/components_plot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,21 @@ bend_s



coupler
----------------------------------------------------

.. autofunction:: ubcpdk.components.coupler

.. plot::
:include-source:

import ubcpdk

c = ubcpdk.components.coupler(gap=0.236, length=20.0, dy=4.0, dx=10.0)
c.plot()



coupler_ring
----------------------------------------------------

Expand Down Expand Up @@ -382,6 +397,21 @@ ebeam_dc_halfring_straight



ebeam_dc_te1550
----------------------------------------------------

.. autofunction:: ubcpdk.components.ebeam_dc_te1550

.. plot::
:include-source:

import ubcpdk

c = ubcpdk.components.ebeam_dc_te1550(gap=0.236, length=20.0, dy=4.0, dx=10.0, cross_section='xs_sc')
c.plot()



ebeam_splitter_adiabatic_swg_te1550
----------------------------------------------------

Expand Down Expand Up @@ -692,7 +722,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='xs_sc', mirror_bot=False, add_optical_ports_arms=False)
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='xs_sc', mirror_bot=False, add_optical_ports_arms=False, add_electrical_ports_bot=True)
c.plot()


Expand All @@ -707,7 +737,22 @@ 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='xs_sc', mirror_bot=False, add_optical_ports_arms=False)
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='xs_sc', mirror_bot=False, add_optical_ports_arms=False, add_electrical_ports_bot=True)
c.plot()



pad
----------------------------------------------------

.. autofunction:: ubcpdk.components.pad

.. plot::
:include-source:

import ubcpdk

c = ubcpdk.components.pad(size=(75, 75), layer=(12, 0), bbox_layers=((13, 0),), bbox_offsets=(-1.8,), port_inclusion=0)
c.plot()


Expand Down Expand Up @@ -842,7 +887,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='xs_sc', with_inner_ports=False, y_straight_outer_offset=0.0, inner_loop_spacing_offset=0.0)
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='xs_sc', with_inner_ports=False, y_straight_outer_offset=0.0, inner_loop_spacing_offset=0.0, mirror_straight=False)
c.plot()


Expand Down Expand Up @@ -977,5 +1022,5 @@ 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 = ubcpdk.components.via_stack_heater_mtop(size=(10, 10), layers=((11, 0), (12, 0)), vias=(None, None), correct_size=True, slot_horizontal=False, slot_vertical=False)
c.plot()
Loading
Loading