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

fixing position of rotated "no orientation" ports #951

Merged

Conversation

tvt173
Copy link
Collaborator

@tvt173 tvt173 commented Dec 2, 2022

Hi @joamatab , we found a pretty serious bug today.

When references are rotated, ports with no orientation are not correctly transformed. This PR fixes that bug and adds a simple test for this case.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Dec 2, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 3.32 ⭐ 3.02 ⭐ -0.30 👍
Method Length 53.12 ⭐ 54.06 ⭐ 0.94 👎
Working memory 7.71 🙂 7.66 🙂 -0.05 👍
Quality 72.74% 🙂 72.98% 🙂 0.24% 👍
Other metrics Before After Change
Lines 802 825 23
Changed files Quality Before Quality After Quality Change
gdsfactory/component_reference.py 72.24% 🙂 72.58% 🙂 0.34% 👍
gdsfactory/tests/test_rotate.py 84.77% ⭐ 76.99% ⭐ -7.78% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
gdsfactory/component_reference.py ComponentReference.move 15 🙂 280 ⛔ 15 😞 31.99% 😞 Try splitting into smaller methods. Extract out complex expressions
gdsfactory/component_reference.py ComponentReference.__init__ 2 ⭐ 149 😞 18 ⛔ 50.17% 🙂 Try splitting into smaller methods. Extract out complex expressions
gdsfactory/component_reference.py ComponentReference.connect 6 ⭐ 154 😞 12 😞 52.94% 🙂 Try splitting into smaller methods. Extract out complex expressions
gdsfactory/component_reference.py SizeInfo.__init__ 0 ⭐ 216 ⛔ 10 😞 57.27% 🙂 Try splitting into smaller methods. Extract out complex expressions
gdsfactory/component_reference.py ComponentReference.mirror 2 ⭐ 189 😞 8 🙂 61.54% 🙂 Try splitting into smaller methods

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 Dec 2, 2022

Codecov Report

Merging #951 (dd48abb) into master (3ad6c48) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #951      +/-   ##
==========================================
+ Coverage   74.36%   74.39%   +0.03%     
==========================================
  Files         430      430              
  Lines       21987    22005      +18     
  Branches     2940     2938       -2     
==========================================
+ Hits        16350    16371      +21     
+ Misses       4749     4748       -1     
+ Partials      888      886       -2     
Impacted Files Coverage Δ
gdsfactory/component_reference.py 74.32% <100.00%> (+0.52%) ⬆️
gdsfactory/tests/test_rotate.py 100.00% <100.00%> (ø)

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

@joamatab joamatab merged commit dd48abb into gdsfactory:master Dec 2, 2022
@joamatab
Copy link
Contributor

joamatab commented Dec 2, 2022

Thank you Troy!

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

2 participants