-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename fiber ports #2700
Rename fiber ports #2700
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,8 +18,20 @@ | |
Float2, | ||
) | ||
|
||
edge_coupler_silicon = partial(taper, width2=0.2, length=100, with_two_ports=True) | ||
edge_coupler_silicon_2 = partial(taper, width2=0.2, length=130, with_two_ports=True) | ||
edge_coupler_silicon = partial( | ||
taper, | ||
width2=0.2, | ||
length=100, | ||
with_two_ports=True, | ||
port_order_types=("optical", "edge_te"), | ||
Comment on lines
+21
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (testing): Missing test for updated port_order_types parameter. The changes to the 'port_order_types' parameter in 'edge_coupler_silicon' and 'edge_coupler_silicon_2' should be covered by unit tests to ensure that the new naming convention is correctly implemented and does not affect other functionalities. |
||
) | ||
edge_coupler_silicon_2 = partial( | ||
taper, | ||
width2=0.2, | ||
length=130, | ||
with_two_ports=True, | ||
port_order_types=("optical", "edge_te"), | ||
) | ||
|
||
|
||
@gf.cell | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -100,7 +100,6 @@ def grating_taper_points( | |||||||||||||||||||
|
||||||||||||||||||||
@gf.cell | ||||||||||||||||||||
def grating_coupler_elliptical( | ||||||||||||||||||||
polarization: str = "te", | ||||||||||||||||||||
taper_length: float = 16.6, | ||||||||||||||||||||
taper_angle: float = 40.0, | ||||||||||||||||||||
wavelength: float = 1.554, | ||||||||||||||||||||
|
@@ -115,12 +114,12 @@ def grating_coupler_elliptical( | |||||||||||||||||||
slab_offset: float = 2.0, | ||||||||||||||||||||
spiked: bool = True, | ||||||||||||||||||||
cross_section: CrossSectionSpec = "xs_sc", | ||||||||||||||||||||
polarization: str = "te", | ||||||||||||||||||||
**kwargs, | ||||||||||||||||||||
) -> Component: | ||||||||||||||||||||
r"""Grating coupler with parametrization based on Lumerical FDTD simulation. | ||||||||||||||||||||
|
||||||||||||||||||||
Args: | ||||||||||||||||||||
polarization: te or tm. | ||||||||||||||||||||
taper_length: taper length from input. | ||||||||||||||||||||
taper_angle: grating flare angle. | ||||||||||||||||||||
wavelength: grating transmission central wavelength (um). | ||||||||||||||||||||
|
@@ -135,6 +134,7 @@ def grating_coupler_elliptical( | |||||||||||||||||||
slab_offset: in um. | ||||||||||||||||||||
spiked: grating teeth have sharp spikes to avoid non-manhattan drc errors. | ||||||||||||||||||||
cross_section: specification (CrossSection, string or dict). | ||||||||||||||||||||
polarization: te or tm. | ||||||||||||||||||||
kwargs: cross_section settings. | ||||||||||||||||||||
|
||||||||||||||||||||
.. code:: | ||||||||||||||||||||
|
@@ -259,7 +259,7 @@ def grating_coupler_elliptical( | |||||||||||||||||||
width=10, | ||||||||||||||||||||
orientation=0, | ||||||||||||||||||||
layer=layer, | ||||||||||||||||||||
port_type="optical", | ||||||||||||||||||||
port_type=f"optical_{polarization}", | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (testing): Missing test for dynamic port_type based on polarization. The introduction of a dynamic 'port_type' based on the 'polarization' parameter should be validated through tests to ensure that it behaves as expected across different inputs.
Suggested change
|
||||||||||||||||||||
) | ||||||||||||||||||||
|
||||||||||||||||||||
xs.add_bbox(c) | ||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -141,7 +141,7 @@ def grating_coupler_rectangular( | |||||||||||||||||||||
xport = np.round((x0 + cgrating.x) / 2, 3) | ||||||||||||||||||||||
c.add_port( | ||||||||||||||||||||||
name="o2", | ||||||||||||||||||||||
port_type="optical", | ||||||||||||||||||||||
port_type=f"vertical_{polarization}", | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (testing): Ensure consistency in port naming convention. The test should verify that the new 'vertical_{polarization}' naming is consistent across all components and does not introduce discrepancies.
Suggested change
|
||||||||||||||||||||||
center=(xport, 0), | ||||||||||||||||||||||
orientation=0, | ||||||||||||||||||||||
width=width_grating, | ||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (code_clarification): Consider documenting the addition of 'port_order_types' parameter.
Adding new parameters can affect how the function is used or its outputs. It's important to update the documentation to reflect these changes and provide guidance on how to use the new parameter.