Skip to content
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

Merged
merged 4 commits into from Apr 22, 2024
Merged

Pdk improvements #2694

merged 4 commits into from Apr 22, 2024

Conversation

joamatab
Copy link
Contributor

@joamatab joamatab commented Apr 22, 2024

  • better defaults args for generic pdk

@joamatab joamatab added the maintenance patch label Apr 22, 2024
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @joamatab - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 3 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Docstrings: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

Comment on lines +19 to +21
input_straight_cross_section: CrossSectionSpec | None = None,
output_straight_cross_section: CrossSectionSpec | None = None,
cross_section: CrossSectionSpec = "xs_sc",
Copy link
Contributor

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 and output_straight_cross_section directly to cross_section if not provided.

This would simplify the logic and reduce redundancy in the code.

Suggested change
input_straight_cross_section: CrossSectionSpec | None = None,
output_straight_cross_section: CrossSectionSpec | None = None,
cross_section: CrossSectionSpec = "xs_sc",
input_straight_cross_section: CrossSectionSpec | None = None,
output_straight_cross_section: CrossSectionSpec | None = None,
cross_section: CrossSectionSpec = input_straight_cross_section or output_straight_cross_section or "xs_sc",

@@ -7,7 +7,7 @@

@gf.cell
def spiral_double(
min_bend_radius: float = 10.0,
min_bend_radius: float | None = None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (code_clarification): Clarify in the documentation the behavior when min_bend_radius is None.

Comment on lines +28 to +29
xs = gf.get_cross_section(cross_section)
min_bend_radius = min_bend_radius or xs.radius
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Validate xs.radius is not None before assignment to avoid potential runtime errors.

Copy link

codecov bot commented Apr 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.73%. Comparing base (1adbee1) to head (faf110a).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2694      +/-   ##
==========================================
+ Coverage   71.71%   71.73%   +0.01%     
==========================================
  Files         366      366              
  Lines       23769    23772       +3     
  Branches     3876     3875       -1     
==========================================
+ Hits        17047    17052       +5     
+ Misses       5592     5591       -1     
+ Partials     1130     1129       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@joamatab joamatab merged commit bb76dee into main Apr 22, 2024
9 checks passed
@joamatab joamatab deleted the pdk_improvements branch April 22, 2024 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant