-
Notifications
You must be signed in to change notification settings - Fork 198
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
Add to svg #2723
Conversation
There was a problem hiding this 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
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
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 |
There was a problem hiding this comment.
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.
gdsfactory/export/to_svg.py
Outdated
@@ -0,0 +1,94 @@ | |||
# type: ignore |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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
)
Explanation
The 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.
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Codecov ReportAttention: Patch coverage is
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. |
convert component to SVG
@flaport