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

make Component.remap_layers safe #1240

Merged
merged 5 commits into from Feb 5, 2023
Merged

make Component.remap_layers safe #1240

merged 5 commits into from Feb 5, 2023

Conversation

joamatab
Copy link
Contributor

@joamatab joamatab commented Feb 5, 2023

  • make Component.remap_layers safe
  • add test for remap_layers

#1238

@bradley-w-snyder

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 5, 2023

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.06%.

Quality metrics Before After Change
Complexity 12.55 🙂 12.31 🙂 -0.24 👍
Method Length 84.15 🙂 84.11 🙂 -0.04 👍
Working memory 10.63 😞 10.61 😞 -0.02 👍
Quality 56.63% 🙂 56.69% 🙂 0.06% 👍
Other metrics Before After Change
Lines 3692 3689 -3
Changed files Quality Before Quality After Quality Change
gdsfactory/component.py 65.47% 🙂 65.42% 🙂 -0.05% 👎
gdsfactory/path.py 43.66% 😞 43.81% 😞 0.15% 👍

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
gdsfactory/path.py extrude 87 ⛔ 1011 ⛔ 28 ⛔ 1.56% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
gdsfactory/path.py transition 22 😞 450 ⛔ 20 ⛔ 18.98% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
gdsfactory/component.py Component._write_library 20 😞 356 ⛔ 18 ⛔ 23.01% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
gdsfactory/component.py flatten_invalid_refs_recursive 20 😞 325 ⛔ 27.26% 😞 Refactor to reduce nesting. Try splitting into smaller methods
gdsfactory/path.py euler 11 🙂 503 ⛔ 20 ⛔ 27.31% 😞 Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@codecov
Copy link

codecov bot commented Feb 5, 2023

Codecov Report

Merging #1240 (051d74e) into main (6012cdd) will increase coverage by 0.08%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1240      +/-   ##
==========================================
+ Coverage   68.57%   68.66%   +0.08%     
==========================================
  Files         354      354              
  Lines       21071    21070       -1     
  Branches     3034     3033       -1     
==========================================
+ Hits        14450    14467      +17     
+ Misses       5767     5750      -17     
+ Partials      854      853       -1     
Impacted Files Coverage Δ
gdsfactory/path.py 73.15% <ø> (-0.09%) ⬇️
gdsfactory/component.py 68.25% <100.00%> (+1.89%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@joamatab joamatab merged commit 6c322ac into main Feb 5, 2023
@joamatab joamatab deleted the 633c branch February 5, 2023 22:16
simbilod pushed a commit to simbilod/gdsfactory that referenced this pull request Mar 2, 2023
make Component.remap_layers safe

Former-commit-id: 63d25f6 [formerly 6c322ac]
Former-commit-id: a027e38683c91577714be747b1fa73a39f93e1f3
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.

None yet

1 participant