gplugins 2.0.0__tar.gz → 2.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (253) hide show
  1. {gplugins-2.0.0 → gplugins-2.1.0}/PKG-INFO +20 -18
  2. {gplugins-2.0.0 → gplugins-2.1.0}/README.md +4 -3
  3. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/__init__.py +1 -1
  4. gplugins-2.1.0/gplugins/common/utils/geometry.py +31 -0
  5. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/common/utils/get_sparameters_path.py +6 -6
  6. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/elmer/get_capacitance.py +1 -4
  7. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gmeep/get_meep_geometry.py +30 -55
  8. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gmeep/get_simulation.py +65 -34
  9. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gmeep/test_materials.py +2 -0
  10. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gmeep/test_write_sparameters_meep.py +1 -0
  11. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gmeep/write_sparameters_meep.py +14 -20
  12. gplugins-2.1.0/gplugins/klayout/tests/conftest.py +3 -0
  13. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/meow/meow_eme.py +54 -5
  14. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/meow/test_meow_simulation.py +3 -1
  15. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/meshwell/get_meshwell_3D.py +20 -46
  16. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/meshwell/get_meshwell_cross_section.py +9 -120
  17. gplugins-2.1.0/gplugins/meshwell/tests/test_meshwell.py +69 -0
  18. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/palace/get_capacitance.py +13 -0
  19. gplugins-2.1.0/gplugins/palace/tests/conftest.py +3 -0
  20. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/palace/tests/test_palace.py +46 -17
  21. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/path_length_analysis/test_pathlength_extraction.py +2 -0
  22. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/path_length_analysis/test_pathlength_extraction_from_gds.py +2 -0
  23. gplugins-2.1.0/gplugins/sax/tests/__init__.py +0 -0
  24. gplugins-2.1.0/gplugins/sax/tests/conftest.py +3 -0
  25. gplugins-2.1.0/gplugins/spice/__init__.py +0 -0
  26. gplugins-2.1.0/gplugins/spice/tests/__init__.py +0 -0
  27. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/tidy3d/component.py +65 -69
  28. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/tidy3d/materials.py +3 -3
  29. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/tidy3d/modes.py +45 -9
  30. gplugins-2.1.0/gplugins/tidy3d/tests/__init__.py +0 -0
  31. gplugins-2.1.0/gplugins/tidy3d/tests/conftest.py +3 -0
  32. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/tidy3d/tests/test_component_modeler.py +1 -1
  33. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/tidy3d/tests/test_modes_coupler.py +1 -1
  34. gplugins-2.1.0/gplugins/vlsir/tests/__init__.py +0 -0
  35. gplugins-2.1.0/gplugins/vlsir/tests/conftest.py +3 -0
  36. {gplugins-2.0.0 → gplugins-2.1.0}/pyproject.toml +13 -13
  37. {gplugins-2.0.0 → gplugins-2.1.0}/LICENSE +0 -0
  38. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/common/__init__.py +0 -0
  39. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/common/base_models/__init__.py +0 -0
  40. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/common/base_models/component.py +0 -0
  41. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/common/base_models/simulation.py +0 -0
  42. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/common/config.py +0 -0
  43. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/common/types.py +0 -0
  44. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/common/utils/__init__.py +0 -0
  45. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/common/utils/add_simulation_markers.py +0 -0
  46. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/common/utils/async_helpers.py +0 -0
  47. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/common/utils/cache.py +0 -0
  48. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/common/utils/convert_sparameters.py +0 -0
  49. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/common/utils/disable_print.py +0 -0
  50. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/common/utils/get_capacitance.py +0 -0
  51. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/common/utils/get_component_with_net_layers.py +0 -0
  52. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/common/utils/get_effective_indices.py +0 -0
  53. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/common/utils/get_scattering.py +0 -0
  54. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/common/utils/optical_constants.py +0 -0
  55. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/common/utils/parse_layer_stack.py +0 -0
  56. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/common/utils/plot.py +0 -0
  57. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/common/utils/plot_csv.py +0 -0
  58. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/common/utils/port_symmetries.py +0 -0
  59. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/common/utils/tests/test_get_component_with_new_port_layers.py +0 -0
  60. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/devsim/__init__.py +0 -0
  61. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/devsim/doping.py +0 -0
  62. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/devsim/get_simulation.py +0 -0
  63. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/devsim/get_simulation_xsection.py +0 -0
  64. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/devsim/get_solver.py +0 -0
  65. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/devsim/test_devsim.py +0 -0
  66. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/elmer/__init__.py +0 -0
  67. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/elmer/electrostatic.sif.j2 +0 -0
  68. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/elmer/tests/test_elmer.py +0 -0
  69. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/fdtdz/__init__.py +0 -0
  70. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/fdtdz/get_epsilon_fdtdz.py +0 -0
  71. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/fdtdz/get_ports_fdtdz.py +0 -0
  72. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/fdtdz/get_sparameters_fdtdz.py +0 -0
  73. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/femwell/__init__.py +0 -0
  74. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/femwell/mode_solver.py +0 -0
  75. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/femwell/solve_thermal.py +0 -0
  76. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/femwell/test_mode_solver.py +0 -0
  77. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gfviz/Makefile +0 -0
  78. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gfviz/__init__.py +0 -0
  79. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gfviz/b64.py +0 -0
  80. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gfviz/gfviz.py +0 -0
  81. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gfviz/netlist.py +0 -0
  82. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gfviz/serve.py +0 -0
  83. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gfviz/static/b64.js +0 -0
  84. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gfviz/static/schemedit.js +0 -0
  85. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gfviz/static/schemedit.wasm +0 -0
  86. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gfviz/templates/example.json +0 -0
  87. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gfviz/templates/index.html +0 -0
  88. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gmeep/__init__.py +0 -0
  89. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gmeep/get_material.py +0 -0
  90. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gmeep/get_port_eigenmode.py +0 -0
  91. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gmeep/get_simulation_grating_farfield.py +0 -0
  92. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gmeep/get_simulation_grating_fiber.py +0 -0
  93. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gmeep/meep_adjoint_optimization.py +0 -0
  94. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gmeep/test_eigenmode.py +0 -0
  95. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gmeep/test_sparameterNxN/test_sparameterNxN_crossing.csv +0 -0
  96. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gmeep/test_sparameterNxN/test_sparameterNxN_straight.csv +0 -0
  97. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gmeep/test_write_sparameters_meep/test_sparameterNxN_crossing.csv +0 -0
  98. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gmeep/test_write_sparameters_meep/test_sparameterNxN_straight.csv +0 -0
  99. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gmeep/test_write_sparameters_meep/test_sparameterNxN_symmetries_straight.csv +0 -0
  100. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gmeep/test_write_sparameters_meep/test_sparameter_straight_mpi.csv +0 -0
  101. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gmeep/test_write_sparameters_meep/test_sparameter_straight_mpi_pool.csv +0 -0
  102. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gmeep/test_write_sparameters_meep/test_sparameters_crossing_symmetric.csv +0 -0
  103. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gmeep/test_write_sparameters_meep/test_sparameters_straight.csv +0 -0
  104. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gmeep/test_write_sparameters_meep/test_sparameters_straight_batch.csv +0 -0
  105. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gmeep/test_write_sparameters_meep/test_sparameters_straight_mpi.csv +0 -0
  106. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gmeep/test_write_sparameters_meep/test_sparameters_straight_mpi_pool.csv +0 -0
  107. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gmeep/test_write_sparameters_meep/test_sparameters_straight_symmetric.csv +0 -0
  108. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gmeep/write_sparameters_grating.py +0 -0
  109. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gmeep/write_sparameters_meep_batch.py +0 -0
  110. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/gmeep/write_sparameters_meep_mpi.py +0 -0
  111. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/klayout/__init__.py +0 -0
  112. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/klayout/dataprep/__init__.py +0 -0
  113. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/klayout/dataprep/regions.py +0 -0
  114. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/klayout/drc/__init__.py +0 -0
  115. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/klayout/drc/check_duplicated_cells.py +0 -0
  116. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/klayout/drc/check_exclusion.py +0 -0
  117. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/klayout/drc/check_inclusion.py +0 -0
  118. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/klayout/drc/check_space.py +0 -0
  119. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/klayout/drc/check_width.py +0 -0
  120. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/klayout/drc/count_drc.py +0 -0
  121. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/klayout/drc/samples/drc_errors.py +0 -0
  122. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/klayout/drc/write_drc.py +0 -0
  123. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/klayout/get_density.py +0 -0
  124. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/klayout/get_netlist.py +0 -0
  125. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/klayout/netlist_graph.py +0 -0
  126. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/klayout/netlist_spice_reader.py +0 -0
  127. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/klayout/plot_nets.py +0 -0
  128. {gplugins-2.0.0/gplugins/materials → gplugins-2.1.0/gplugins/klayout/tests}/__init__.py +0 -0
  129. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/klayout/tests/test_dataprep_regions.py +0 -0
  130. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/klayout/tests/test_density.py +0 -0
  131. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/klayout/tests/test_drc_exclusion.py +0 -0
  132. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/klayout/tests/test_drc_inclusion.py +0 -0
  133. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/klayout/tests/test_drc_space.py +0 -0
  134. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/klayout/tests/test_drc_width.py +0 -0
  135. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/klayout/tests/test_global_density.py +0 -0
  136. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/klayout/tests/test_netlist_spice_reader.py +0 -0
  137. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/klayout/tests/test_plot_nets.py +0 -0
  138. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/lumerical/README.md +0 -0
  139. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/lumerical/__init__.py +0 -0
  140. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/lumerical/interconnect.py +0 -0
  141. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/lumerical/mapping_ubcpdk.yml +0 -0
  142. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/lumerical/read.py +0 -0
  143. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/lumerical/settings.py +0 -0
  144. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/lumerical/tests/test_lumerical_read_sparameters.py +0 -0
  145. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/lumerical/tests/test_netlist.py +0 -0
  146. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/lumerical/tests/test_netlist_get_routes.py +0 -0
  147. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/lumerical/write_sparameters_lumerical.py +0 -0
  148. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/lumerical/write_sparameters_lumerical_components.py +0 -0
  149. {gplugins-2.0.0/gplugins/materials/optical → gplugins-2.1.0/gplugins/materials}/__init__.py +0 -0
  150. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/materials/inorganic.py +0 -0
  151. {gplugins-2.0.0/gplugins/materials/semiconductor → gplugins-2.1.0/gplugins/materials/optical}/__init__.py +0 -0
  152. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/materials/optical/optical_mat.py +0 -0
  153. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/materials/optical/refractive_index_info.py +0 -0
  154. {gplugins-2.0.0/gplugins/process → gplugins-2.1.0/gplugins/materials/semiconductor}/__init__.py +0 -0
  155. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/materials/semiconductor/semiconductor_mat.py +0 -0
  156. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/meow/__init__.py +0 -0
  157. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/meshwell/__init__.py +0 -0
  158. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/modes/__init__.py +0 -0
  159. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/modes/coupler.py +0 -0
  160. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/modes/find_coupling_vs_gap.py +0 -0
  161. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/modes/find_mode_dispersion.py +0 -0
  162. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/modes/find_modes.py +0 -0
  163. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/modes/find_modes_cross_section.py +0 -0
  164. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/modes/find_neff_ng_dw_dh.py +0 -0
  165. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/modes/find_neff_vs_width.py +0 -0
  166. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/modes/get_mode_solver_coupler.py +0 -0
  167. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/modes/get_mode_solver_cross_section.py +0 -0
  168. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/modes/get_mode_solver_rib.py +0 -0
  169. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/modes/modes/neff_vs_width_nitride.csv +0 -0
  170. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/modes/modes/neff_vs_width_rib.csv +0 -0
  171. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/modes/modes/neff_vs_width_strip.csv +0 -0
  172. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/modes/neff_convergence_test.py +0 -0
  173. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/modes/neff_vs_width.csv +0 -0
  174. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/modes/overlap.py +0 -0
  175. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/modes/tests/test_dw_dh/test_dw_dh.csv +0 -0
  176. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/modes/tests/test_dw_dh/test_dw_dh.obtained.csv +0 -0
  177. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/modes/tests/test_dw_dh/test_dw_dh_dispersion.csv +0 -0
  178. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/modes/tests/test_dw_dh.py +0 -0
  179. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/modes/tests/test_find_modes.py +0 -0
  180. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/modes/tests/test_find_modes_dispersion.py +0 -0
  181. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/modes/tests/test_neff_vs_width/test_neff_vs_width.csv +0 -0
  182. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/modes/tests/test_neff_vs_width/test_neff_vs_width.obtained.csv +0 -0
  183. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/modes/tests/test_neff_vs_width.py +0 -0
  184. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/modes/types.py +0 -0
  185. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/modes/waveguide.py +0 -0
  186. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/palace/__init__.py +0 -0
  187. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/palace/driven.json +0 -0
  188. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/palace/electrostatic.json +0 -0
  189. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/palace/get_scattering.py +0 -0
  190. {gplugins-2.0.0/gplugins/spice → gplugins-2.1.0/gplugins/palace/tests}/__init__.py +0 -0
  191. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/path_length_analysis/__init__.py +0 -0
  192. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/path_length_analysis/path_length_analysis.py +0 -0
  193. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/path_length_analysis/path_length_analysis_from_gds.py +0 -0
  194. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/path_length_analysis/test_pathlength_extraction_utils.py +0 -0
  195. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/path_length_analysis/utils.py +0 -0
  196. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/photonic_circuit_models/__init__.py +0 -0
  197. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/photonic_circuit_models/coupler.py +0 -0
  198. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/photonic_circuit_models/fsr.py +0 -0
  199. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/photonic_circuit_models/heater.py +0 -0
  200. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/photonic_circuit_models/mzi.py +0 -0
  201. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/photonic_circuit_models/ring.py +0 -0
  202. {gplugins-2.0.0/gplugins/spice/tests → gplugins-2.1.0/gplugins/process}/__init__.py +0 -0
  203. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/process/diffusion.py +0 -0
  204. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/process/implant_tables.py +0 -0
  205. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/process/pysrim.py +0 -0
  206. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/process/silicon.py +0 -0
  207. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/process/skew/antimony_si_skew.csv +0 -0
  208. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/process/skew/arsenic_si_skew.csv +0 -0
  209. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/process/skew/boron_si_skew.csv +0 -0
  210. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/process/skew/phosphorus_si_skew.csv +0 -0
  211. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/sax/__init__.py +0 -0
  212. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/sax/interpolators.py +0 -0
  213. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/sax/mlp.py +0 -0
  214. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/sax/models.py +0 -0
  215. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/sax/parameter.py +0 -0
  216. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/sax/plot_model.py +0 -0
  217. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/sax/read.py +0 -0
  218. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/sax/strategy.py +0 -0
  219. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/sax/tests/test_mzi.py +0 -0
  220. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/sax/tests/test_mzi_lattice/test_mzi_lattice.obtained.yml +0 -0
  221. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/sax/tests/test_mzi_lattice/test_mzi_lattice.yml +0 -0
  222. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/sax/tests/test_mzi_lattice.py +0 -0
  223. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/sax/tests/test_parameters.py +0 -0
  224. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/sentaurus/mask_sde.py +0 -0
  225. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/sentaurus/mask_sprocess.py +0 -0
  226. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/sentaurus/sde.py +0 -0
  227. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/sentaurus/sdevice.py +0 -0
  228. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/sentaurus/sprocess.py +0 -0
  229. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/sentaurus/svisual.py +0 -0
  230. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/spice/spice_to_yaml.py +0 -0
  231. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/spice/tests/test_interconnect.py +0 -0
  232. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/tidy3d/__init__.py +0 -0
  233. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/tidy3d/get_results.py +0 -0
  234. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/tidy3d/get_simulation_grating_coupler.py +0 -0
  235. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/tidy3d/tests/test_materials.py +0 -0
  236. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/tidy3d/tests/test_modes/test_sweep_width.csv +0 -0
  237. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/tidy3d/tests/test_modes/test_sweep_width.obtained.csv +0 -0
  238. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/tidy3d/tests/test_modes_waveguide.py +0 -0
  239. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/tidy3d/tests/test_plot_simulation_grating_coupler.py +0 -0
  240. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/tidy3d/tests/test_write_sparameters.py +0 -0
  241. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/tidy3d/tests/tests_sparameters/sim_ref.yaml +0 -0
  242. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/tidy3d/tests/tests_sparameters/test_write_sparameters.py +0 -0
  243. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/tidy3d/tests/tests_sparameters/test_write_sparameters_grating_coupler.py +0 -0
  244. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/tidy3d/types.py +0 -0
  245. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/tidy3d/util.py +0 -0
  246. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/tidy3d/write_sparameters_grating_coupler.py +0 -0
  247. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/typings.py +0 -0
  248. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/vlsir/__init__.py +0 -0
  249. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/vlsir/export_netlist.py +0 -0
  250. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/vlsir/tests/resources/pads_correct.cir +0 -0
  251. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/vlsir/tests/resources/pads_correct.scs +0 -0
  252. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/vlsir/tests/resources/pads_correct.sp +0 -0
  253. {gplugins-2.0.0 → gplugins-2.1.0}/gplugins/vlsir/tests/test_vlsir.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gplugins
3
- Version: 2.0.0
3
+ Version: 2.1.0
4
4
  Summary: gdsfactory plugins
5
5
  Keywords: python
6
6
  Author-email: gdsfactory <contact@gdsfactory.com>
@@ -11,11 +11,11 @@ Classifier: Programming Language :: Python :: 3.12
11
11
  Classifier: Programming Language :: Python :: 3.13
12
12
  Classifier: Operating System :: OS Independent
13
13
  License-File: LICENSE
14
- Requires-Dist: gdsfactory>=9.15.1
14
+ Requires-Dist: gdsfactory>=9.29.1
15
15
  Requires-Dist: pint
16
16
  Requires-Dist: tqdm
17
- Requires-Dist: numpy==2.2
18
- Requires-Dist: xarray==2025.7.1
17
+ Requires-Dist: numpy>=2.0,<3
18
+ Requires-Dist: xarray==2026.4.0
19
19
  Requires-Dist: hypothesis ; extra == "dev"
20
20
  Requires-Dist: numba ; extra == "dev"
21
21
  Requires-Dist: pre-commit ; extra == "dev"
@@ -24,12 +24,12 @@ Requires-Dist: pytest ; extra == "dev"
24
24
  Requires-Dist: pytest-cov ; extra == "dev"
25
25
  Requires-Dist: pytest_regressions ; extra == "dev"
26
26
  Requires-Dist: devsim ; extra == "devsim"
27
- Requires-Dist: pyvista<=0.46.0 ; extra == "devsim"
28
- Requires-Dist: tidy3d>=2.8.2,<2.9 ; extra == "devsim"
27
+ Requires-Dist: pyvista<=0.48.2 ; extra == "devsim"
28
+ Requires-Dist: tidy3d~=2.11.1 ; extra == "devsim"
29
29
  Requires-Dist: jupytext ; extra == "docs"
30
30
  Requires-Dist: matplotlib ; extra == "docs"
31
- Requires-Dist: jupyter-book~=1.0 ; extra == "docs"
32
- Requires-Dist: pyvista[all]<=0.46.0 ; extra == "docs"
31
+ Requires-Dist: jupyter-book>=1,<3 ; extra == "docs"
32
+ Requires-Dist: pyvista[all]<=0.48.2 ; extra == "docs"
33
33
  Requires-Dist: bokeh ; extra == "docs"
34
34
  Requires-Dist: scikit-learn ; extra == "docs"
35
35
  Requires-Dist: femwell~=0.1.11 ; extra == "femwell"
@@ -39,29 +39,30 @@ Requires-Dist: fastapi ; extra == "gfviz"
39
39
  Requires-Dist: shapely ; extra == "gfviz"
40
40
  Requires-Dist: natsort ; extra == "gfviz"
41
41
  Requires-Dist: klayout ; extra == "klayout"
42
- Requires-Dist: pyvis<=0.3.1 ; extra == "klayout"
42
+ Requires-Dist: pyvis<=0.3.2 ; extra == "klayout"
43
43
  Requires-Dist: vlsir ; extra == "klayout"
44
44
  Requires-Dist: vlsirtools ; extra == "klayout"
45
45
  Requires-Dist: gitpython ; extra == "klayout"
46
- Requires-Dist: luminescent>=0.2.12,<0.4.0 ; extra == "luminescent"
46
+ Requires-Dist: luminescent>=0.2.12,<4.1.0 ; extra == "luminescent"
47
47
  Requires-Dist: sortedcontainers ; extra == "luminescent"
48
48
  Requires-Dist: mypy ; extra == "maintainer"
49
49
  Requires-Dist: tbump ; extra == "maintainer"
50
50
  Requires-Dist: towncrier ; extra == "maintainer"
51
- Requires-Dist: meow-sim>=0.14.1,<0.15 ; extra == "meow"
52
- Requires-Dist: sax>=0.15.6,<0.16.0 ; extra == "meow"
53
- Requires-Dist: tidy3d>=2.8.2,<2.9 ; extra == "meow"
51
+ Requires-Dist: meow-sim>=0.15 ; extra == "meow"
52
+ Requires-Dist: sax~=0.17.0 ; extra == "meow"
53
+ Requires-Dist: tidy3d~=2.11.1 ; extra == "meow"
54
54
  Requires-Dist: shapely ; extra == "meshwell"
55
55
  Requires-Dist: meshwell~=2.1.1 ; extra == "meshwell"
56
56
  Requires-Dist: bokeh ; extra == "path-length-analysis"
57
57
  Requires-Dist: numba ; extra == "path-length-analysis"
58
58
  Requires-Dist: shapely ; extra == "path-length-analysis"
59
- Requires-Dist: sax~=0.15.14 ; extra == "sax"
59
+ Requires-Dist: sax~=0.17.0 ; extra == "sax"
60
60
  Requires-Dist: bokeh ; extra == "schematic"
61
61
  Requires-Dist: ipywidgets ; extra == "schematic"
62
62
  Requires-Dist: natsort ; extra == "schematic"
63
- Requires-Dist: tidy3d>=2.8.2,<2.9 ; extra == "tidy3d"
63
+ Requires-Dist: tidy3d~=2.11.1 ; extra == "tidy3d"
64
64
  Requires-Dist: gdstk ; extra == "tidy3d"
65
+ Requires-Dist: pytz ; extra == "tidy3d"
65
66
  Requires-Dist: vlsir ; extra == "vlsir"
66
67
  Requires-Dist: vlsirtools ; extra == "vlsir"
67
68
  Provides-Extra: dev
@@ -80,7 +81,7 @@ Provides-Extra: schematic
80
81
  Provides-Extra: tidy3d
81
82
  Provides-Extra: vlsir
82
83
 
83
- # gplugins 2.0.0
84
+ # gplugins 2.1.0
84
85
 
85
86
  [![docs](https://github.com/gdsfactory/gplugins/actions/workflows/pages.yml/badge.svg)](https://gdsfactory.github.io/gplugins/)
86
87
  [![PyPI](https://img.shields.io/pypi/v/gplugins)](https://pypi.org/project/gplugins/)
@@ -160,13 +161,14 @@ curl -LsSf https://astral.sh/uv/install.sh | sh
160
161
  powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
161
162
  ```
162
163
 
163
- -Then you can install GDSFactory with:
164
+ -Then you can install gplugins and its dependency groups with:
164
165
 
165
166
  ```bash
166
167
  uv venv --python 3.12
167
- uv sync --extra docs --extra dev
168
+ uv sync --extra docs --extra dev # --extra tidy3d --extra femwell ...
168
169
  ```
169
170
 
171
+
170
172
  ## Getting started
171
173
 
172
174
  - [Read the gplugins docs](https://gdsfactory.github.io/gplugins/)
@@ -1,4 +1,4 @@
1
- # gplugins 2.0.0
1
+ # gplugins 2.1.0
2
2
 
3
3
  [![docs](https://github.com/gdsfactory/gplugins/actions/workflows/pages.yml/badge.svg)](https://gdsfactory.github.io/gplugins/)
4
4
  [![PyPI](https://img.shields.io/pypi/v/gplugins)](https://pypi.org/project/gplugins/)
@@ -78,13 +78,14 @@ curl -LsSf https://astral.sh/uv/install.sh | sh
78
78
  powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
79
79
  ```
80
80
 
81
- -Then you can install GDSFactory with:
81
+ -Then you can install gplugins and its dependency groups with:
82
82
 
83
83
  ```bash
84
84
  uv venv --python 3.12
85
- uv sync --extra docs --extra dev
85
+ uv sync --extra docs --extra dev # --extra tidy3d --extra femwell ...
86
86
  ```
87
87
 
88
+
88
89
  ## Getting started
89
90
 
90
91
  - [Read the gplugins docs](https://gdsfactory.github.io/gplugins/)
@@ -1,6 +1,6 @@
1
1
  """gplugins - gdsfactory plugins."""
2
2
 
3
- __version__ = "2.0.0"
3
+ __version__ = "2.1.0"
4
4
 
5
5
  import pathlib
6
6
 
@@ -0,0 +1,31 @@
1
+ from typing import List
2
+ import gdsfactory as gf
3
+ import kfactory as kf
4
+ from shapely.geometry import Polygon, MultiPolygon
5
+
6
+ def region_to_shapely_polygons(region: kf.kdb.Region) -> MultiPolygon:
7
+ """Convert a kfactory Region to a list of Shapely polygons."""
8
+ polygons = []
9
+ for polygon_kdb in region.each():
10
+ exterior_coords = [
11
+ (gf.kcl.to_um(point.x), gf.kcl.to_um(point.y))
12
+ for point in polygon_kdb.each_point_hull()
13
+ ]
14
+ # Extract hole coordinates
15
+ holes = []
16
+ num_holes = polygon_kdb.holes()
17
+ for hole_idx in range(num_holes):
18
+ hole_coords = []
19
+ for point in polygon_kdb.each_point_hole(hole_idx):
20
+ hole_coords.append((gf.kcl.to_um(point.x), gf.kcl.to_um(point.y)))
21
+ holes.append(hole_coords)
22
+
23
+
24
+ # Create Shapely polygon
25
+ if holes:
26
+ polygon = Polygon(exterior_coords, holes)
27
+ else:
28
+ polygon = Polygon(exterior_coords)
29
+ polygons.append(polygon)
30
+
31
+ return MultiPolygon(polygons)
@@ -1,9 +1,9 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import hashlib
4
- import pathlib
5
4
  from functools import partial
6
5
  from pathlib import Path
6
+ from tempfile import TemporaryDirectory
7
7
  from typing import Any
8
8
 
9
9
  import gdsfactory as gf
@@ -21,9 +21,9 @@ def get_kwargs_hash(**kwargs: Any) -> str:
21
21
 
22
22
 
23
23
  def get_component_hash(component: gf.Component) -> str:
24
- gdspath = pathlib.Path(component.write_gds())
25
- h = hashlib.md5(gdspath.read_bytes()).hexdigest()
26
- gdspath.unlink()
24
+ with TemporaryDirectory() as tmpdir:
25
+ gdspath = Path(component.write_gds(gdsdir=tmpdir, no_empty_cells=True, with_metadata=False))
26
+ h = hashlib.md5(gdspath.read_bytes()).hexdigest()
27
27
  return h
28
28
 
29
29
 
@@ -42,10 +42,10 @@ def _get_sparameters_path(
42
42
 
43
43
  """
44
44
  dirpath = dirpath or GDSDIR_TEMP / "sparameters"
45
- dirpath = pathlib.Path(dirpath)
45
+ dirpath = Path(dirpath)
46
46
  component = gf.get_component(component)
47
47
 
48
- dirpath = pathlib.Path(dirpath)
48
+ dirpath = Path(dirpath)
49
49
  dirpath = (
50
50
  dirpath / component.name
51
51
  if hasattr(component, "function_name")
@@ -224,10 +224,7 @@ def run_capacitive_simulation_elmer(
224
224
  else:
225
225
  prisms = get_meshwell_prisms(
226
226
  component=component,
227
- type="3D",
228
- filename=simulation_folder / filename,
229
227
  layer_stack=layer_stack,
230
- n_threads=n_processes,
231
228
  )
232
229
  cad(
233
230
  entities_list=prisms,
@@ -263,7 +260,7 @@ def run_capacitive_simulation_elmer(
263
260
  # Signals are converted to Elmer Boundary Conditions
264
261
  ground_layers = {
265
262
  next(k for k, v in layer_stack.layers.items() if v.layer == port.layer)
266
- for port in component.get_ports()
263
+ for port in component.ports
267
264
  } # ports allowed only on metal
268
265
  metal_surfaces = [
269
266
  e for e in mesh_surface_entities if any(ground in e for ground in ground_layers)
@@ -3,15 +3,11 @@ from __future__ import annotations
3
3
  import gdsfactory as gf
4
4
  import meep as mp
5
5
  import numpy as np
6
- from kfactory import LayerEnum
7
- from typing import cast
8
- import shapely
9
- from gdsfactory.pdk import get_layer_stack, get_layer, get_layer_name
10
- from gdsfactory.technology import LayerStack
11
- from gdsfactory.technology import DerivedLayer, LayerStack, LayerViews, LogicalLayer
6
+
7
+ from gdsfactory.pdk import get_layer_stack, get_layer
8
+ from gdsfactory.technology import DerivedLayer, LayerStack, LogicalLayer
12
9
  from gdsfactory.typings import ComponentSpec, CrossSectionSpec, LayerSpecs
13
10
 
14
- from gplugins.common.utils.parse_layer_stack import order_layer_stack
15
11
  from gplugins.gmeep.get_material import get_material
16
12
 
17
13
 
@@ -20,7 +16,6 @@ def get_meep_geometry_from_component(
20
16
  layer_stack: LayerStack | None = None,
21
17
  material_name_to_meep: dict[str, str | float] | None = None,
22
18
  wavelength: float = 1.55,
23
- is_3d: bool = False,
24
19
  dispersive: bool = False,
25
20
  exclude_layers: LayerSpecs | None = None,
26
21
  **kwargs,
@@ -32,28 +27,22 @@ def get_meep_geometry_from_component(
32
27
  layer_stack: for material layers.
33
28
  material_name_to_meep: maps layer_stack name to meep material name.
34
29
  wavelength: in um.
35
- is_3d: renders in 3D.
36
30
  dispersive: add dispersion.
31
+ exclude_layers: these layers are ignored during geometry creation.
37
32
  kwargs: settings.
38
33
  """
39
34
  component = gf.get_component(component=component, **kwargs)
40
- polygons_per_layer = component.get_polygons_points(merge=True)
41
-
42
-
43
35
  layer_stack = layer_stack or get_layer_stack()
44
-
45
- layer_to_thickness = layer_stack.get_layer_to_thickness()
46
- layer_to_material = layer_stack.get_layer_to_material()
47
- layer_to_zmin = layer_stack.get_layer_to_zmin()
48
- layer_to_sidewall_angle = layer_stack.get_layer_to_sidewall_angle()
49
36
  component_with_booleans = layer_stack.get_component_with_derived_layers(component)
37
+ polygons_per_layer = component_with_booleans.get_polygons_points(merge=True)
50
38
 
51
39
  geometry = []
52
- exclude_layers = exclude_layers or []
53
- layer_to_polygons = component_with_booleans.get_polygons_points()
54
-
55
- # ordered_layer_stack_keys = order_layer_stack(layer_stack)[::-1]
40
+ if exclude_layers is None:
41
+ exclude_layers = []
42
+ else:
43
+ exclude_layers = [get_layer(l) for l in exclude_layers]
56
44
 
45
+ # TODO: currently ignores width_to_z, z_to_bias, bias, mesh_order of level
57
46
  for level in layer_stack.layers.values():
58
47
  layer = level.layer
59
48
 
@@ -66,45 +55,31 @@ def get_meep_geometry_from_component(
66
55
  layer_tuple = layer
67
56
  else:
68
57
  raise ValueError(f"Layer {layer!r} is not a DerivedLayer, LogicalLayer, or tuple")
69
-
70
58
  layer_index = int(get_layer(layer_tuple))
71
59
 
72
- if layer_index in exclude_layers:
73
- continue
74
-
75
- if layer_index not in polygons_per_layer:
60
+ if layer_index in exclude_layers or layer_index not in polygons_per_layer:
76
61
  continue
77
62
 
78
- zmin = level.zmin
79
- zmin_um = layer_to_zmin[layer] if is_3d else 0
80
- if zmin is not None:
81
- has_polygons = True
82
- polygons = polygons_per_layer[layer_index]
83
- height = level.thickness
84
- for polygon in polygons:
85
- p = shapely.geometry.Polygon(polygon)
86
- vertices = [mp.Vector3(p[0], p[1], zmin_um) for p in polygon]
87
- material_name = layer_to_material[layer]
88
-
89
- if material_name:
90
- material = get_material(
91
- name=material_name,
92
- dispersive=dispersive,
93
- material_name_to_meep=material_name_to_meep,
94
- wavelength=wavelength,
95
- )
96
- geometry.append(
97
- mp.Prism(
98
- vertices=vertices,
99
- height=height,
100
- sidewall_angle=np.pi * layer_to_sidewall_angle[layer] / 180
101
- if is_3d
102
- else 0,
103
- material=material,
104
- # center=center
105
- )
63
+ sw_angle = np.pi * level.sidewall_angle / 180
64
+ for polygon in polygons_per_layer[layer_index]:
65
+ vertices = [mp.Vector3(p[0], p[1], level.zmin) for p in polygon]
66
+ material_name = level.material
67
+
68
+ if material_name:
69
+ material = get_material(
70
+ name=material_name,
71
+ dispersive=dispersive,
72
+ material_name_to_meep=material_name_to_meep,
73
+ wavelength=wavelength,
74
+ )
75
+ geometry.append(
76
+ mp.Prism(
77
+ vertices=vertices,
78
+ height=level.thickness,
79
+ sidewall_angle=sw_angle, # TODO: libctl has issues with slanted prisms -> incorrect geometry
80
+ material=material,
106
81
  )
107
-
82
+ )
108
83
  return geometry
109
84
 
110
85
 
@@ -4,7 +4,7 @@ from __future__ import annotations
4
4
 
5
5
  import inspect
6
6
  import warnings
7
- from typing import Any
7
+ from typing import Any, Literal
8
8
 
9
9
  import gdsfactory as gf
10
10
  import meep as mp
@@ -12,6 +12,7 @@ import numpy as np
12
12
  from gdsfactory.component import Component
13
13
  from gdsfactory.pdk import get_layer_stack
14
14
  from gdsfactory.technology import LayerStack
15
+ from gdsfactory.typings import LayerSpecs, Float3
15
16
 
16
17
  from gplugins.common.base_models.component import move_polar_rad_copy
17
18
  from gplugins.gmeep.get_material import get_material
@@ -25,6 +26,19 @@ sig = inspect.signature(mp.Simulation)
25
26
  settings_meep = set(sig.parameters.keys())
26
27
 
27
28
 
29
+ def is_point_in_plane(
30
+ test_point: Float3,
31
+ plane_support: Float3,
32
+ plane_normal: Float3,
33
+ tolerance: float = 1e-6, # 1 pm for coordinates in µm
34
+ ):
35
+ a, b, c = plane_normal
36
+ xt, yt, zt = test_point
37
+ x0, y0, z0 = plane_support
38
+ distance = (a*(xt-x0) + b*(yt-y0) + c*(zt-z0)) / np.linalg.norm(plane_normal)
39
+ return bool(abs(distance) <= tolerance)
40
+
41
+
28
42
  def get_simulation(
29
43
  component: Component,
30
44
  resolution: int = 30,
@@ -35,6 +49,8 @@ def get_simulation(
35
49
  tpml: float = 1.5,
36
50
  clad_material: str = "SiO2",
37
51
  is_3d: bool = False,
52
+ normal_2d: Literal['X', 'Y', 'Z'] = 'Z',
53
+ point_2d: tuple[float, float, float] = (0, 0, 0),
38
54
  wavelength_start: float = 1.5,
39
55
  wavelength_stop: float = 1.6,
40
56
  wavelength_points: int = 50,
@@ -48,6 +64,7 @@ def get_simulation(
48
64
  dispersive: bool = False,
49
65
  material_name_to_meep: dict[str, str | float] | None = None,
50
66
  continuous_source: bool = False,
67
+ exclude_layers: LayerSpecs | None = None,
51
68
  **settings,
52
69
  ) -> dict[str, Any]:
53
70
  r"""Returns Simulation dict from gdsfactory Component.
@@ -103,6 +120,8 @@ def get_simulation(
103
120
  tpml: PML thickness (um).
104
121
  clad_material: material for cladding.
105
122
  is_3d: if True runs in 3D.
123
+ normal_2d: specified normal of 2D simulation plane
124
+ point_2d: specifies support point for 2D simulation plane
106
125
  wavelength_start: wavelength min (um).
107
126
  wavelength_stop: wavelength max (um).
108
127
  wavelength_points: wavelength steps.
@@ -117,6 +136,7 @@ def get_simulation(
117
136
  material_name_to_meep: map layer_stack names with meep material database name
118
137
  or refractive index. dispersive materials have a wavelength dependent index.
119
138
  continuous_source: if True, defines a continuous source at (wavelength_start + wavelength_stop)/2 instead of the ramped source
139
+ exclude_layers: these layers will be ignored in geometry generation.
120
140
 
121
141
  Keyword Args:
122
142
  settings: extra simulation settings (resolution, symmetries, etc.)
@@ -138,23 +158,19 @@ def get_simulation(
138
158
  for setting in settings:
139
159
  if setting not in settings_meep:
140
160
  raise ValueError(f"{setting!r} not in {sorted(settings_meep)}")
161
+ normal_2d = normal_2d.upper()
162
+ normal_vec = {'X': (1, 0, 0), 'Y': (0, 1, 0), 'Z': (0, 0, 1)}[normal_2d]
141
163
 
142
164
  layer_stack = layer_stack or get_layer_stack()
143
165
  layer_to_thickness = layer_stack.get_layer_to_thickness()
144
166
 
145
- dummy_component = gf.Component()
146
- component_ref = dummy_component << component
147
- component_ref.x = 0
148
- component_ref.y = 0
149
-
150
167
  wavelength = (wavelength_start + wavelength_stop) / 2
151
-
152
168
  wavelengths = np.linspace(wavelength_start, wavelength_stop, wavelength_points)
153
- port_names = [port.name for port in component_ref.ports]
154
169
 
170
+ port_names = [port.name for port in component.ports]
155
171
  if port_source_name not in port_names:
156
172
  warnings.warn(f"port_source_name={port_source_name!r} not in {port_names}")
157
- port_source = component_ref.ports[0]
173
+ port_source = component.ports[0]
158
174
  port_source_name = port_source.name
159
175
  warnings.warn(f"Selecting port_source_name={port_source_name!r} instead.")
160
176
 
@@ -162,14 +178,7 @@ def get_simulation(
162
178
  f"component needs to be a gf.Component, got Type {type(component)}"
163
179
  )
164
180
 
165
- component_extended = (
166
- gf.c.extend_ports(
167
- component=component, length=extend_ports_length, centered=True
168
- )
169
- if extend_ports_length
170
- else component
171
- )
172
-
181
+ component_extended = gf.c.extend_ports(component=component, length=extend_ports_length)
173
182
  component_extended = component_extended.copy()
174
183
  component_extended.flatten()
175
184
 
@@ -188,12 +197,12 @@ def get_simulation(
188
197
  t_core = sum(
189
198
  layers_thickness
190
199
  ) # This isn't exactly what we want but I think it's better than max
191
- cell_thickness = tpml + zmargin_bot + t_core + zmargin_top + tpml if is_3d else 0
200
+ cell_thickness = tpml + zmargin_bot + t_core + zmargin_top + tpml
192
201
 
193
202
  cell_size = mp.Vector3(
194
- component.xsize + 2 * tpml,
195
- component.ysize + 2 * tpml,
196
- cell_thickness,
203
+ 0 if normal_2d == 'X' and not is_3d else component.xsize + 2 * tpml,
204
+ 0 if normal_2d == 'Y' and not is_3d else component.ysize + 2 * tpml,
205
+ 0 if normal_2d == 'Z' and not is_3d else cell_thickness,
197
206
  )
198
207
 
199
208
  geometry = get_meep_geometry_from_component(
@@ -201,8 +210,8 @@ def get_simulation(
201
210
  layer_stack=layer_stack,
202
211
  material_name_to_meep=material_name_to_meep,
203
212
  wavelength=wavelength,
204
- is_3d=is_3d,
205
213
  dispersive=dispersive,
214
+ exclude_layers=exclude_layers,
206
215
  )
207
216
 
208
217
  freqs = 1 / wavelengths
@@ -210,19 +219,23 @@ def get_simulation(
210
219
  frequency_width = dfcen * fcen
211
220
 
212
221
  # Add source
213
- port = component_ref.ports[port_source_name]
222
+ port = component.ports[port_source_name]
214
223
  angle_rad = np.radians(port.orientation)
215
224
  width = port.width + 2 * port_margin
216
225
  size_x = width * abs(np.sin(angle_rad))
217
226
  size_y = width * abs(np.cos(angle_rad))
218
227
  size_x = 0 if size_x < 0.001 else size_x
219
228
  size_y = 0 if size_y < 0.001 else size_y
220
- size_z = cell_thickness - 2 * tpml if is_3d else 20
221
- size = [size_x, size_y, size_z]
229
+ size_z = cell_thickness - 2 * tpml
230
+ size = [
231
+ 0 if normal_2d == 'X' and not is_3d else size_x,
232
+ 0 if normal_2d == 'Y' and not is_3d else size_y,
233
+ 0 if normal_2d == 'Z' and not is_3d else size_z,
234
+ ]
222
235
  xy_shifted = move_polar_rad_copy(
223
236
  np.array(port.center), angle=angle_rad, length=port_source_offset
224
237
  )
225
- center = xy_shifted.tolist() + [0] # (x, y, z=0)
238
+ center = xy_shifted.round(6).tolist() + [0] # (x, y, z=0)
226
239
 
227
240
  if np.isclose(port.orientation, 0):
228
241
  direction = mp.X
@@ -238,6 +251,11 @@ def get_simulation(
238
251
  "not 0, 90, 180, 270 degrees"
239
252
  )
240
253
 
254
+ if not (is_3d or is_point_in_plane(center, point_2d, normal_vec)):
255
+ raise ValueError(
256
+ f"Source '{port_source_name}' (center={center}) is not in {normal_2d}-normal 2D simulation domain around {point_2d}."
257
+ )
258
+
241
259
  sources = [
242
260
  mp.EigenModeSource(
243
261
  src=mp.ContinuousSource(fcen)
@@ -246,15 +264,21 @@ def get_simulation(
246
264
  size=size,
247
265
  center=center,
248
266
  eig_band=port_source_mode + 1,
249
- eig_parity=mp.NO_PARITY if is_3d else mp.EVEN_Y + mp.ODD_Z,
267
+ eig_parity=mp.NO_PARITY,
250
268
  eig_match_freq=True,
251
269
  eig_kpoint=-1 * mp.Vector3(x=1).rotate(mp.Vector3(z=1), angle_rad),
252
270
  direction=direction,
253
271
  )
254
272
  ]
255
273
 
274
+ sim_center = mp.Vector3(
275
+ point_2d[0] if normal_2d == 'X' and not is_3d else component.x,
276
+ point_2d[1] if normal_2d == 'Y' and not is_3d else component.y,
277
+ point_2d[2] if normal_2d == 'Z' and not is_3d else 0,
278
+ )
256
279
  sim = mp.Simulation(
257
280
  cell_size=cell_size,
281
+ geometry_center=sim_center,
258
282
  boundary_layers=[mp.PML(tpml)],
259
283
  sources=sources,
260
284
  geometry=geometry,
@@ -269,7 +293,7 @@ def get_simulation(
269
293
 
270
294
  # Add port monitors dict
271
295
  monitors = {}
272
- for port in component_ref.ports:
296
+ for port in component.ports:
273
297
  port_name = port.name
274
298
  angle_rad = np.radians(port.orientation)
275
299
  width = port.width + 2 * port_margin
@@ -277,8 +301,11 @@ def get_simulation(
277
301
  size_y = width * abs(np.cos(angle_rad))
278
302
  size_x = 0 if size_x < 0.001 else size_x
279
303
  size_y = 0 if size_y < 0.001 else size_y
280
- size = mp.Vector3(size_x, size_y, size_z)
281
- size = [size_x, size_y, size_z]
304
+ size = mp.Vector3(
305
+ 0 if normal_2d == 'X' and not is_3d else size_x,
306
+ 0 if normal_2d == 'Y' and not is_3d else size_y,
307
+ 0 if normal_2d == 'Z' and not is_3d else size_z,
308
+ )
282
309
 
283
310
  # if monitor has a source move monitor inwards
284
311
  length = (
@@ -289,10 +316,14 @@ def get_simulation(
289
316
  xy_shifted = move_polar_rad_copy(
290
317
  np.array(port.center), angle=angle_rad, length=length
291
318
  )
292
- center = xy_shifted.tolist() + [0] # (x, y, z=0)
293
- m = sim.add_mode_monitor(freqs, mp.ModeRegion(center=center, size=size))
294
- m.z = 0
295
- monitors[port_name] = m
319
+ center = xy_shifted.round(6).tolist() + [0] # (x, y, z=0)
320
+ if is_3d or is_point_in_plane(center, point_2d, normal_vec):
321
+ m = sim.add_mode_monitor(freqs, mp.ModeRegion(center=center, size=size))
322
+ m.z = 0
323
+ monitors[port_name] = m
324
+ else:
325
+ warnings.warn(f"Monitor at port '{port_name}' ignored, "
326
+ f"because it is not in the {normal_2d}-normal 2D simulation domain around {point_2d}.")
296
327
  return dict(
297
328
  sim=sim,
298
329
  cell_size=cell_size,
@@ -3,6 +3,8 @@ import gdsfactory as gf
3
3
  from gplugins.common.utils import optical_constants
4
4
  from gplugins.gmeep.write_sparameters_meep import write_sparameters_meep
5
5
 
6
+ gf.gpdk.PDK.activate()
7
+
6
8
 
7
9
  def test_materials_override() -> None:
8
10
  """Checks that materials are properly overridden if index is provided."""
@@ -8,6 +8,7 @@ import numpy as np
8
8
  import gplugins as sim
9
9
  import gplugins.gmeep as gm
10
10
 
11
+ gf.gpdk.PDK.activate()
11
12
  simulation_settings = dict(resolution=20, is_3d=False)
12
13
 
13
14