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 setter for kcl, there should be no setter #611

Merged
merged 2 commits into from
Feb 12, 2025
Merged

Conversation

sebastian-goeldi
Copy link
Collaborator

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

Summary by Sourcery

Remove the setter for the kcl property of KCell and GeometricObject. Update variable names for clarity.

Copy link
Contributor

sourcery-ai bot commented Feb 12, 2025

Reviewer's Guide by Sourcery

This pull request removes the setter for the kcl property and refactors several internal variable names and logic in related methods. The changes improve code clarity, eliminate unnecessary setters, and adjust the internal handling of cell metadata and transformation functionalities.

Updated Class Diagram for KCell and TKCell

classDiagram
    class KCell {
      +KCLayout kcl()  
      +__repr__()
      +convert_to_static()
      +transform(trans)
      +ports: DPorts
      -_base: TKCell
    }

    class TKCell {
      +KCLayout kcl
      +Info info
      +KCellSettings settings
      +kdb_cell: KDB_Cell
      +ports
      +vinsts: VInstances
    }

    KCell --> TKCell : contains

    %% Note: The setter for the kcl property has been removed for both KCell and TKCell context.
Loading

Updated Class Diagram for GeometricObject

classDiagram
    class GeometricObject {
      <<abstract>>
      +KCLayout kcl()
      +bbox(layer: int | None): BoxLike
    }

    %% Note: The setter for the kcl property has been removed from GeometricObject.
Loading

File-Level Changes

Change Details Files
Removal of the kcl setter property
  • Deleted the kcl setter method in kfactory/kcell.py.
  • Removed the abstract kcl setter declaration in kfactory/geometry.py.
src/kfactory/kcell.py
src/kfactory/geometry.py
Refactoring variable names and metadata handling
  • Renamed internal variables (e.g., kcl to kcl, name to name, kdb_cell to kdb_cell) for consistency.
  • Updated the conversion logic in convert_to_static to use renamed variables and correctly copy meta-data.
  • Modified the update of cell indices and reference handling in convert_to_static.
src/kfactory/kcell.py
Clean-up in transformation and layout methods
  • Replaced temporary variable names (e.g., _shapes to shapes) in the transform method.
  • Improved loop variable naming in the dbbox method for better clarity.
  • Adjusted parameter formatting in function definitions for consistency.
src/kfactory/kcell.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 the bug Something isn't working label Feb 12, 2025
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.

We've reviewed this pull request using the Sourcery rules engine. If you would also like our AI-powered code review then let us know.

Copy link

codecov bot commented Feb 12, 2025

Codecov Report

Attention: Patch coverage is 80.76923% with 5 lines in your changes missing coverage. Please review.

Project coverage is 65.76%. Comparing base (850cfcd) to head (43096e0).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/kfactory/kcell.py 80.76% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #611      +/-   ##
==========================================
- Coverage   65.79%   65.76%   -0.04%     
==========================================
  Files          64       64              
  Lines        9694     9691       -3     
  Branches     1802     1802              
==========================================
- Hits         6378     6373       -5     
  Misses       2793     2793              
- Partials      523      525       +2     

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

@sebastian-goeldi sebastian-goeldi merged commit 2c35c12 into main Feb 12, 2025
16 checks passed
@sebastian-goeldi sebastian-goeldi deleted the fix-kcl-setter branch February 12, 2025 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant