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

add tag support for cell decorator #496

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

sebastian-goeldi
Copy link
Collaborator

Example usage:

import kfactory as kf


@kf.cell(tags=["onetag"])
def tagged_function() -> kf.KCell:
    return kf.KCell("IAmTagged!")


@kf.cell(tags=["onetag", "twotag", "threetag"])
def double_tagged_function() -> kf.KCell:
    return kf.KCell("IAmDoubleTagged")


@kf.cell(tags=["twotag"])
def second_tagged_function() -> kf.KCell:
    return kf.KCell("IAmSecondTagged")


print(f"{kf.kcl.factories.tags["onetag"]}")
print(f"{kf.kcl.factories.for_tags(["onetag", "twotag"])}")
print(f"{kf.kcl.factories.for_tags(["twotag"])}")
[<function tagged_function at 0x7fe1860b2e80>, <function double_tagged_function at 0x7fe17db7d800>]
[<function double_tagged_function at 0x7fe17db7d800>]
[<function double_tagged_function at 0x7fe17db7d800>, <function second_tagged_function at 0x7fe17db7d940>]

@sebastian-goeldi sebastian-goeldi linked an issue Oct 17, 2024 that may be closed by this pull request
Copy link
Contributor

sourcery-ai bot commented Oct 17, 2024

🧙 Sourcery has finished reviewing your pull request!


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

@github-actions github-actions bot added the enhancement New feature or request label Oct 17, 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.

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.

@sebastian-goeldi sebastian-goeldi merged commit 2b09d9b into main Oct 17, 2024
13 checks passed
@sebastian-goeldi sebastian-goeldi deleted the 425-add-tags-to-cell-decorator branch October 17, 2024 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add "tags" to cell decorator
1 participant