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 to svg #2723

Merged
merged 4 commits into from
May 6, 2024
Merged

Add to svg #2723

merged 4 commits into from
May 6, 2024

Conversation

joamatab
Copy link
Contributor

@joamatab joamatab commented May 6, 2024

convert component to SVG

@flaport

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

Hey @joamatab - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 3 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

gdsfactory/export/to_svg.py Outdated Show resolved Hide resolved
Defaults to active PDK.layer_views.
layer_stack: contains thickness and zmin for each layer.
Defaults to active PDK.layer_stack.
exclude_layers: layers to exclude. jk
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick (typo): Remove stray characters from the comment.

The characters 'jk' at the end of the comment seem to be accidentally added. Please remove them to maintain the cleanliness of the documentation.

@@ -0,0 +1,94 @@
# type: ignore
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question (code_clarification): Clarify the reason for using 'type: ignore'.

It would be helpful to add a comment explaining why 'type: ignore' is necessary here, as it could help future maintainers understand the context or specific type issues being avoided.

from gdsfactory.typings import Layer


def to_svg(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (code-quality): Low code quality found in to_svg - 20% (low-code-quality)


ExplanationThe quality score for this function is below the quality threshold of 25%.
This score is a combination of the method length, cognitive complexity and working memory.

How can you solve this?

It might be worth refactoring this function to make it shorter and more readable.

  • Reduce the function length by extracting pieces of functionality out into
    their own functions. This is the most important thing you can do - ideally a
    function should be less than 10 lines.
  • Reduce nesting, perhaps by introducing guard clauses to return early.
  • Ensure that variables are tightly scoped, so that code using related concepts
    sits together within the function rather than being scattered.

joamatab and others added 2 commits May 6, 2024 15:55
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Copy link

codecov bot commented May 6, 2024

Codecov Report

Attention: Patch coverage is 17.94872% with 32 lines in your changes are missing coverage. Please review.

Project coverage is 71.64%. Comparing base (a588f3c) to head (b256b95).

Files Patch % Lines
gdsfactory/export/to_svg.py 13.51% 32 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2723      +/-   ##
==========================================
- Coverage   71.73%   71.64%   -0.09%     
==========================================
  Files         366      367       +1     
  Lines       23818    23856      +38     
  Branches     3883     3889       +6     
==========================================
+ Hits        17086    17092       +6     
- Misses       5605     5637      +32     
  Partials     1127     1127              

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

@joamatab joamatab merged commit 9c3ef5c into main May 6, 2024
10 of 12 checks passed
@joamatab joamatab deleted the add_to_svg branch May 6, 2024 23:00
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.

None yet

1 participant