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

Fix electrical route bundle #605

Merged
merged 8 commits into from
Feb 11, 2025
Merged

Conversation

sebastian-goeldi
Copy link
Collaborator

@sebastian-goeldi sebastian-goeldi commented Feb 9, 2025

Fix the um-based routings. Needed for gdsfactory/gdsfactory#3653

Copy link
Contributor

sourcery-ai bot commented Feb 9, 2025

Reviewer's Guide by Sourcery

This pull request refactors the route_bundle function in the electrical routing module by adding overloads for DKCell and DPort types, expanding parameter support, and adjusting type conversions. Additionally, the optical routing module has been updated to use unit conversions based on micrometers (um) instead of dbu in the straight factory function.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Refactored the route_bundle function in the electrical routing module.
  • Added new overloads for route_bundle to support both KCell and DKCell types with corresponding port types.
  • Expanded the function signature with additional parameters such as bend90_cell, taper_cell, min_straight_taper, place_port_type, and several boolean flags to allow more flexible routing options.
  • Updated parameter types to use Sequence and optional types, including union types for dbu and um.
  • Implemented conditional routing logic based on the instance type of the cell (KCell vs. DKCell) to properly handle type conversions, especially for separation and bounding box parameters.
src/kfactory/routing/electrical.py
Modified the route_bundle function in the optical routing module for unit conversion.
  • Updated the _straight_factory function to call the straight_factory with width and length converted via c.kcl.to_um instead of to_dbu.
  • Applied a cast to the expected StraightFactoryUM type to ensure compatibility with the new unit conversion.
src/kfactory/routing/optical.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions github-actions bot added bug Something isn't working routing labels Feb 9, 2025
Copy link

codecov bot commented Feb 9, 2025

Codecov Report

Attention: Patch coverage is 35.38462% with 42 lines in your changes missing coverage. Please review.

Project coverage is 65.77%. Comparing base (19691f9) to head (beb1218).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
src/kfactory/routing/electrical.py 20.00% 31 Missing and 1 partial ⚠️
src/kfactory/routing/optical.py 53.84% 6 Missing ⚠️
src/kfactory/cross_section.py 57.14% 3 Missing ⚠️
src/kfactory/enclosure.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #605      +/-   ##
==========================================
- Coverage   65.94%   65.77%   -0.17%     
==========================================
  Files          64       64              
  Lines        9656     9693      +37     
  Branches     1787     1802      +15     
==========================================
+ Hits         6368     6376       +8     
- Misses       2762     2793      +31     
+ Partials      526      524       -2     

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

@sebastian-goeldi sebastian-goeldi marked this pull request as ready for review February 9, 2025 22:27
@sebastian-goeldi sebastian-goeldi merged commit 9d0364e into main Feb 11, 2025
15 of 16 checks passed
@sebastian-goeldi sebastian-goeldi deleted the fix-electrical-route-bundle branch February 11, 2025 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working routing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants