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

Empirical loss model for tidy3d mode solver (Sourcery refactored) #832

Closed
wants to merge 3 commits into from

Conversation

sourcery-ai[bot]
Copy link
Contributor

@sourcery-ai sourcery-ai bot commented Nov 10, 2022

Pull Request #831 refactored by Sourcery.

Since the original Pull Request was opened as a fork in a contributor's
repository, we are unable to create a Pull Request branching from it.

To incorporate these changes, you can either:

  1. Merge this Pull Request instead of the original, or

  2. Ask your contributor to locally incorporate these commits and push them to
    the original Pull Request

    Incorporate changes via command line
    git fetch https://github.com/gdsfactory/gdsfactory pull/831/head
    git merge --ff-only FETCH_HEAD
    git push

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:

Help us improve this pull request!

@sourcery-ai
Copy link
Contributor Author

sourcery-ai bot commented Nov 10, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 6.31 ⭐ 6.57 ⭐ 0.26 👎
Method Length 116.55 🙂 122.41 😞 5.86 👎
Working memory 14.71 😞 14.70 😞 -0.01 👍
Quality 52.09% 🙂 51.29% 🙂 -0.80% 👎
Other metrics Before After Change
Lines 907 949 42
Changed files Quality Before Quality After Quality Change
gdsfactory/simulation/gtidy3d/modes.py 52.09% 🙂 51.29% 🙂 -0.80% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
gdsfactory/simulation/gtidy3d/modes.py Waveguide.compute_modes 19 😞 822 ⛔ 28 ⛔ 17.37% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
gdsfactory/simulation/gtidy3d/modes.py Waveguide.get_n 11 🙂 497 ⛔ 19 ⛔ 28.01% 😞 Try splitting into smaller methods. Extract out complex expressions
gdsfactory/simulation/gtidy3d/modes.py plot 6 ⭐ 183 😞 15 😞 45.96% 😞 Try splitting into smaller methods. Extract out complex expressions
gdsfactory/simulation/gtidy3d/modes.py plot_sweep_width 5 ⭐ 206 ⛔ 13 😞 47.80% 😞 Try splitting into smaller methods. Extract out complex expressions
gdsfactory/simulation/gtidy3d/modes.py Waveguide.compute_mode_properties 2 ⭐ 207 ⛔ 11 😞 54.00% 🙂 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!

@sonarcloud
Copy link

sonarcloud bot commented Nov 10, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@codecov
Copy link

codecov bot commented Nov 10, 2022

Codecov Report

Merging #832 (b888768) into master (d759947) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #832   +/-   ##
=======================================
  Coverage   74.66%   74.66%           
=======================================
  Files         425      425           
  Lines       20979    20979           
  Branches     2840     2840           
=======================================
  Hits        15664    15664           
  Misses       4444     4444           
  Partials      871      871           

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

@sourcery-ai sourcery-ai bot closed this Nov 10, 2022
@sourcery-ai sourcery-ai bot deleted the sourcery/pull-831 branch November 10, 2022 06:51
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