gdsfactory / kfactory

gdsfactory with a klayout backend
https://gdsfactory.github.io/kfactory/
MIT License
34 stars 13 forks source link

fix str(Port) #512

Closed sebastian-goeldi closed 2 weeks ago

sebastian-goeldi commented 2 weeks ago

Summary by Sourcery

Bug Fixes:

sourcery-ai[bot] commented 2 weeks ago

Reviewer's Guide by Sourcery

The PR fixes the string representation of Port objects by replacing the layer name logic with the layer_info property, simplifying the code and making it more consistent.

Updated class diagram for Port class

classDiagram
    class Port {
        - name: String
        - dwidth: Float
        - dcplx_trans: Transformation
        - layer_info: LayerInfo
        - port_type: PortType
        + hash() bytes
        + __repr__() str
        + print(type: Literal["dbu", "um", None]) void
    }
    note for Port "Updated __repr__ method to use layer_info instead of layer name logic"

File-Level Changes

Change Details Files
Updated Port.repr() method to use layer_info property
  • Removed custom layer name handling logic
  • Replaced layer name logic with direct layer_info property access
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. - **Generate a pull request title:** Write `@sourcery-ai` anywhere in the pull request title to generate a 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. You can also use this command to specify where the summary should be inserted. #### Customizing Your Experience Access your [dashboard](https://app.sourcery.ai) 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 - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).