Layer
layer
LayerEnum
Bases: int, Enum
Class for having the layers stored and a mapping int <-> layer,datatype.
This Enum can also be treated as a tuple, i.e. it implements __getitem__
and __len__.
Attributes:
| Name | Type | Description |
|---|---|---|
layer |
int
|
layer number |
datatype |
int
|
layer datatype |
Source code in kfactory/layer.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | |
__getitem__
__getitem__(key: int) -> int
Retrieve layer number[0] / datatype[1] of a layer.
Source code in kfactory/layer.py
111 112 113 114 115 116 117 118 119 120 121 | |
__init__
__init__(layer: int, datatype: int) -> None
Just here to make sure klayout knows the layer name.
Source code in kfactory/layer.py
87 88 89 | |
__iter__
__iter__() -> Iterator[int]
Allow for loops to iterate over the LayerEnum.
Source code in kfactory/layer.py
127 128 129 | |
__len__
__len__() -> int
A layer has length 2, layer number and datatype.
Source code in kfactory/layer.py
123 124 125 | |
__new__
__new__(layer: int, datatype: int) -> Self
Create a new Enum.
Because it needs to act like an integer an enum is created and expanded.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer
|
int
|
Layer number of the layer. |
required |
datatype
|
int
|
Datatype of the layer. |
required |
Source code in kfactory/layer.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | |
__str__
__str__() -> str
Return the name of the LayerEnum.
Source code in kfactory/layer.py
131 132 133 | |
LayerInfos
pydantic-model
Bases: BaseModel
Class to store and serialize LayerInfos used in KCLayout.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
kwargs
|
Any
|
kdb.LayerInfo . if any extra field is not a kdb.LayerInfo, the validator will raise a ValidationError. |
{}
|
Config:
arbitrary_types_allowed:Trueextra:allow
Validators:
-
_validate_layers
Source code in kfactory/layer.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
__init__
__init__(**kwargs: Any) -> None
Initialize the LayerInfos class.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
kwargs
|
Any
|
kdb.LayerInfo . if any extra field is not a kdb.LayerInfo, the validator will raise a ValidationError. |
{}
|
Source code in kfactory/layer.py
37 38 39 40 41 42 43 44 | |
LayerLevel
pydantic-model
Bases: BaseModel
Level for 3D LayerStack.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer
|
tuple[int, int] | LayerInfo
|
(GDSII Layer number, GDSII datatype). |
required |
thickness
|
float
|
layer thickness in um. |
required |
thickness_tolerance
|
float | None
|
layer thickness tolerance in um. |
None
|
zmin
|
float
|
height position where material starts in um. |
required |
material
|
str | None
|
material name. |
None
|
sidewall_angle
|
float
|
in degrees with respect to normal. |
0.0
|
z_to_bias
|
tuple[int, ...] | None
|
parametrizes shrinking/expansion of the design GDS layer when extruding from zmin (0) to zmin + thickness (1). Defaults no buffering [[0, 1], [0, 0]]. |
None
|
info
|
Info | None
|
simulation_info and other types of metadata. mesh_order: lower mesh order (1) will have priority over higher mesh order (2) in the regions where materials overlap. refractive_index: refractive_index can be int, complex or function that depends on wavelength (um). type: grow, etch, implant, or background. mode: octagon, taper, round. https://gdsfactory.github.io/klayout_pyxs/DocGrow.html into: etch into another layer. https://gdsfactory.github.io/klayout_pyxs/DocGrow.html doping_concentration: for implants. resistivity: for metals. bias: in um for the etch. |
None
|
Fields:
-
layer(tuple[int, int]) -
thickness(float) -
thickness_tolerance(float | None) -
zmin(float) -
material(str | None) -
sidewall_angle(float) -
z_to_bias(tuple[int, ...] | None) -
info(Info)
Source code in kfactory/layer.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | |
LayerStack
pydantic-model
Bases: BaseModel
For simulation and 3D rendering.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layers
|
LayerLevel
|
dict of layer_levels. |
{}
|
Fields:
-
layers(dict[str, LayerLevel])
Source code in kfactory/layer.py
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | |
__getitem__
__getitem__(key: str) -> LayerLevel
Access layer stack elements.
Source code in kfactory/layer.py
250 251 252 253 254 255 256 | |
__init__
__init__(**layers: LayerLevel) -> None
Add LayerLevels automatically for subclassed LayerStacks.
Source code in kfactory/layer.py
207 208 209 | |
get_layer_to_info
get_layer_to_info() -> dict[tuple[int, int], Info]
Returns layer tuple to info dict.
Source code in kfactory/layer.py
241 242 243 | |
get_layer_to_material
get_layer_to_material() -> dict[tuple[int, int], str]
Returns layer tuple to material name.
Source code in kfactory/layer.py
225 226 227 228 229 230 231 | |
get_layer_to_sidewall_angle
get_layer_to_sidewall_angle() -> dict[
tuple[int, int], float
]
Returns layer tuple to material name.
Source code in kfactory/layer.py
233 234 235 236 237 238 239 | |
get_layer_to_thickness
get_layer_to_thickness() -> dict[tuple[int, int], float]
Returns layer tuple to thickness (um).
Source code in kfactory/layer.py
211 212 213 214 215 216 217 | |
get_layer_to_zmin
get_layer_to_zmin() -> dict[tuple[int, int], float]
Returns layer tuple to z min position (um).
Source code in kfactory/layer.py
219 220 221 222 223 | |