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

Fix DFT issue (Sourcery refactored) #182

Merged
merged 1 commit into from
Feb 8, 2023
Merged

Fix DFT issue (Sourcery refactored) #182

merged 1 commit into from
Feb 8, 2023

Conversation

sourcery-ai[bot]
Copy link
Contributor

@sourcery-ai sourcery-ai bot commented Feb 8, 2023

Pull Request #181 refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

NOTE: As code is pushed to the original Pull Request, Sourcery will
re-run and update (force-push) this Pull Request with new refactorings as
necessary. If Sourcery finds no refactorings at any point, this Pull Request
will be closed automatically.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the 118 branch, then run:

git fetch origin sourcery/118
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from joamatab February 8, 2023 16:19
@sourcery-ai
Copy link
Contributor Author

sourcery-ai bot commented Feb 8, 2023

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 3.80 ⭐ 3.86 ⭐ 0.06 👎
Method Length 43.69 ⭐ 43.47 ⭐ -0.22 👍
Working memory 7.25 🙂 7.29 🙂 0.04 👎
Quality 76.89% 76.69% -0.20% 👎
Other metrics Before After Change
Lines 887 883 -4
Changed files Quality Before Quality After Quality Change
ubcpdk/components.py 87.58% ⭐ 87.58% ⭐ 0.00%
ubcpdk/import_gds.py 57.60% 🙂 57.19% 🙂 -0.41% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
ubcpdk/import_gds.py add_ports_from_siepic_pins 18 🙂 282 ⛔ 18 ⛔ 26.57% 😞 Try splitting into smaller methods. Extract out complex expressions
ubcpdk/components.py ebeam_dc_halfring_straight 1 ⭐ 147 😞 15 😞 54.37% 🙂 Try splitting into smaller methods. Extract out complex expressions
ubcpdk/components.py dbr 0 ⭐ 115 🙂 12 😞 63.38% 🙂 Extract out complex expressions
ubcpdk/components.py dbg 0 ⭐ 81 🙂 12 😞 68.08% 🙂 Extract out complex expressions
ubcpdk/components.py add_fiber_array 0 ⭐ 44 ⭐ 10 😞 77.45% ⭐ 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!

c = gf.components.cavity(component=d, coupler=coupler)
return c
return gf.components.cavity(component=d, coupler=coupler)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Function dbr_cavity refactored with the following changes:

Comment on lines -620 to +619
c = add_fiber_array(component=component)
return c
return add_fiber_array(component=component)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Function dbr_cavity_te refactored with the following changes:

Comment on lines -761 to +759
c2 = add_fiber_array(component=c1, **kwargs)
return c2
return add_fiber_array(component=c1, **kwargs)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Function add_fiber_array_pads_rf refactored with the following changes:

c2 = gf.functions.mirror(component=c)
return c2
return gf.functions.mirror(component=c)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Function import_gc refactored with the following changes:

@joamatab joamatab merged commit b43a9f5 into 118 Feb 8, 2023
@joamatab joamatab deleted the sourcery/118 branch February 8, 2023 16:23
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.

1 participant