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

Improve layer stack #2726

Merged
merged 7 commits into from
May 9, 2024
Merged

Improve layer stack #2726

merged 7 commits into from
May 9, 2024

Conversation

joamatab
Copy link
Contributor

@joamatab joamatab commented May 8, 2024

@joamatab joamatab requested a review from simbilod May 8, 2024 22:26
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: 2 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.

@@ -65,7 +69,7 @@ def to_3d(
# print(layer, height, zmin, opacity, layer_view.visible)

if zmin is not None and layer_view.visible:
for polygon in polygons:
for polygon in layer_to_polygon[layer]:
Copy link
Contributor

Choose a reason for hiding this comment

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

issue (edge_case_not_handled): Check if 'layer_to_polygon' dictionary always contains all layers as keys to avoid KeyError.

@@ -94,6 +96,21 @@ def model_copy(self) -> LayerStack:
"""Returns a copy of the LayerStack."""
return LayerStack.model_validate_json(self.model_dump_json())

def pprint(self) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion (code_refinement): Consider renaming 'pprint' to a more descriptive method name indicating its specific functionality.

Suggested change
def pprint(self) -> None:
def print_layer_stack_table(self) -> None:

Copy link

codecov bot commented May 8, 2024

Codecov Report

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

Project coverage is 71.60%. Comparing base (d55a056) to head (614af21).

Files Patch % Lines
gdsfactory/technology/layer_stack.py 47.36% 10 Missing ⚠️
gdsfactory/export/to_svg.py 0.00% 6 Missing ⚠️
gdsfactory/export/to_stl.py 90.90% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2726      +/-   ##
==========================================
- Coverage   71.64%   71.60%   -0.05%     
==========================================
  Files         367      367              
  Lines       23857    23875      +18     
  Branches     3889     3893       +4     
==========================================
+ Hits        17092    17095       +3     
- Misses       5638     5656      +18     
+ Partials     1127     1124       -3     

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

@joamatab joamatab merged commit 141cd3d into main May 9, 2024
11 of 13 checks passed
@joamatab joamatab deleted the improve_layer_stack branch May 9, 2024 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
1 participant