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

664b #1448

Merged
merged 2 commits into from Mar 18, 2023
Merged

664b #1448

merged 2 commits into from Mar 18, 2023

Conversation

joamatab
Copy link
Contributor

  • gf.add_ports() can overwrite new port settings. This is useful for changing port types when promoting ports to a higher hiearchical level.
  • Component.auto_rename_ports can rename specific port types with specific port_prefix

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Mar 18, 2023

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.42%.

Quality metrics Before After Change
Complexity 6.53 ⭐ 6.69 ⭐ 0.16 👎
Method Length 76.48 🙂 77.20 🙂 0.72 👎
Working memory 8.66 🙂 8.72 🙂 0.06 👎
Quality 63.55% 🙂 63.13% 🙂 -0.42% 👎
Other metrics Before After Change
Lines 3804 3858 54
Changed files Quality Before Quality After Quality Change
docs/notebooks/041_routing_electrical.py 46.75% 😞 46.74% 😞 -0.01% 👎
gdsfactory/component.py 66.18% 🙂 65.65% 🙂 -0.53% 👎
gdsfactory/port.py 61.51% 🙂 61.41% 🙂 -0.10% 👎
gdsfactory/components/pad.py 62.91% 🙂 63.02% 🙂 0.11% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
gdsfactory/component.py Component._write_library 25 😞 470 ⛔ 17 ⛔ 19.24% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
gdsfactory/component.py Component.add_port 19 😞 218 ⛔ 14 😞 33.34% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
gdsfactory/component.py Component.plot_holoviews 14 🙂 475 ⛔ 12 😞 33.50% 😞 Try splitting into smaller methods. Extract out complex expressions
gdsfactory/component.py Component.add_polygon 18 🙂 282 ⛔ 12 😞 33.79% 😞 Try splitting into smaller methods. Extract out complex expressions
gdsfactory/component.py Component.remap_layers 29 😞 216 ⛔ 10 😞 33.89% 😞 Refactor to reduce nesting. 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 Mar 18, 2023

Codecov Report

Merging #1448 (0dd709c) into main (96a63e4) will decrease coverage by 0.02%.
The diff coverage is 57.14%.

@@            Coverage Diff             @@
##             main    #1448      +/-   ##
==========================================
- Coverage   69.20%   69.19%   -0.02%     
==========================================
  Files         369      369              
  Lines       22470    22480      +10     
  Branches     3254     3259       +5     
==========================================
+ Hits        15551    15555       +4     
- Misses       5984     5987       +3     
- Partials      935      938       +3     
Impacted Files Coverage Δ
gdsfactory/components/pad.py 85.41% <ø> (ø)
gdsfactory/component.py 65.94% <55.55%> (-0.13%) ⬇️
gdsfactory/port.py 65.27% <60.00%> (-0.33%) ⬇️

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

@joamatab joamatab merged commit d6157cb into main Mar 18, 2023
8 of 10 checks passed
@joamatab joamatab deleted the 664b branch March 18, 2023 22:59
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