Skip to content

Commit

Permalink
ring tests
Browse files Browse the repository at this point in the history
  • Loading branch information
simbilod committed Oct 22, 2023
1 parent a24ea01 commit f5a0f1d
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions ubc2/ubc_simon_tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
"""Sample mask for the edx course Q1 2023."""

from functools import partial
from pathlib import Path

import gdsfactory as gf
import ubcpdk
import ubcpdk.components as pdk
from gdsfactory.components.bend_circular import bend_circular
from gdsfactory.components.via_stack import via_stack_heater_m3
from ubcpdk.tech import LAYER, strip

from ubc2.write_mask import write_mask_gds_with_metadata

via_stack_heater_m3_mini = partial(via_stack_heater_m3, size=(4, 4))


size = (605, 440)
add_gc = ubcpdk.components.add_fiber_array
layer_label = LAYER.TEXT
GC_PITCH = 127


def test_mask1() -> 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)
),
taper=gf.components.taper,
),
component_name=f"straight_width_{width}",
)
for width in widths
]
e += [
add_gc(
gf.add_tapers(
pdk.ring_single(
radius=12,
gap=0.2,
length_x=0,
length_y=0,
bend=bend_circular,
bend_coupler=bend_circular,
cross_section=gf.partial(strip, width=width),
pass_cross_section_to_bend=True,
),
taper=gf.components.taper,
),
component_name=f"ring_width_{width}_gap_{gap}",
)
for width in widths
for gap in [0.2, 0.3, 0.4]
]

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


if __name__ == "__main__":
m = test_mask1()
gf.show(m)

Check warning on line 69 in ubc2/ubc_simon_tests.py

View check run for this annotation

Codecov / codecov/patch

ubc2/ubc_simon_tests.py#L68-L69

Added lines #L68 - L69 were not covered by tests

0 comments on commit f5a0f1d

Please sign in to comment.