Skip to content

Commit 9fdd39f

Browse files
Add type information
Signed-off-by: Lucas Heitzmann Gabrielli <lucas@flexcompute.com>
1 parent e69b3c5 commit 9fdd39f

3 files changed

Lines changed: 47 additions & 50 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "1.1.1"
44
authors = [{name = "Flexcompute Inc.", email = "info@flexcompute.com"}]
55
description = "SiEPIC PDK implementation for PhotonForge"
66
readme = "README.md"
7-
dependencies = ["photonforge >= 1.1.7"]
7+
dependencies = ["photonforge > 1.1.7"] # Need typing submodule
88

99
[project.optional-dependencies]
1010
test = ["pytest >= 7.2"]

siepic_forge/component.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
from importlib_resources import files, as_file
55

66
import math
7+
import typing
78
import warnings
89

910
import photonforge as pf
11+
import photonforge.typing as pft
1012

1113

1214
_symmetries_2port = [("P0", "P1", {"P1": "P0"})]
@@ -440,7 +442,7 @@
440442

441443

442444
def component(
443-
cell_name: str, technology: pf.Technology = None, tidy3d_model_kwargs: dict = {}
445+
cell_name: str, technology: typing.Optional[pf.Technology] = None, tidy3d_model_kwargs: pft.kwargs_for(pf.Tidy3DModel) = {}
444446
) -> pf.Component:
445447
"""Load a component from the default PDK library.
446448

siepic_forge/technology.py

Lines changed: 43 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,86 @@
11
import tidy3d as td
22
import photonforge as pf
3-
4-
5-
_Medium = td.components.medium.MediumType
3+
import photonforge.typing as pft
64

75

86
@pf.parametric_technology
97
def ebeam(
108
*,
11-
si_thickness: float = 0.220,
12-
si_slab_thickness: float = 0.090,
13-
sin_thickness: float = 0.400,
14-
si_mask_dilation: float = 0.0,
15-
si_slab_mask_dilation: float = 0.0,
16-
sin_mask_dilation: float = 0.0,
17-
sidewall_angle: float = 0.0,
18-
metal_si_separation: float = 2.2,
19-
router_thickness: float = 0.6,
20-
heater_thickness: float = 0.2,
21-
top_oxide_thickness: float = 0.3,
22-
bottom_oxide_thickness: float = 3.017,
9+
si_thickness: pft.PositiveDimension = 0.220,
10+
si_slab_thickness: pft.PositiveDimension = 0.090,
11+
sin_thickness: pft.PositiveDimension = 0.400,
12+
si_mask_dilation: pft.Coordinate = 0.0,
13+
si_slab_mask_dilation: pft.Coordinate = 0.0,
14+
sin_mask_dilation: pft.Coordinate = 0.0,
15+
sidewall_angle: pft.Angle = 0.0,
16+
metal_si_separation: pft.Dimension = 2.2,
17+
router_thickness: pft.PositiveDimension = 0.6,
18+
heater_thickness: pft.PositiveDimension = 0.2,
19+
top_oxide_thickness: pft.PositiveDimension = 0.3,
20+
bottom_oxide_thickness: pft.PositiveDimension = 3.017,
2321
include_top_opening: bool = False,
2422
include_substrate: bool = False,
25-
sio2: dict[str, _Medium] = {
23+
sio2: dict[str, pft.Medium] = {
2624
"optical": td.material_library["SiO2"]["Palik_Lossless"],
2725
"electrical": td.Medium(permittivity=4.2, name="SiO2"),
2826
},
29-
si: dict[str, _Medium] = {
27+
si: dict[str, pft.Medium] = {
3028
"optical": td.material_library["cSi"]["Li1993_293K"],
3129
"electrical": td.Medium(permittivity=12.3, name="Si"),
3230
},
33-
sin: dict[str, _Medium] = {
31+
sin: dict[str, pft.Medium] = {
3432
"optical": td.material_library["Si3N4"]["Luke2015PMLStable"],
3533
"electrical": td.Medium(permittivity=7.5, name="Si3N4"),
3634
},
37-
router_metal: dict[str, _Medium] = {
35+
router_metal: dict[str, pft.Medium] = {
3836
"optical": td.material_library["Au"]["JohnsonChristy1972"],
3937
"electrical": td.LossyMetalMedium(
4038
conductivity=17,
4139
frequency_range=[0.1e9, 200e9],
4240
fit_param=td.SurfaceImpedanceFitterParam(max_num_poles=16),
4341
),
4442
},
45-
heater_metal: dict[str, _Medium] = {
43+
heater_metal: dict[str, pft.Medium] = {
4644
"optical": td.material_library["W"]["Werner2009"],
4745
"electrical": td.LossyMetalMedium(
4846
conductivity=1.6,
4947
frequency_range=[0.1e9, 200e9],
5048
fit_param=td.SurfaceImpedanceFitterParam(max_num_poles=16),
5149
),
5250
},
53-
opening: _Medium = td.Medium(permittivity=1.0),
51+
opening: pft.Medium = td.Medium(permittivity=1.0),
5452
) -> pf.Technology:
5553
"""Create a technology for the e-beam PDK.
5654
5755
The current version does not extrude heaters or metal layers, nor oxide
5856
opening windows.
5957
6058
Args:
61-
si_thickness (float): Full silicon layer thickness.
62-
si_slab_thickness (float): Partially etched slab thickness in
63-
silicon.
64-
sin_thickness (float): SiN layer thickness.
65-
si_mask_dilation (float): Mask dilation for the full-thickness Si
59+
si_thickness: Full silicon layer thickness.
60+
si_slab_thickness: Partially etched slab thickness in silicon.
61+
sin_thickness: SiN layer thickness.
62+
si_mask_dilation: Mask dilation for the full-thickness Si layer.
63+
si_slab_mask_dilation: Mask dilation for the partially etched Si
64+
layer.
65+
sin_mask_dilation: Mask dilation for the SiN layer.
66+
sidewall_angle: Sidewall angle (in degrees) for Si and SiN etching.
67+
metal_si_separation: Separation between the metal layers and the Si
6668
layer.
67-
si_slab_mask_dilation (float): Mask dilation for the partially
68-
etched Si layer.
69-
sin_mask_dilation (float): Mask dilation for the SiN layer.
70-
sidewall_angle (float): Sidewall angle (in degrees) for Si and SiN
71-
etching.
72-
metal_si_separation (float): Separation between the metal layers and
73-
the Si layer.
74-
router_thickness (float): Thickness of the routing metal layer.
75-
heater_thickness (float): Thickness of the heater metal layer.
76-
top_oxide_thickness (float): Thickness of the top oxide clad,
77-
measured from the substrate.
78-
bottom_oxide_thickness (float): Thickness of the bottom oxide clad.
79-
include_top_opening (bool): Flag indicating whether or not to
80-
include the region above the top oxide.
81-
include_substrate (bool): Flag indicating whether or not to include
82-
the silicon substrate.
83-
sio2 (Medium): Background medium.
84-
si (Medium): Silicon medium.
85-
sin (Medium): Silicon nitride medium.
86-
router_metal (Medium): Routing metal medium.
87-
heater_metal (Medium): Heater metal medium.
88-
opening (Medium): Medium for openings.
69+
router_thickness: Thickness of the routing metal layer.
70+
heater_thickness: Thickness of the heater metal layer.
71+
top_oxide_thickness: Thickness of the top oxide clad, measured from
72+
the substrate.
73+
bottom_oxide_thickness: Thickness of the bottom oxide clad.
74+
include_top_opening: Flag indicating whether or not to include the
75+
region above the top oxide.
76+
include_substrate: Flag indicating whether or not to include the
77+
silicon substrate.
78+
sio2: Background medium.
79+
si: Silicon medium.
80+
sin: Silicon nitride medium.
81+
router_metal: Routing metal medium.
82+
heater_metal: Heater metal medium.
83+
opening: Medium for openings.
8984
9085
Returns:
9186
Technology: E-Beam PDK technology definition.

0 commit comments

Comments
 (0)