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
Pdk improvements #2694
Pdk improvements #2694
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 |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
|
||
@gf.cell | ||
def spiral_double( | ||
min_bend_radius: float = 10.0, | ||
min_bend_radius: float | None = None, | ||
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 (code_clarification): Clarify in the documentation the behavior when |
||
separation: float = 2.0, | ||
number_of_loops: float = 3, | ||
npoints: int = 1000, | ||
|
@@ -17,14 +17,16 @@ def spiral_double( | |
"""Returns a spiral double (spiral in, and then out). | ||
|
||
Args: | ||
min_bend_radius: inner radius of the spiral. | ||
min_bend_radius: inner radius of the spiral. Defaults to cross_section radius. | ||
separation: separation between the loops. | ||
number_of_loops: number of loops per spiral. | ||
npoints: points for the spiral. | ||
cross_section: cross-section to extrude the structure with. | ||
bend: factory for the bends in the middle of the double spiral. | ||
""" | ||
component = gf.Component() | ||
xs = gf.get_cross_section(cross_section) | ||
min_bend_radius = min_bend_radius or xs.radius | ||
Comment on lines
+28
to
+29
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. issue (bug_risk): Validate |
||
|
||
bend = gf.get_component( | ||
bend, radius=min_bend_radius / 2, angle=180, cross_section=cross_section | ||
|
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_refinement): Consider initializing
input_straight_cross_section
andoutput_straight_cross_section
directly tocross_section
if not provided.This would simplify the logic and reduce redundancy in the code.