Skip to content

Commit fa27405

Browse files
authored
Merge pull request #387 from gdsfactory/add_padding_layer_to_gplugins
Add padding layer to gplugins
2 parents 748ef64 + 1264b44 commit fa27405

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

gplugins/tidy3d/get_simulation_grating_coupler.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import matplotlib.pyplot as plt
1010
import numpy as np
1111
import tidy3d as td
12-
from gdsfactory.add_padding import add_padding
12+
from gdsfactory.add_padding import add_padding_container
1313
from gdsfactory.component import Component
1414
from gdsfactory.components.extension import move_polar_rad_copy
1515
from gdsfactory.config import logger
@@ -62,6 +62,7 @@ def get_simulation_grating_coupler(
6262
grid_spec: td.GridSpec | None = None,
6363
sidewall_angle_deg: float = 0,
6464
dilation: float = 0.0,
65+
padding_layer: tuple[int, int] = (67, 0),
6566
cross_section: CrossSectionSpec | None = None,
6667
**kwargs,
6768
) -> td.Simulation:
@@ -260,20 +261,23 @@ def get_simulation_grating_coupler(
260261
f"No port named {fiber_port_prefix!r} in {component.ports.keys()}"
261262
)
262263
add_padding_custom = partial(
263-
add_padding,
264+
add_padding_container,
264265
default=0,
266+
layers=(padding_layer,),
265267
top=ymargin or ymargin_top,
266268
bottom=ymargin or ymargin_bot,
267269
left=xmargin or xmargin_left,
268270
right=xmargin or xmargin_right,
269271
)
270272

271273
component_padding = layer_stack.get_component_with_derived_layers(
272-
component, decorator=add_padding_custom
274+
component,
273275
)
274276

277+
component_padding = add_padding_custom(component_padding)
278+
275279
component_extended = (
276-
gf.components.extension.extend_ports(
280+
gf.components.extend_ports(
277281
component=component_padding,
278282
length=port_extension,
279283
centered=True,

notebooks/femwell_01_modes.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
"id": "6",
126126
"metadata": {},
127127
"source": [
128-
"You can use them as inputs to other [femwell mode solver functions](https://github.com/HelgeGehring/femwell/blob/main/femwell/mode_solver.py) to inspect or analyze the modes:"
128+
"You can use them as inputs to other femwell mode solver functions to inspect or analyze the modes:"
129129
]
130130
},
131131
{

0 commit comments

Comments
 (0)