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

basic klayout pcell implementation #524

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

sebastian-goeldi
Copy link
Collaborator

@sebastian-goeldi sebastian-goeldi commented Dec 2, 2024

Summary by Sourcery

Implement a basic PCell decorator in the kcell module to enhance cell management with caching and auto-naming capabilities. Update pre-commit configuration to use the latest versions of several tools, improving code quality checks and consistency.

New Features:

  • Introduce a new decorator function 'pcell' in the kcell module to cache and auto-name cells, with various configuration options for cell management.

Build:

  • Update pre-commit hooks to use newer versions of ruff, nbstripout, bandit, and mypy.

Copy link
Contributor

sourcery-ai bot commented Dec 2, 2024

Reviewer's Guide by Sourcery

This pull request introduces a new PCell decorator in the KCell class for caching and auto-naming cells, enhancing the functionality of the kfactory library. Additionally, it updates several pre-commit hooks to their latest versions to ensure code quality and consistency.

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

File-Level Changes

Change Details Files
Implemented a basic PCell decorator for caching and auto-naming cells
  • Added a new method 'pcell' to the KCell class
  • The 'pcell' method uses functools.cache to cache function calls
  • The method auto-generates cell names based on function arguments and keyword arguments
  • Introduced a nested class 'KPCell' inheriting from kdb.PCellDeclarationHelper
  • The 'KPCell' class initializes parameters based on function signature
  • The 'produce_impl' method in 'KPCell' calls the decorated function with parameters
src/kfactory/kcell.py
Updated pre-commit hooks to newer versions
  • Updated ruff-pre-commit hook version from v0.6.9 to v0.8.1
  • Updated nbstripout hook version from 0.7.1 to 0.8.1
  • Updated bandit hook version from 1.7.10 to 1.8.0
  • Updated mypy hook version from v1.11.2 to v1.13.0
.pre-commit-config.yaml

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 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

Copy link

github-actions bot commented Dec 2, 2024

Label error. Requires at least 1 of: breaking, bug, github_actions, documentation, dependencies, enhancement, feature, maintenance, security. Found:

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant