Skip to content

Commit

Permalink
Merge pull request #182 from gdsfactory/improve_ring_docs
Browse files Browse the repository at this point in the history
improve ring docs
  • Loading branch information
joamatab authored Oct 14, 2023
2 parents a1f919b + 9c48de4 commit d3f237d
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 17 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
#
# You can adjust the behavior by modifying this file.
# For more information, see:
# https://github.com/actions/stale
name: Mark stale issues and pull requests

on:
schedule:
- cron: '22 12 * * *'

jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write

steps:
- uses: actions/stale@v8
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been inactive for 60 days. Remove stale label or comment or this will be closed in 7 days.'
stale-pr-message: 'This pull request is stale because it has been inactive for 60 days. Remove stale label or comment or this will be closed in 7 days.'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
74 changes: 57 additions & 17 deletions docs/notebooks/workflow_2_ring.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# ---
# jupyter:
# jupytext:
# cell_metadata_filter: -all
# custom_cell_magics: kql
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.11.2
# kernelspec:
# display_name: base
# language: python
# name: python3
# ---

# %% [markdown]
# # Ring filter
#
# ## Calculations
Expand All @@ -14,11 +31,12 @@
# - VpiL
# - Resistance

# +
# %%
import gdsfactory as gf
import numpy as np

gf.config.rich_output()
gf.CONF.display_type = "klayout"


def ring(
Expand Down Expand Up @@ -92,8 +110,8 @@ def ring(
plt.grid()
plt.legend()
plt.show()
# -

# %% [markdown]
# ## Layout
#
# gdsfactory easily enables you to layout Component with as many levels of hierarchy as you need.
Expand All @@ -102,29 +120,47 @@ def ring(
#
# Lets add two references in a component.

# +

# %%
import gdsfactory as gf
import toolz
from omegaconf import OmegaConf

c = gf.components.ring_single_heater(gap=0.2, radius=10, length_x=4)
c.plot()
# -

# %%
scene = c.to_3d()
scene.show()

# %% [markdown]
# Lets define a ring function that also accepts other component specs for the subcomponents (straight, coupler, bend)

ring = gf.components.ring_single_heater(gap=0.2, radius=10, length_x=4)
ring_with_grating_couplers = gf.routing.add_fiber_array(ring)
ring_with_grating_couplers

gf.routing.add_electrical_pads_top_dc(ring_with_grating_couplers)
# %%
xs = gf.cross_section.metal3(width=5)

gf.routing.add_electrical_pads_top(ring_with_grating_couplers)
ring = gf.components.ring_single_heater(gap=0.2, radius=10, length_x=4)
ring_with_pads = gf.routing.add_pads_top(
ring,
port_names=["r_e3", "l_e1"],
cross_section=xs,
optical_routing_type=None,
fanout_length=100,
)
ring_with_pads_grating_couplers = gf.routing.add_fiber_array(
ring_with_pads, with_loopback=True
)
ring_with_pads_grating_couplers.show()
ring_with_pads_grating_couplers.plot()

# %%
ring = gf.components.ring_single_heater(gap=0.2, radius=10, length_x=4)
ring_with_grating_couplers = gf.routing.add_fiber_array(ring, with_loopback=True)
c = gf.routing.add_electrical_pads_top(
ring_with_grating_couplers, port_names=["l_e1", "r_e3"]
)
c.plot()

# %% [markdown]
# ## Top reticle assembly
#
# Once you have your components and circuits defined, you can add them into a top reticle Component for fabrication.
Expand All @@ -136,7 +172,7 @@ def ring(
# - make sure you will be able to test te devices after fabrication. Obey DFT (design for testing) rules. For example, if your test setup works only for fiber array, what is the fiber array spacing (127 or 250um?)
# - if you plan to package your device, make sure you follow your packaging guidelines from your packaging house (min pad size, min pad pitch, max number of rows for wire bonding ...)

# +
# %%
nm = 1e-3
ring_te = toolz.compose(gf.routing.add_fiber_array, gf.components.ring_single)

Expand All @@ -149,7 +185,7 @@ def ring(
gf.routing.add_fiber_array(ring) for ring in rings_heater
]
rings_with_pads = [
gf.routing.add_electrical_pads_top(ring)
gf.routing.add_electrical_pads_top(ring, port_names=["l_e1", "r_e3"])
for ring in rings_heater_with_grating_couplers
]

Expand All @@ -166,9 +202,9 @@ def reticle(size=(1000, 1000)):


m = reticle(cache=False)
m
m.plot()

# +
# %%
nm = 1e-3
ring_te = toolz.compose(gf.routing.add_fiber_array, gf.components.ring_single)
rings = gf.grid([ring_te(radius=r) for r in [10, 20, 50]])
Expand Down Expand Up @@ -202,19 +238,23 @@ def reticle(size=(1000, 1000)):


m = reticle(cache=False)
m
# -
m.plot()

# %%
gdspath = m.write_gds(gdspath="mask.gds", with_metadata=True)

# %% [markdown]
# Make sure you save the GDS with metadata so when the chip comes back you remember what you have on it.
#
# You can also save the labels for automatic testing.

# %%
labels_path = gdspath.with_suffix(".csv")
gf.labels.write_labels.write_labels_klayout(gdspath=gdspath, layer_label=(66, 0))

# %%
mask_metadata = OmegaConf.load(gdspath.with_suffix(".yml"))
tm = gf.labels.merge_test_metadata(mask_metadata=mask_metadata, labels_path=labels_path)

# %%
tm.keys()

0 comments on commit d3f237d

Please sign in to comment.