Skip to content

Commit

Permalink
more rings
Browse files Browse the repository at this point in the history
  • Loading branch information
simbilod committed Oct 22, 2023
1 parent f5a0f1d commit 6f3d806
Showing 1 changed file with 38 additions and 10 deletions.
48 changes: 38 additions & 10 deletions ubc2/ubc_simon_tests.py → ubc2/ubc_simon_rings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import ubcpdk.components as pdk
from gdsfactory.components.bend_circular import bend_circular
from gdsfactory.components.via_stack import via_stack_heater_m3
from gdsfactory.typings import Tuple
from ubcpdk.tech import LAYER, strip

from ubc2.write_mask import write_mask_gds_with_metadata
Expand All @@ -21,27 +22,36 @@
GC_PITCH = 127


def test_mask1() -> Path:
def test_mask_rings(
widths: Tuple[float] = (0.3, 0.4, 0.5),
gaps: Tuple[float] = (0.2, 0.3, 0.4),
radii: Tuple[float] = (12,),
name: str = "EBeam_simbilod_1",
) -> Path:
"""Rings with different waveguide widths and gaps."""
widths = [0.3, 0.4, 0.5]

e = [
add_gc(
gf.add_tapers(
ubcpdk.components.straight(
length=30, cross_section=gf.partial(strip, width=width)
length=2 * (radius + 3),
cross_section=gf.partial(
strip, width=width
), # 3 is default ring_coupler length extension
),
taper=gf.components.taper,
),
component_name=f"straight_width_{width}",
component_name=f"straight_width_{width:1.3f}",
)
for width in widths
for radius in radii
]
e += [
add_gc(
gf.add_tapers(
pdk.ring_single(
radius=12,
gap=0.2,
radius=radius,
gap=gap,
length_x=0,
length_y=0,
bend=bend_circular,
Expand All @@ -51,19 +61,37 @@ def test_mask1() -> Path:
),
taper=gf.components.taper,
),
component_name=f"ring_width_{width}_gap_{gap}",
component_name=f"ring_width_{width:1.3f}_gap_{gap:1.3f}_radius_{radius:1.3f}",
)
for width in widths
for gap in [0.2, 0.3, 0.4]
for gap in gaps
for radius in radii
]

c = gf.pack(e)
m = c[0]
m.name = "EBeam_simbilod_1"
m.name = name
_ = m << gf.components.rectangle(size=size, layer=LAYER.FLOORPLAN)
return write_mask_gds_with_metadata(m)


test_mask_rings_1 = gf.partial(test_mask_rings)
test_mask_rings_2 = gf.partial(
test_mask_rings, gaps=(0.25, 0.35, 0.45), name="EBeam_simbilod_2"
)
test_mask_rings_3 = gf.partial(
test_mask_rings,
gaps=(0.25, 0.35, 0.45),
widths=(0.5,),
radii=(
5,
8,
),
name="EBeam_simbilod_3",
)

if __name__ == "__main__":
m = test_mask1()
# m = test_mask_rings_1()
# m = test_mask_rings_2()
m = test_mask_rings_3()
gf.show(m)

Check warning on line 97 in ubc2/ubc_simon_rings.py

View check run for this annotation

Codecov / codecov/patch

ubc2/ubc_simon_rings.py#L96-L97

Added lines #L96 - L97 were not covered by tests

0 comments on commit 6f3d806

Please sign in to comment.