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

591d #449

Merged
merged 14 commits into from Jun 14, 2022
Merged

591d #449

merged 14 commits into from Jun 14, 2022

Conversation

joamatab
Copy link
Contributor

  • rename LayerSet to LayerColors, as it is a more intuitive name. We only use this for defining 3D and 2D plot colors.
  • add Pdk attributes
    • layer_stack: Optional[LayerStack] = None
    • layer_colors: Optional[LayerColors] = None
    • sparameters_path: PathType
  • add Component.to_3d()
  • add gf.pdk.get_layer_stack() for 3D rendering and simulation plugins
    • gf.simulation.lumerical.write_sparameters_lumerical
    • gf.simulation.gmeep.write_sparameters_meep
    • gf.simulation.tidy3d.write_sparameters
  • modify Component.plot() to use colors from gf.pdk.get_layer_colors()

@joamatab joamatab merged commit f3d9c0d into master Jun 14, 2022
@joamatab joamatab deleted the 591d branch June 14, 2022 01:46
@sonarcloud
Copy link

sonarcloud bot commented Jun 14, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug C 1 Bug
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 8 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jun 14, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 13.89 🙂 14.06 🙂 0.17 👎
Method Length 89.97 🙂 88.54 🙂 -1.43 👍
Working memory 17.32 ⛔ 17.12 ⛔ -0.20 👍
Quality 49.55% 😞 49.78% 😞 0.23% 👍
Other metrics Before After Change
Lines 9609 9820 211
Changed files Quality Before Quality After Quality Change
gdsfactory/component.py 70.42% 🙂 70.53% 🙂 0.11% 👍
gdsfactory/cross_section.py 56.95% 🙂 57.14% 🙂 0.19% 👍
gdsfactory/layers.py 70.07% 🙂 69.26% 🙂 -0.81% 👎
gdsfactory/pdk.py 60.41% 🙂 62.95% 🙂 2.54% 👍
gdsfactory/quickplotter.py 58.15% 🙂 58.19% 🙂 0.04% 👍
gdsfactory/tech.py 72.98% 🙂 72.98% 🙂 0.00%
gdsfactory/types.py 64.32% 🙂 64.41% 🙂 0.09% 👍
gdsfactory/components/bend_circular.py 57.74% 🙂 57.74% 🙂 0.00%
gdsfactory/components/bend_circular_heater.py 46.87% 😞 46.87% 😞 0.00%
gdsfactory/components/bend_euler.py 64.34% 🙂 64.69% 🙂 0.35% 👍
gdsfactory/components/bend_s.py 42.25% 😞 42.25% 😞 0.00%
gdsfactory/components/mmi1x2.py 41.97% 😞 41.03% 😞 -0.94% 👎
gdsfactory/components/straight.py 62.28% 🙂 63.49% 🙂 1.21% 👍
gdsfactory/components/straight_heater_metal.py 44.92% 😞 44.92% 😞 0.00%
gdsfactory/components/straight_rib.py 79.76% ⭐ 79.76% ⭐ 0.00%
gdsfactory/components/taper.py 38.64% 😞 38.64% 😞 0.00%
gdsfactory/components/taper_cross_section.py 77.19% ⭐ 77.19% ⭐ 0.00%
gdsfactory/export/to_3d.py 58.22% 🙂 55.80% 🙂 -2.42% 👎
gdsfactory/export/to_stl.py 52.83% 🙂 52.83% 🙂 0.00%
gdsfactory/routing/add_fiber_array.py 34.52% 😞 34.29% 😞 -0.23% 👎
gdsfactory/simulation/get_sparameters_path.py 80.91% ⭐ 81.49% ⭐ 0.58% 👍
gdsfactory/simulation/gmeep/get_simulation.py 13.82% ⛔ 13.44% ⛔ -0.38% 👎
gdsfactory/simulation/gmeep/write_sparameters_meep.py 21.89% ⛔ 21.74% ⛔ -0.15% 👎
gdsfactory/simulation/gmeep/write_sparameters_meep_batch.py 31.92% 😞 32.03% 😞 0.11% 👍
gdsfactory/simulation/gmeep/write_sparameters_meep_mpi.py 35.10% 😞 35.32% 😞 0.22% 👍
gdsfactory/simulation/gtidy3d/get_results.py 65.07% 🙂 65.07% 🙂 0.00%
gdsfactory/simulation/gtidy3d/get_simulation.py 16.27% ⛔ 16.18% ⛔ -0.09% 👎
gdsfactory/simulation/gtidy3d/get_simulation_grating_coupler.py 8.11% ⛔ 7.53% ⛔ -0.58% 👎
gdsfactory/simulation/gtidy3d/materials.py 86.73% ⭐ 86.73% ⭐ 0.00%
gdsfactory/simulation/gtidy3d/write_sparameters.py 37.62% 😞 37.59% 😞 -0.03% 👎
gdsfactory/simulation/gtidy3d/write_sparameters_grating_coupler.py 48.83% 😞 48.83% 😞 0.00%
gdsfactory/simulation/lumerical/write_sparameters_lumerical.py 19.45% ⛔ 19.07% ⛔ -0.38% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
gdsfactory/simulation/gtidy3d/get_simulation.py get_simulation 55 ⛔ 1127 ⛔ 56 ⛔ 2.39% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
gdsfactory/simulation/gmeep/write_sparameters_meep.py write_sparameters_meep 51 ⛔ 961 ⛔ 37 ⛔ 3.28% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
gdsfactory/simulation/gtidy3d/get_simulation_grating_coupler.py get_simulation_grating_coupler 43 ⛔ 1225 ⛔ 69 ⛔ 4.70% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
gdsfactory/simulation/gmeep/get_simulation.py get_simulation 39 ⛔ 823 ⛔ 41 ⛔ 6.03% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
gdsfactory/quickplotter.py quickplot 58 ⛔ 537 ⛔ 20 ⛔ 6.45% ⛔ 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!

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