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

meep plugin and docs improvements #510

Merged
merged 3 commits into from Jun 30, 2022
Merged

meep plugin and docs improvements #510

merged 3 commits into from Jun 30, 2022

Conversation

joamatab
Copy link
Contributor

  • better docstrings with autodoc_typehints = "description"
  • improve meep plugin.
    • remove port_field_monitor_name parameter (no longer needed) thanks to meep 1.23 introduced to use the energy in the whole simulation to determine when to terminate, which is a better termination condition than the energy at the ports. PR. Requires meep 1.23 or newer.
    • update termination condition for grating_coupler simulations.
    • rename effective permitivity to get_effective index. Change units from meters to um, and permitivities to refractive_index to be consistent with gdsfactory units in um.
  • add gf.generate_doe PR
  • add add_center_section to CrossSection and cross_section for slot cross_section PR fixes

@joamatab joamatab merged commit 22d6de6 into master Jun 30, 2022
@joamatab joamatab deleted the 5125 branch June 30, 2022 16:36
@joamatab joamatab changed the title 5125 meep plugin improvements Jun 30, 2022
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jun 30, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 14.01 🙂 13.83 🙂 -0.18 👍
Method Length 155.53 😞 170.41 😞 14.88 👎
Working memory 20.98 ⛔ 21.26 ⛔ 0.28 👎
Quality 40.16% 😞 39.70% 😞 -0.46% 👎
Other metrics Before After Change
Lines 3180 3047 -133
Changed files Quality Before Quality After Quality Change
docs/conf.py 77.62% ⭐ 77.30% ⭐ -0.32% 👎
gdsfactory/simulation/gmeep/get_material.py 72.23% 🙂 72.23% 🙂 0.00%
gdsfactory/simulation/gmeep/get_simulation.py 19.79% ⛔ 22.20% ⛔ 2.41% 👍
gdsfactory/simulation/gmeep/get_simulation_grating_fiber.py 39.55% 😞 39.55% 😞 0.00%
gdsfactory/simulation/gmeep/test_eigenmode.py 47.97% 😞 47.97% 😞 0.00%
gdsfactory/simulation/gmeep/test_write_sparameters_meep.py 72.34% 🙂 72.34% 🙂 0.00%
gdsfactory/simulation/gmeep/write_sparameters_grating.py 42.83% 😞 42.86% 😞 0.03% 👍
gdsfactory/simulation/gmeep/write_sparameters_meep.py 21.87% ⛔ 21.87% ⛔ 0.00%
gdsfactory/simulation/gmeep/write_sparameters_meep_batch.py 32.03% 😞 32.03% 😞 0.00%
gdsfactory/simulation/gmeep/write_sparameters_meep_mpi.py 35.32% 😞 35.32% 😞 0.00%

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

File Function Complexity Length Working Memory Quality Recommendation
gdsfactory/simulation/gmeep/write_sparameters_meep.py write_sparameters_meep 51 ⛔ 942 ⛔ 37 ⛔ 3.28% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
gdsfactory/simulation/gmeep/get_simulation.py get_simulation 23 😞 657 ⛔ 40 ⛔ 13.68% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
gdsfactory/simulation/gmeep/write_sparameters_meep_batch.py write_sparameters_meep_batch 23 😞 322 ⛔ 15 😞 24.74% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
gdsfactory/simulation/gmeep/write_sparameters_meep_mpi.py write_sparameters_meep_mpi 14 🙂 341 ⛔ 18 ⛔ 28.00% 😞 Try splitting into smaller methods. Extract out complex expressions
gdsfactory/simulation/gmeep/get_simulation_grating_fiber.py get_simulation_grating_fiber 5 ⭐ 990 ⛔ 53 ⛔ 28.40% 😞 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!

@joamatab joamatab changed the title meep plugin improvements meep plugin and docs improvements Jun 30, 2022
@sonarcloud
Copy link

sonarcloud bot commented Jun 30, 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 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@joamatab joamatab mentioned this pull request Jun 30, 2022
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