Skip to content

Conversation

weiliangjin2021
Copy link
Collaborator

@weiliangjin2021 weiliangjin2021 commented May 21, 2025

Greptile Summary

Added field singularity correction capabilities for Perfect Electric Conductor (PEC) edges in electromagnetic simulations, improving accuracy at metallic boundaries.

  • Introduced edge_singularity_correction parameter in tidy3d/components/subpixel_spec.py for PECConformal class with default=True
  • Implemented handling for straight edges aligned with primal grids at 0° or 90° wedge angles
  • Added validation to prevent edge correction for lossy metals via SurfaceImpedance class
  • Included comprehensive test coverage in tests/test_components/test_simulation.py for edge correction behavior
  • Updated CHANGELOG.md to document this new electromagnetic simulation capability

@weiliangjin2021 weiliangjin2021 added rc2 2nd pre-release awaiting backend not to be merged as backend is not finalized 2.9 will go into version 2.9.* labels May 21, 2025
@weiliangjin2021
Copy link
Collaborator Author

Edge correction is now only applied at PEC edges.

Copy link
Contributor

github-actions bot commented May 23, 2025

badge

Code Coverage Summary

Filename                                                      Stmts    Miss  Cover    Missing
----------------------------------------------------------  -------  ------  -------  ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
tidy3d/__init__.py                                               76       0  100.00%
tidy3d/__main__.py                                               51       1  98.04%   113
tidy3d/compat.py                                                  5       2  60.00%   5-6
tidy3d/config.py                                                 21       0  100.00%
tidy3d/constants.py                                              88       0  100.00%
tidy3d/exceptions.py                                             16       0  100.00%
tidy3d/log.py                                                   189      19  89.95%   53, 90-91, 217, 226, 299, 303, 369, 407, 411-416, 420, 424-426, 443
tidy3d/packaging.py                                              57       7  87.72%   104, 141-144, 170-175
tidy3d/updater.py                                               196     120  38.78%   30, 35-36, 50, 58-62, 66-70, 74, 78, 96-112, 117-118, 125, 130-134, 138-141, 148-154, 158, 180, 195-204, 211-223, 230-276, 282-284, 291-296, 303-329, 336-341
tidy3d/version.py                                                 1       0  100.00%
tidy3d/components/__init__.py                                     0       0  100.00%
tidy3d/components/apodization.py                                 43       0  100.00%
tidy3d/components/base.py                                       498      12  97.59%   82, 89, 363, 416-417, 866, 1022, 1158-1162
tidy3d/components/bc_placement.py                                30       2  93.33%   50, 73
tidy3d/components/beam.py                                       190      24  87.37%   146, 170, 289-291, 295-297, 311, 316-319, 325, 328-332, 340-346
tidy3d/components/boundary.py                                   191       2  98.95%   925-926
tidy3d/components/dispersion_fitter.py                          420      22  94.76%   102-108, 194, 269, 366, 440, 460-464, 584, 659-660, 692, 828, 856, 913-914, 939, 961
tidy3d/components/field_projection.py                           353      33  90.65%   109, 152, 221, 256, 336-339, 422-423, 435, 523, 527-554, 626-642, 800-806
tidy3d/components/file_util.py                                   20       0  100.00%
tidy3d/components/frequencies.py                                104      49  52.88%   48-62, 64-68, 71, 73, 75-101
tidy3d/components/lumped_element.py                             455       6  98.68%   560-564, 1044, 1094, 1128, 1166
tidy3d/components/medium.py                                    2359     153  93.51%   156, 161, 166, 678, 693, 789, 947, 1384, 1391-1402, 1700, 1713-1714, 1913, 2018, 2021, 2034, 2037, 2047, 2132-2145, 2208-2211, 2214-2217, 2233, 2235, 2239, 2300, 2306-2307, 2313, 2326, 2407, 2439, 2495, 2812, 2822, 2862, 2915, 2924-2925, 3078, 3263, 3339, 3500, 3504, 3522, 3535, 3601, 3636, 3654, 3769-3773, 3873, 3891, 3896, 3899, 4042-4047, 4204, 4291, 4293, 4295, 4320, 4325, 4381, 4573, 4575, 4639-4643, 4695, 4700, 4705, 4710, 4870, 4872, 4898-4902, 4954, 4959, 4964, 5023, 5026, 5127, 5129, 5170-5174, 5226, 5231, 5236, 5565, 5619, 5627, 5665-5683, 5830, 6093-6095, 6130-6131, 6198-6212, 6318, 6422, 6675, 6893, 7108, 7240, 7418, 7427-7430
tidy3d/components/mode_spec.py                                   62       1  98.39%   210
tidy3d/components/monitor.py                                    359      25  93.04%   72, 80, 260, 307-316, 370, 399-402, 423, 534-535, 764, 771-773, 815, 825, 867, 1000
tidy3d/components/parameter_perturbation.py                     438      28  93.61%   11-12, 1546, 1569-1595, 1603-1623, 1782
tidy3d/components/run_time_spec.py                                5       0  100.00%
tidy3d/components/scene.py                                      598     148  75.25%   13-14, 160, 353-357, 382, 384, 521-522, 537, 549, 556, 929, 939, 959-968, 972-984, 990, 1024, 1132-1211, 1246, 1277, 1288, 1427-1433, 1500, 1531-1532, 1574, 1588-1594, 1612, 1625, 1707-1713, 1805, 1819-1852, 1871-1926
tidy3d/components/simulation.py                                1754     108  93.84%   15-16, 137-138, 202, 210, 218, 359, 368, 395, 405, 422, 437, 771-775, 823-827, 1046-1057, 1383, 1542, 1548, 1589, 1594, 1606, 1678-1684, 1744, 2940, 3168, 3217, 3278, 3307, 3315, 3328, 3371, 3390, 3409-3418, 3444, 3452, 3513, 3575, 3602, 3681, 3805, 4130, 4155, 4291-4292, 4297, 4425-4429, 4446, 4616-4621, 4663, 4729-4730, 4791, 4796, 4800-4852, 4876, 4915-4917, 4955-4956, 4986, 5096, 5102-5113, 5147, 5168
tidy3d/components/structure.py                                  223      17  92.38%   37-38, 124, 262, 294, 317, 347, 498-502, 556-557, 586, 592, 607, 617, 713
tidy3d/components/subpixel_spec.py                               46       2  95.65%   218, 222
tidy3d/components/time.py                                        75       2  97.33%   78, 88
tidy3d/components/time_modulation.py                             93       0  100.00%
tidy3d/components/transformation.py                              83       5  93.98%   68, 102, 153, 171, 187
tidy3d/components/type_util.py                                    5       1  80.00%   10
tidy3d/components/types.py                                      160      12  92.50%   15-16, 36-38, 65-69, 88, 170
tidy3d/components/types_extra.py                                  6       1  83.33%   12
tidy3d/components/validators.py                                 214      10  95.33%   59, 126-133, 242, 258, 350
tidy3d/components/autograd/__init__.py                            5       0  100.00%
tidy3d/components/autograd/boxes.py                              58      11  81.03%   30, 71, 78, 86-87, 91, 94-95, 133, 141, 146
tidy3d/components/autograd/derivative_utils.py                  123       5  95.93%   206, 214, 221, 226, 308
tidy3d/components/autograd/functions.py                          60       0  100.00%
tidy3d/components/autograd/types.py                              27       0  100.00%
tidy3d/components/autograd/utils.py                              10       0  100.00%
tidy3d/components/base_sim/__init__.py                            0       0  100.00%
tidy3d/components/base_sim/monitor.py                            33       0  100.00%
tidy3d/components/base_sim/simulation.py                        162       6  96.30%   194, 602-606, 668-672, 697
tidy3d/components/base_sim/source.py                             11       0  100.00%
tidy3d/components/base_sim/data/__init__.py                       0       0  100.00%
tidy3d/components/base_sim/data/monitor_data.py                  10       0  100.00%
tidy3d/components/base_sim/data/sim_data.py                      59       0  100.00%
tidy3d/components/data/__init__.py                                0       0  100.00%
tidy3d/components/data/data_array.py                            426      21  95.07%   77, 84, 130, 155-166, 251-255, 259-262, 376-381, 385-393, 587, 612
tidy3d/components/data/dataset.py                               181       4  97.79%   294, 396-399
tidy3d/components/data/monitor_data.py                         1365      58  95.75%   124, 176, 186, 328, 453, 464, 498, 642-654, 665, 812, 858, 1191-1192, 1196-1197, 1211, 1381, 1635, 1754, 1771, 2056, 2065, 2079-2080, 2198, 2206-2217, 2276, 2506, 2585, 2598, 2721, 3084, 3203, 3225-3226, 3392, 3426, 3640-3641, 3748
tidy3d/components/data/sim_data.py                              419      24  94.27%   307, 353, 400, 405, 422, 431, 525, 533, 566, 570, 617, 629, 640, 940, 986, 1051, 1058, 1067, 1094, 1296, 1298, 1302, 1321-1322
tidy3d/components/data/utils.py                                  46       4  91.30%   39, 50, 71, 79
tidy3d/components/data/validators.py                             41       1  97.56%   49
tidy3d/components/data/zbf.py                                    50       4  92.00%   118-119, 130-131
tidy3d/components/data/unstructured/__init__.py                   0       0  100.00%
tidy3d/components/data/unstructured/base.py                     640      37  94.22%   77, 89, 100, 110, 137, 149, 198, 200-210, 374, 381, 388, 391, 424, 585-590, 599, 608, 630, 857, 860, 866, 904-908, 981, 1233, 1533, 1599, 1672, 1699, 1724, 1751
tidy3d/components/data/unstructured/tetrahedral.py              109       4  96.33%   113, 216, 330, 349
tidy3d/components/data/unstructured/triangular.py               194      11  94.33%   13-14, 148, 165, 294, 355, 485-486, 489, 505, 524
tidy3d/components/eme/__init__.py                                 0       0  100.00%
tidy3d/components/eme/grid.py                                   304       2  99.34%   118, 164
tidy3d/components/eme/monitor.py                                 41       0  100.00%
tidy3d/components/eme/simulation.py                             466       7  98.50%   9-10, 719, 932, 946, 961, 969
tidy3d/components/eme/sweep.py                                   40       0  100.00%
tidy3d/components/eme/data/__init__.py                            0       0  100.00%
tidy3d/components/eme/data/dataset.py                            27       0  100.00%
tidy3d/components/eme/data/monitor_data.py                       14       0  100.00%
tidy3d/components/eme/data/sim_data.py                          220       8  96.36%   250-255, 278-281
tidy3d/components/geometry/__init__.py                            0       0  100.00%
tidy3d/components/geometry/base.py                             1031      81  92.14%   17-18, 131, 553-556, 581, 585, 710-719, 785, 1241-1245, 1259-1262, 1383-1387, 1425-1426, 1439, 1454, 1456, 1462-1466, 1471, 1477, 1483, 1489, 1495, 1500, 1504, 1510, 1806, 1852-1856, 2053, 2282-2311, 2722, 2880, 2891, 2918-2922, 2970, 3024-3026, 3126, 3277
tidy3d/components/geometry/bound_ops.py                          28       0  100.00%
tidy3d/components/geometry/mesh.py                              188      20  89.36%   81, 199, 211-213, 252, 294, 298, 323, 370-374, 429-443
tidy3d/components/geometry/polyslab.py                          783      35  95.53%   112, 347-353, 471, 601, 627, 969-974, 1146, 1175, 1178, 1355-1364, 1440, 1523-1546, 1565, 1927, 1986
tidy3d/components/geometry/primitives.py                        318      67  78.93%   97, 251, 315, 318, 328-331, 361, 392-465
tidy3d/components/geometry/triangulation.py                      64       2  96.88%   134, 148
tidy3d/components/geometry/utils.py                             184       6  96.74%   57, 267, 285, 288-291
tidy3d/components/geometry/utils_2d.py                          103       0  100.00%
tidy3d/components/grid/__init__.py                                0       0  100.00%
tidy3d/components/grid/corner_finder.py                          76       0  100.00%
tidy3d/components/grid/grid.py                                  209      10  95.22%   142, 252-258, 598, 702
tidy3d/components/grid/grid_spec.py                             743      21  97.17%   209, 228-231, 665, 763, 1403-1405, 1410-1411, 1425, 1470, 1472, 1480, 1495, 2571-2575, 2649, 2657
tidy3d/components/grid/mesher.py                                483      11  97.72%   164, 811, 905, 994, 996, 998, 1064, 1113, 1192, 1264, 1315
tidy3d/components/material/__init__.py                            0       0  100.00%
tidy3d/components/material/multi_physics.py                      33       0  100.00%
tidy3d/components/material/solver_types.py                        9       0  100.00%
tidy3d/components/material/types.py                               5       0  100.00%
tidy3d/components/material/tcad/__init__.py                       0       0  100.00%
tidy3d/components/material/tcad/charge.py                        31       3  90.32%   39, 42, 45
tidy3d/components/material/tcad/heat.py                          27       4  85.19%   29, 33, 37, 43
tidy3d/components/microwave/__init__.py                           0       0  100.00%
tidy3d/components/microwave/data/__init__.py                      0       0  100.00%
tidy3d/components/microwave/data/monitor_data.py                 51       0  100.00%
tidy3d/components/microwave/formulas/__init__.py                  0       0  100.00%
tidy3d/components/microwave/formulas/circuit_parameters.py       34       0  100.00%
tidy3d/components/mode/__init__.py                                0       0  100.00%
tidy3d/components/mode/derivatives.py                           127       2  98.43%   171, 228
tidy3d/components/mode/mode_solver.py                           878     233  73.46%   75-77, 106, 184-185, 195, 210, 256-258, 342-345, 376, 430, 460-466, 471-542, 550-556, 562-600, 606-610, 644-726, 846-967, 972-979, 987-991, 996-1029, 1040-1042, 1110, 1285-1290, 1343-1355, 1438, 1491, 1564, 1682, 1697, 1702-1704, 1709-1715, 1723-1729, 1740, 1742, 1751, 1820, 2261, 2323-2325, 2488
tidy3d/components/mode/simulation.py                            127       6  95.28%   221-228
tidy3d/components/mode/solver.py                                414      72  82.61%   115, 122, 138-139, 144-149, 162, 237, 247-248, 254, 278, 390, 475-481, 499, 506-508, 547-548, 557-587, 594-600, 647, 650, 892, 916, 973, 984, 998, 1003-1016, 1024-1030, 1035, 1043
tidy3d/components/mode/transforms.py                             31       0  100.00%
tidy3d/components/mode/data/__init__.py                           0       0  100.00%
tidy3d/components/mode/data/sim_data.py                          18       0  100.00%
tidy3d/components/source/__init__.py                              0       0  100.00%
tidy3d/components/source/base.py                                 53       6  88.68%   93-100
tidy3d/components/source/current.py                              33       0  100.00%
tidy3d/components/source/field.py                               175      13  92.57%   129, 461-466, 531-537, 547
tidy3d/components/source/time.py                                147       9  93.88%   176-177, 190-192, 267, 370, 406, 438
tidy3d/components/source/utils.py                                 5       0  100.00%
tidy3d/components/spice/__init__.py                               0       0  100.00%
tidy3d/components/spice/types.py                                  3       0  100.00%
tidy3d/components/spice/analysis/__init__.py                      0       0  100.00%
tidy3d/components/spice/analysis/dc.py                           13       0  100.00%
tidy3d/components/spice/sources/__init__.py                       0       0  100.00%
tidy3d/components/spice/sources/dc.py                            20       0  100.00%
tidy3d/components/spice/sources/types.py                          4       0  100.00%
tidy3d/components/tcad/__init__.py                                0       0  100.00%
tidy3d/components/tcad/bandgap.py                                 8       0  100.00%
tidy3d/components/tcad/doping.py                                123      29  76.42%   20-27, 35-37, 50, 55-57, 62-63, 121-133, 232-235, 320
tidy3d/components/tcad/generation_recombination.py               21       0  100.00%
tidy3d/components/tcad/grid.py                                   60      10  83.33%   107-109, 114-116, 146-150
tidy3d/components/tcad/mobility.py                               13       0  100.00%
tidy3d/components/tcad/types.py                                  16       0  100.00%
tidy3d/components/tcad/viz.py                                    10       0  100.00%
tidy3d/components/tcad/boundary/__init__.py                       0       0  100.00%
tidy3d/components/tcad/boundary/abstract.py                       4       0  100.00%
tidy3d/components/tcad/boundary/charge.py                        10       0  100.00%
tidy3d/components/tcad/boundary/heat.py                          11       0  100.00%
tidy3d/components/tcad/boundary/specification.py                 10       0  100.00%
tidy3d/components/tcad/data/__init__.py                           0       0  100.00%
tidy3d/components/tcad/data/sim_data.py                         102       9  91.18%   213, 227, 233, 243, 278-281, 286, 309
tidy3d/components/tcad/data/types.py                              5       0  100.00%
tidy3d/components/tcad/data/monitor_data/__init__.py              0       0  100.00%
tidy3d/components/tcad/data/monitor_data/abstract.py             52       0  100.00%
tidy3d/components/tcad/data/monitor_data/charge.py              174       7  95.98%   81-84, 134-135, 251, 434
tidy3d/components/tcad/data/monitor_data/heat.py                 42       1  97.62%   87
tidy3d/components/tcad/monitors/__init__.py                       0       0  100.00%
tidy3d/components/tcad/monitors/abstract.py                      11       2  81.82%   36-37
tidy3d/components/tcad/monitors/charge.py                        10       0  100.00%
tidy3d/components/tcad/monitors/heat.py                           2       0  100.00%
tidy3d/components/tcad/simulation/__init__.py                     0       0  100.00%
tidy3d/components/tcad/simulation/heat.py                        21       0  100.00%
tidy3d/components/tcad/simulation/heat_charge.py                586     107  81.74%   14-15, 332-333, 384, 394, 415-416, 525, 572, 598, 606, 611, 628-629, 697, 712, 773, 802-804, 811, 824, 889, 901, 982-994, 1060-1061, 1066, 1081-1093, 1099-1101, 1159, 1182-1196, 1203-1205, 1208, 1222, 1228-1236, 1283-1301, 1321, 1439, 1444-1445, 1468, 1504-1505, 1523-1537, 1549-1556, 1601, 1617, 1624, 1638, 1645, 1652
tidy3d/components/tcad/source/__init__.py                         0       0  100.00%
tidy3d/components/tcad/source/abstract.py                        21       1  95.24%   24
tidy3d/components/tcad/source/coupled.py                          3       0  100.00%
tidy3d/components/tcad/source/heat.py                            14       0  100.00%
tidy3d/components/viz/__init__.py                                 9       0  100.00%
tidy3d/components/viz/axes_utils.py                              43       0  100.00%
tidy3d/components/viz/descartes.py                               38       4  89.47%   21-22, 64-65
tidy3d/components/viz/flex_color_palettes.py                      3       3  0.00%    1-1821
tidy3d/components/viz/flex_style.py                              26      11  57.69%   19-23, 37-38, 41-44
tidy3d/components/viz/plot_params.py                             45       0  100.00%
tidy3d/components/viz/plot_sim_3d.py                             17       2  88.24%   13-14
tidy3d/components/viz/styles.py                                  16       2  87.50%   5-6
tidy3d/components/viz/visualization_spec.py                      29       3  89.66%   13-15
tidy3d/material_library/__init__.py                               0       0  100.00%
tidy3d/material_library/material_library.py                     187       8  95.72%   84, 90, 93, 152, 155, 171, 222, 2080
tidy3d/material_library/material_reference.py                     9       0  100.00%
tidy3d/material_library/parametric_materials.py                 159       3  98.11%   19-20, 252
tidy3d/material_library/util.py                                 131      53  59.54%   50-51, 97, 113-120, 126-138, 191-206, 212-250
tidy3d/plugins/__init__.py                                        0       0  100.00%
tidy3d/plugins/adjoint/__init__.py                               15       2  86.67%   8-9
tidy3d/plugins/adjoint/web.py                                   286      55  80.77%   70, 75, 224-238, 244-253, 281-283, 319-322, 336-347, 361-375, 564-580, 594-619
tidy3d/plugins/adjoint/components/__init__.py                     9       0  100.00%
tidy3d/plugins/adjoint/components/base.py                       142       0  100.00%
tidy3d/plugins/adjoint/components/geometry.py                   379      16  95.78%   76, 227, 346, 537, 589, 633-635, 684, 859, 867-870, 969, 972, 977
tidy3d/plugins/adjoint/components/medium.py                     175       2  98.86%   299, 438
tidy3d/plugins/adjoint/components/simulation.py                 301       9  97.01%   226-227, 242-247, 327, 614-615, 722-723
tidy3d/plugins/adjoint/components/structure.py                   98       1  98.98%   166
tidy3d/plugins/adjoint/components/types.py                       21       2  90.48%   35-39
tidy3d/plugins/adjoint/components/data/__init__.py                0       0  100.00%
tidy3d/plugins/adjoint/components/data/data_array.py            295      26  91.19%   76, 226, 246-251, 288, 337, 387, 398-408, 412-417, 451-452
tidy3d/plugins/adjoint/components/data/dataset.py                11       0  100.00%
tidy3d/plugins/adjoint/components/data/monitor_data.py          198       8  95.96%   164, 190, 198, 231, 237, 242, 255, 428
tidy3d/plugins/adjoint/components/data/sim_data.py              122       4  96.72%   153, 253-255
tidy3d/plugins/adjoint/utils/__init__.py                          0       0  100.00%
tidy3d/plugins/adjoint/utils/filter.py                           77       1  98.70%   53
tidy3d/plugins/adjoint/utils/penalty.py                          98       3  96.94%   234, 240, 272
tidy3d/plugins/autograd/__init__.py                               6       0  100.00%
tidy3d/plugins/autograd/constants.py                              2       0  100.00%
tidy3d/plugins/autograd/differential_operators.py                26       0  100.00%
tidy3d/plugins/autograd/functions.py                            146       6  95.89%   52, 58, 272, 279, 326, 333
tidy3d/plugins/autograd/types.py                                  3       0  100.00%
tidy3d/plugins/autograd/utilities.py                             71       4  94.37%   204, 222-223, 237
tidy3d/plugins/autograd/invdes/__init__.py                        6       0  100.00%
tidy3d/plugins/autograd/invdes/filters.py                        66       3  95.45%   53-54, 204
tidy3d/plugins/autograd/invdes/misc.py                            4       1  75.00%   23
tidy3d/plugins/autograd/invdes/parametrizations.py               26       0  100.00%
tidy3d/plugins/autograd/invdes/penalties.py                      59      21  64.41%   85, 137-139, 163-167, 188-190, 227-236
tidy3d/plugins/autograd/invdes/projections.py                    14       5  64.29%   30-34, 67
tidy3d/plugins/autograd/primitives/__init__.py                    3       0  100.00%
tidy3d/plugins/autograd/primitives/interpolate.py               260       4  98.46%   15, 615, 644, 681
tidy3d/plugins/autograd/primitives/misc.py                        4       0  100.00%
tidy3d/plugins/design/__init__.py                                 5       0  100.00%
tidy3d/plugins/design/design.py                                 227       4  98.24%   106, 142-143, 373
tidy3d/plugins/design/method.py                                 315       1  99.68%   66
tidy3d/plugins/design/parameter.py                               95       2  97.89%   39, 120
tidy3d/plugins/design/result.py                                 151       7  95.36%   102, 121, 149, 232, 274, 319, 329
tidy3d/plugins/dispersion/__init__.py                             4       0  100.00%
tidy3d/plugins/dispersion/fit.py                                271      13  95.20%   171, 421, 501, 509, 524, 531-534, 665-666, 740, 742
tidy3d/plugins/dispersion/fit_fast.py                            38       1  97.37%   148
tidy3d/plugins/dispersion/fit_web.py                              2       2  0.00%    3-5
tidy3d/plugins/dispersion/web.py                                105      21  80.00%   104, 230-233, 249-254, 279-295, 306-309, 350-354, 365
tidy3d/plugins/expressions/__init__.py                           19       0  100.00%
tidy3d/plugins/expressions/base.py                              132      49  62.88%   12, 41, 55, 58, 61, 86-88, 96-98, 101-102, 118-120, 128, 131-133, 136-138, 149-151, 154-156, 159-161, 169-171, 174-176, 179-181, 184-186, 189-191, 194-196, 199-201, 204, 207, 210, 213, 216, 219, 222, 225, 228
tidy3d/plugins/expressions/functions.py                          36       1  97.22%   47
tidy3d/plugins/expressions/metrics.py                            45       2  95.56%   48, 91
tidy3d/plugins/expressions/operators.py                          65       2  96.92%   33, 63
tidy3d/plugins/expressions/types.py                              14       4  71.43%   8-22
tidy3d/plugins/expressions/variables.py                          26       1  96.15%   96
tidy3d/plugins/invdes/__init__.py                                 9       0  100.00%
tidy3d/plugins/invdes/base.py                                     4       0  100.00%
tidy3d/plugins/invdes/design.py                                 167      23  86.23%   58, 61, 73-76, 112-115, 184, 203-204, 206, 217-222, 227-233, 329-330
tidy3d/plugins/invdes/initialization.py                          58       8  86.21%   24, 57, 97, 104-108, 110, 117, 124
tidy3d/plugins/invdes/optimizer.py                               96       4  95.83%   98, 175, 221, 294
tidy3d/plugins/invdes/penalty.py                                 23       1  95.65%   31
tidy3d/plugins/invdes/region.py                                 171      14  91.81%   81, 101, 185-186, 193-194, 206, 214, 217, 223, 229, 239, 282-283
tidy3d/plugins/invdes/result.py                                  53       0  100.00%
tidy3d/plugins/invdes/transformation.py                          25       2  92.00%   24, 79
tidy3d/plugins/invdes/utils.py                                   36       0  100.00%
tidy3d/plugins/invdes/validators.py                              34       6  82.35%   17-28
tidy3d/plugins/microwave/__init__.py                              9       0  100.00%
tidy3d/plugins/microwave/array_factor.py                        273       2  99.27%   177, 185
tidy3d/plugins/microwave/auto_path_integrals.py                  24       0  100.00%
tidy3d/plugins/microwave/custom_path_integrals.py               135       1  99.26%   393
tidy3d/plugins/microwave/impedance_calculator.py                 48       0  100.00%
tidy3d/plugins/microwave/lobe_measurer.py                       154       0  100.00%
tidy3d/plugins/microwave/path_integrals.py                      264       4  98.48%   109, 186, 300, 421
tidy3d/plugins/microwave/rf_material_library.py                  16       0  100.00%
tidy3d/plugins/microwave/rf_material_reference.py                 2       0  100.00%
tidy3d/plugins/microwave/viz.py                                  17       0  100.00%
tidy3d/plugins/microwave/models/__init__.py                       2       0  100.00%
tidy3d/plugins/microwave/models/coupled_microstrip.py            48       0  100.00%
tidy3d/plugins/microwave/models/microstrip.py                    63       0  100.00%
tidy3d/plugins/mode/__init__.py                                   2       0  100.00%
tidy3d/plugins/mode/mode_solver.py                                7       0  100.00%
tidy3d/plugins/mode/web.py                                        2       0  100.00%
tidy3d/plugins/polyslab/__init__.py                               2       0  100.00%
tidy3d/plugins/polyslab/polyslab.py                               6       0  100.00%
tidy3d/plugins/pytorch/__init__.py                                2       0  100.00%
tidy3d/plugins/pytorch/wrapper.py                                38       1  97.37%   64
tidy3d/plugins/resonance/__init__.py                              2       0  100.00%
tidy3d/plugins/resonance/resonance.py                           171      10  94.15%   108, 137, 182, 201-202, 216, 223, 246, 252, 279
tidy3d/plugins/smatrix/__init__.py                               10       0  100.00%
tidy3d/plugins/smatrix/smatrix.py                                 3       0  100.00%
tidy3d/plugins/smatrix/component_modelers/__init__.py             0       0  100.00%
tidy3d/plugins/smatrix/component_modelers/base.py               138      21  84.78%   162-166, 178-183, 194, 199, 221-224, 248, 306-310
tidy3d/plugins/smatrix/component_modelers/modal.py              156       1  99.36%   135
tidy3d/plugins/smatrix/component_modelers/terminal.py           275       0  100.00%
tidy3d/plugins/smatrix/data/__init__.py                           0       0  100.00%
tidy3d/plugins/smatrix/data/terminal.py                          19       4  78.95%   32-36, 59-63
tidy3d/plugins/smatrix/ports/__init__.py                          0       0  100.00%
tidy3d/plugins/smatrix/ports/base_lumped.py                      40       0  100.00%
tidy3d/plugins/smatrix/ports/base_terminal.py                    32       2  93.75%   48-52
tidy3d/plugins/smatrix/ports/coaxial_lumped.py                  163       0  100.00%
tidy3d/plugins/smatrix/ports/modal.py                            13       0  100.00%
tidy3d/plugins/smatrix/ports/rectangular_lumped.py              122       0  100.00%
tidy3d/plugins/smatrix/ports/wave.py                            108       2  98.15%   123, 181
tidy3d/plugins/waveguide/__init__.py                              2       0  100.00%
tidy3d/plugins/waveguide/rectangular_dielectric.py              369      80  78.32%   273, 326, 334, 337, 463-464, 612-634, 643-678, 681-699, 802, 807, 812, 848, 898, 930, 978, 1019, 1046-1085, 1137-1149
tidy3d/web/__init__.py                                           12       0  100.00%
tidy3d/web/environment.py                                         2       2  0.00%    3-5
tidy3d/web/api/__init__.py                                        0       0  100.00%
tidy3d/web/api/asynchronous.py                                   13       2  84.62%   64, 68
tidy3d/web/api/connect_util.py                                   43      18  58.14%   36-41, 48, 53-59, 64-70
tidy3d/web/api/container.py                                     337      37  89.02%   44, 242, 290, 338, 451, 470-472, 622, 643, 734-738, 755, 758-763, 824-844, 865-866, 928-929, 975, 981-982
tidy3d/web/api/material_fitter.py                                63      20  68.25%   76-102, 106-107, 124-125
tidy3d/web/api/material_libray.py                                20       1  95.00%   31
tidy3d/web/api/mode.py                                          209      66  68.42%   126-129, 134, 142, 196-199, 221, 223-232, 235-247, 343, 360, 403-406, 489-491, 495, 524-582, 616-619, 630-631, 669
tidy3d/web/api/tidy3d_stub.py                                   116      45  61.21%   72-75, 86, 110, 146, 181-204, 220, 238-264
tidy3d/web/api/webapi.py                                        357      74  79.27%   340, 370, 400, 438-456, 499-504, 518-523, 544, 553, 574, 601-604, 624-625, 706-714, 818-823, 869, 872, 898, 932, 935-936, 991, 999-1001, 1014, 1016, 1020, 1074, 1111, 1128-1136
tidy3d/web/api/autograd/__init__.py                               0       0  100.00%
tidy3d/web/api/autograd/autograd.py                             429      70  83.68%   342, 581-595, 603-613, 731, 873, 929-949, 952, 1078-1082, 1116-1117, 1120-1121, 1123, 1131-1157, 1166-1180
tidy3d/web/api/autograd/utils.py                                 48       0  100.00%
tidy3d/web/cli/__init__.py                                        2       0  100.00%
tidy3d/web/cli/app.py                                            65      35  46.15%   31-36, 56, 68-111, 117
tidy3d/web/cli/constants.py                                       8       1  87.50%   11
tidy3d/web/cli/migrate.py                                        45      35  22.22%   18-75
tidy3d/web/cli/develop/__init__.py                                7       0  100.00%
tidy3d/web/cli/develop/documentation.py                          77      54  29.87%   62-113, 142-161, 177-180, 224-228, 328-338
tidy3d/web/cli/develop/index.py                                   5       1  80.00%   18
tidy3d/web/cli/develop/install.py                               159     133  16.35%   36-46, 60-63, 75-100, 112-125, 142-153, 165-175, 185-186, 206-262, 287-289, 307-363, 379-380, 400-411
tidy3d/web/cli/develop/packaging.py                              34      18  47.06%   50-77, 110-116
tidy3d/web/cli/develop/tests.py                                  16       6  62.50%   27-30, 63-64
tidy3d/web/cli/develop/utils.py                                  14       6  57.14%   45-47, 66-68
tidy3d/web/core/__init__.py                                       0       0  100.00%
tidy3d/web/core/account.py                                       20       1  95.00%   67
tidy3d/web/core/cache.py                                          2       0  100.00%
tidy3d/web/core/constants.py                                     22       0  100.00%
tidy3d/web/core/core_config.py                                   12       0  100.00%
tidy3d/web/core/environment.py                                   58       8  86.21%   15, 99-106, 139, 150, 161
tidy3d/web/core/exceptions.py                                     8       0  100.00%
tidy3d/web/core/file_util.py                                     39      14  64.10%   21-23, 34-36, 42-49, 59
tidy3d/web/core/http_util.py                                    105      19  81.90%   36, 63, 65-67, 88, 98, 135-138, 147-148, 157-159, 169, 177-178
tidy3d/web/core/s3utils.py                                      119      75  36.97%   48-49, 54-55, 60, 72, 99-100, 110, 134-135, 145, 156-161, 200-208, 237-276, 302-355, 383-414
tidy3d/web/core/stub.py                                          19       5  73.68%   24, 40, 58, 74, 85
tidy3d/web/core/task_core.py                                    183      31  83.06%   78-80, 185-191, 233, 287, 299, 307, 311, 329, 344, 367, 369, 409, 443, 473, 476, 513, 526-527, 538-539, 570, 593, 621, 646-649, 659
tidy3d/web/core/task_info.py                                     97       0  100.00%
tidy3d/web/core/types.py                                         38       1  97.37%   69
TOTAL                                                         33803    3122  90.76%

Diff against develop

Filename                              Stmts    Miss  Cover
----------------------------------  -------  ------  -------
tidy3d/components/subpixel_spec.py       +2       0  +0.20%
tidy3d/web/core/http_util.py              0      +2  -1.91%
TOTAL                                    +2      +2  -0.01%

Results for commit: e0ca6b6

Minimum allowed coverage is 90%

♻️ This comment has been updated with latest results

Copy link
Contributor

badge

Changed Files Coverage

Filename                              Stmts    Miss  Cover    Missing
----------------------------------  -------  ------  -------  ---------
tidy3d/components/subpixel_spec.py       46       2  95.65%   218, 222
TOTAL                                    46       2  95.65%

Results for commit: e0ca6b6

Minimum allowed coverage is 90%

♻️ This comment has been updated with latest results

Copy link
Contributor

@dmarek-flex dmarek-flex left a comment

Choose a reason for hiding this comment

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

Frontend looks good

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

3 files reviewed, 1 comment
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

github-actions bot commented Jun 15, 2025

Diff Coverage

Diff: origin/develop...HEAD, staged and unstaged changes

  • tidy3d/components/subpixel_spec.py (100%)

Summary

  • Total: 1 line
  • Missing: 0 lines
  • Coverage: 100%

@weiliangjin2021 weiliangjin2021 force-pushed the weiliang/singularity branch 2 times, most recently from b8e9410 to 81b4de0 Compare July 2, 2025 00:53
@weiliangjin2021
Copy link
Collaborator Author

@dmarek-flex For back-compatibility, we should set the default edge singularity correction to False? In the future RF product, we can set it True there

@weiliangjin2021 weiliangjin2021 force-pushed the weiliang/singularity branch 4 times, most recently from ec361d4 to 5bbbd64 Compare July 10, 2025 22:51
@weiliangjin2021 weiliangjin2021 removed the awaiting backend not to be merged as backend is not finalized label Jul 10, 2025
@weiliangjin2021
Copy link
Collaborator Author

singularity correction for lossy metal is now also enabled.

@weiliangjin2021 weiliangjin2021 added this pull request to the merge queue Jul 16, 2025
Merged via the queue into develop with commit 5c96f7a Jul 16, 2025
24 checks passed
@weiliangjin2021 weiliangjin2021 deleted the weiliang/singularity branch July 16, 2025 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.9 will go into version 2.9.* rc2 2nd pre-release RF
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants