Skip to content

Upgrade ruff 0.5.5 -> 0.10.11 & review rules#2486

Merged
yaugenst-flex merged 1 commit into
developfrom
yaugenst-flex/ruff-upgrade
May 27, 2025
Merged

Upgrade ruff 0.5.5 -> 0.10.11 & review rules#2486
yaugenst-flex merged 1 commit into
developfrom
yaugenst-flex/ruff-upgrade

Conversation

@yaugenst-flex
Copy link
Copy Markdown
Collaborator

@yaugenst-flex yaugenst-flex commented May 19, 2025

The most controversial rule change in here is probably the addition of C408, which enforces {"a": a, "b": b} over dict(a=a, b=b).
Following reasons why I think it's a good change:

  1. Speed: dict() is 2x slower than a literal because it needs to do a global namespace lookup.
  2. Edge cases: dict() only works if keys are valid identifiers.
  3. Clarity: Personally I find it easier to identify dicts at a glance when they are literals. I know this is subjective...

I kept all commits in here grouped by the rule and the code changes associated with it, so it's easy to inspect what a specific rule does and if we might want to revert it. I'll keep this PR open and merge before #2433 and resolve any conflicts that arise there.

There are many lines of changes but really only the rule additions need reviewing and whether you agree with them or not.

NOTE: I really want to enable B008 because function calls in default arguments are a significant anti-pattern and they are so common in our codebase that they do affect import time significantly. However, I had to revert the addition because my fix broke tests/test_components/test_layerrefinement.py::test_grid_spec_with_layers because it seems like many of the grid_spec functions have undocumented behavior when it comes to passing None for corner_finder and corner_refinement. If you could have a look @weiliangjin2021 that would be great.


PR Summary

Net Changes

  • Enabled: C4*, NPY*, RUF*, ISC*, PIE*, RSE*, TID*, PLE*, PLC*
  • Disabled: legacy C*, standalone NPY201
  • Newly ignored: RUF001-003, RUF012, RUF015, NPY002
  • Now enforced: C408, B904, B028, UP006, UP038, UP035
  • Restructured the [tool.ruff] section in pyproject.toml:
    • select -> extend-select to keep default rules, similarly for ignore
    • Moved test-specific ruff config from tests/ruff.toml to [tool.ruff.lint.per-file-ignores] in pyproject.toml

Additions

Area What Why
Rule families C4, NPY, RUF, ISC, PIE, RSE, TID, PLE, PLC in extend-select Modern comprehensions, full NumPy checks, Ruff built-ins, pylint parity, etc.
isort required-imports = ["from __future__ import annotations"] Auto-adds future annotations → no longer need to ignore UP006.
Ignore list RUF001-003, RUF012, RUF015, NPY002 via extend-ignore Low-value or transitional warnings.
Per-file ignores Relaxed rules for tests/**/* (B015, E402, TID252, …) Tests don't need to be as strict.

Removed / No-Longer-Ignored

Removed from config Effect
typing-modules hack Ruff ≥ 0.4 now infers Literal types; custom list deleted.
Old ignore items: C408, B904, B028, UP006, UP038, UP035 These rules are enforced again. UP006 safe thanks to required imports.
Obsolete selections: C prefix, lone NPY201 Replaced by C4* and full NPY* suites.

@yaugenst-flex yaugenst-flex self-assigned this May 19, 2025
@yaugenst-flex yaugenst-flex added the 2.9 will go into version 2.9.* label May 19, 2025
@yaugenst-flex yaugenst-flex linked an issue May 19, 2025 that may be closed by this pull request
@yaugenst-flex yaugenst-flex force-pushed the yaugenst-flex/ruff-upgrade branch from aa0b838 to 500d7d3 Compare May 19, 2025 12:24
@yaugenst-flex yaugenst-flex marked this pull request as ready for review May 19, 2025 12:55
@momchil-flex momchil-flex added the rc1 1st pre-release label May 19, 2025
@weiliangjin2021
Copy link
Copy Markdown
Collaborator

weiliangjin2021 commented May 19, 2025

However, I had to revert the addition because my fix broke tests/test_components/test_layerrefinement.py::test_grid_spec_with_layers because it seems like many of the grid_spec functions have undocumented behavior when it comes to passing None for corner_finder and corner_refinement. If you could have a look @weiliangjin2021 that would be great.

Currently, None means disabling this feature. E.g. corner_refinement=None: don't apply refinement around corners. The default value, on the other hand, indicates a good initial choice. E.g. corner_finder=CornerFinderSpec() means you can start with the default value in CornerFinderSpec if you want the corner finder feature, and it's very likely that you don't need to tune the default values. Any better options you have in mind?

@yaugenst-flex
Copy link
Copy Markdown
Collaborator Author

Thanks @weiliangjin2021 for clarifying. I think my main source of confusion was that this behavior doesn't seem to be documented, at least I wasn't able to infer it from the field descriptions. The defaults for the fields can be solved by using default factories, which I am changing across the board in #2433. For the classmethods it seems a bit more tricky. One option would be to change the field to Union[Optional[CornerFinderSpec], Literal[False]], where False explicitly turns it off and None would mean default, which I think is more explicit. If not, then an alternative approach might be to introduce a sentinel (e.g. pydantic.Undefined) in the class constructors. That would look something like:

@classmethod
def from_layer_bounds(cls, ..., corner_finder: Union[CornerFinderSpec, None, object] = Undefined):
    if corner_finder is Undefined:
        corner_finder = ...  # handle default

Copy link
Copy Markdown
Collaborator

@momchil-flex momchil-flex left a comment

Choose a reason for hiding this comment

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

Sounds good to me. Note that the backend uses the same ruff definitions like the frontend so will need an update too...

  • Now enforced: C901, C408, B904, B028, UP006, UP038, UP035

Seems like C901 is still ignored?

@yaugenst-flex
Copy link
Copy Markdown
Collaborator Author

yaugenst-flex commented May 20, 2025

Seems like C901 is still ignored?

Oops you're right. I disabled C in favor of the C4 group (which is the actual group..). It's good this way though don't think we want C901 😅

Edited the PR description.

@weiliangjin2021
Copy link
Copy Markdown
Collaborator

Thanks @weiliangjin2021 for clarifying. I think my main source of confusion was that this behavior doesn't seem to be documented, at least I wasn't able to infer it from the field descriptions.

Actually it's in the description:

corner_snapping: bool = pd.Field(
True,
title="Placing Grid Snapping Point At Corners",
description="If ``True`` and ``corner_finder`` is not ``None``, enforcing inplane "
"grid boundaries to pass through corners of geometries specified by ``corner_finder``.",
)
corner_refinement: Optional[GridRefinement] = pd.Field(
GridRefinement(),
title="Inplane Mesh Refinement Factor Around Corners",
description="If not ``None`` and ``corner_finder`` is not ``None``, refine mesh around "
"corners of geometries specified by ``corner_finder``. ",
)
. Maybe not explicit enough, but it does indicate that snapping and refinement are only enabled if corner_finder is not None.

The defaults for the fields can be solved by using default factories, which I am changing across the board in #2433. For the classmethods it seems a bit more tricky. One option would be to change the field to Union[Optional[CornerFinderSpec], Literal[False]], where False explicitly turns it off and None would mean default, which I think is more explicit. If not, then an alternative approach might be to introduce a sentinel (e.g. pydantic.Undefined) in the class constructors. That would look something like:

How do we deal with back-compatibility, as right now None means turning it off.

@yaugenst-flex
Copy link
Copy Markdown
Collaborator Author

How do we deal with back-compatibility, as right now None means turning it off.

Yes that's fair, in that case it's probably be to go with the sentinel approach in the classmethods, that should be fully backwards-compatible.

@yaugenst-flex yaugenst-flex force-pushed the yaugenst-flex/ruff-upgrade branch from 7cca025 to a515d75 Compare May 21, 2025 07:19
@yaugenst-flex
Copy link
Copy Markdown
Collaborator Author

@weiliangjin2021 implemented the change in 64f7fbf. tests are passing, so just fyi

Copy link
Copy Markdown
Collaborator

@daquinteroflex daquinteroflex left a comment

Choose a reason for hiding this comment

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

Nice, gone through each rule change and do feel things will be clearer and more standardised by enfocing these. Thanks Yannick.

@yaugenst-flex yaugenst-flex force-pushed the yaugenst-flex/ruff-upgrade branch 5 times, most recently from 4a3c50e to 2b85bdb Compare May 24, 2025 04:52
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 24, 2025

badge

Code Coverage Summary

Details
Filename                                                      Stmts    Miss  Cover    Missing
----------------------------------------------------------  -------  ------  -------  ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
tidy3d/__init__.py                                               78       0  100.00%
tidy3d/__main__.py                                               52       1  98.08%   115
tidy3d/compat.py                                                  6       2  66.67%   7-8
tidy3d/config.py                                                 22       0  100.00%
tidy3d/constants.py                                              91       0  100.00%
tidy3d/exceptions.py                                             18       0  100.00%
tidy3d/log.py                                                   190      19  90.00%   55, 92-93, 219, 228, 301, 305, 371, 409, 413-418, 422, 426-428, 445
tidy3d/packaging.py                                              58       7  87.93%   106, 143-146, 172-177
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                                                 2       0  100.00%
tidy3d/components/__init__.py                                     0       0  100.00%
tidy3d/components/apodization.py                                 44       0  100.00%
tidy3d/components/base.py                                       498      12  97.59%   83, 90, 365, 418-419, 868, 1024, 1160-1164
tidy3d/components/bc_placement.py                                30       2  93.33%   51, 74
tidy3d/components/beam.py                                       190      23  87.89%   149, 291-293, 297-299, 313, 318-321, 327, 330-334, 342-348
tidy3d/components/boundary.py                                   191       2  98.95%   926-927
tidy3d/components/dispersion_fitter.py                          420      22  94.76%   103-109, 195, 270, 367, 441, 461-465, 585, 660-661, 693, 829, 857, 914-915, 940, 962
tidy3d/components/field_projection.py                           354      33  90.68%   111, 154, 223, 258, 338-341, 424-425, 437, 525, 529-556, 628-644, 802-808
tidy3d/components/file_util.py                                   21       0  100.00%
tidy3d/components/frequencies.py                                105      49  53.33%   51-65, 67-71, 74, 76, 78-104
tidy3d/components/lumped_element.py                             455       6  98.68%   551-555, 1034, 1084, 1118, 1156
tidy3d/components/medium.py                                    2357     153  93.51%   156, 161, 166, 676, 691, 787, 945, 1382, 1389-1400, 1699, 1712-1713, 1912, 2017, 2020, 2033, 2036, 2046, 2131-2144, 2207-2210, 2213-2216, 2232, 2234, 2238, 2299, 2305-2306, 2312, 2325, 2406, 2438, 2494, 2811, 2821, 2861, 2914, 2923-2924, 3077, 3264, 3340, 3501, 3505, 3523, 3536, 3602, 3637, 3654, 3769-3773, 3873, 3891, 3896, 3899, 4042-4047, 4209, 4296, 4298, 4300, 4325, 4330, 4386, 4578, 4580, 4644-4648, 4700, 4705, 4710, 4715, 4875, 4877, 4903-4907, 4959, 4964, 4969, 5028, 5031, 5132, 5134, 5175-5179, 5231, 5236, 5241, 5570, 5624, 5632, 5670-5688, 5835, 6097-6099, 6134-6135, 6202-6216, 6322, 6427, 6680, 6898, 7113, 7245, 7423, 7432-7435
tidy3d/components/mode_spec.py                                   63       1  98.41%   213
tidy3d/components/monitor.py                                    360      25  93.06%   75, 83, 263, 310-319, 373, 402-405, 426, 537-538, 767, 774-776, 818, 828, 870, 1003
tidy3d/components/parameter_perturbation.py                     438      28  93.61%   11-12, 1547, 1570-1596, 1604-1624, 1782
tidy3d/components/run_time_spec.py                                6       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, 1134-1213, 1248, 1279, 1290, 1429-1435, 1502, 1533-1534, 1576, 1590-1596, 1614, 1627, 1709-1715, 1807, 1821-1854, 1873-1928
tidy3d/components/simulation.py                                1752     107  93.89%   15-16, 137-138, 202, 210, 218, 359, 368, 404, 421, 436, 770-774, 822-826, 1045-1056, 1384, 1543, 1549, 1590, 1595, 1607, 1680-1686, 1746, 2942, 3170, 3219, 3280, 3309, 3317, 3330, 3373, 3392, 3411-3420, 3446, 3454, 3515, 3577, 3604, 3683, 3807, 4132, 4157, 4293-4294, 4299, 4427-4431, 4448, 4618-4623, 4665, 4731-4732, 4793, 4798, 4802-4854, 4878, 4917-4919, 4957-4958, 4988, 5098, 5104-5115, 5149, 5170
tidy3d/components/structure.py                                  223      17  92.38%   38-39, 125, 268, 300, 323, 353, 504-508, 562-563, 592, 598, 613, 623, 719
tidy3d/components/subpixel_spec.py                               44       2  95.45%   202, 206
tidy3d/components/time.py                                        75       2  97.33%   79, 89
tidy3d/components/time_modulation.py                             93       0  100.00%
tidy3d/components/transformation.py                              83       5  93.98%   69, 103, 154, 172, 188
tidy3d/components/type_util.py                                    6       1  83.33%   12
tidy3d/components/types.py                                      163      12  92.64%   12-13, 34-36, 63-67, 86, 170
tidy3d/components/types_extra.py                                  7       1  85.71%   14
tidy3d/components/validators.py                                 220      10  95.45%   63, 130-137, 256, 272, 364
tidy3d/components/autograd/__init__.py                            6       0  100.00%
tidy3d/components/autograd/boxes.py                              59      11  81.36%   31, 72, 79, 87-88, 92, 95-96, 134, 142, 147
tidy3d/components/autograd/derivative_utils.py                  123       5  95.93%   207, 215, 222, 227, 309
tidy3d/components/autograd/functions.py                          63       0  100.00%
tidy3d/components/autograd/types.py                              28       0  100.00%
tidy3d/components/autograd/utils.py                              11       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                        161       5  96.89%   605-609, 671-675, 700
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                            430      21  95.12%   78, 85, 131, 156-167, 252-256, 260-263, 377-382, 386-394, 588, 613
tidy3d/components/data/dataset.py                               181       4  97.79%   295, 397-400
tidy3d/components/data/monitor_data.py                         1365      58  95.75%   117, 169, 179, 321, 446, 457, 491, 635-647, 658, 805, 851, 1184-1185, 1189-1190, 1204, 1374, 1628, 1747, 1764, 2049, 2058, 2072-2073, 2191, 2199-2210, 2269, 2499, 2578, 2591, 2714, 3077, 3196, 3218-3219, 3385, 3419, 3633-3634, 3741
tidy3d/components/data/sim_data.py                              419      24  94.27%   303, 349, 396, 401, 418, 427, 521, 529, 562, 566, 613, 625, 636, 936, 982, 1047, 1054, 1063, 1090, 1292, 1294, 1298, 1317-1318
tidy3d/components/data/utils.py                                  46       4  91.30%   40, 51, 72, 80
tidy3d/components/data/validators.py                             43       1  97.67%   53
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, 217, 331, 350
tidy3d/components/data/unstructured/triangular.py               194      11  94.33%   13-14, 148, 165, 295, 356, 486-487, 490, 506, 525
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%   251-256, 279-282
tidy3d/components/geometry/__init__.py                            0       0  100.00%
tidy3d/components/geometry/base.py                             1031      81  92.14%   17-18, 132, 556-559, 584, 588, 713-722, 788, 1247-1251, 1265-1268, 1389-1393, 1431-1432, 1445, 1460, 1462, 1468-1472, 1477, 1483, 1489, 1495, 1501, 1506, 1510, 1516, 1814, 1860-1864, 2063, 2292-2321, 2732, 2890, 2901, 2928-2932, 2980, 3034-3036, 3136, 3287
tidy3d/components/geometry/bound_ops.py                          29       0  100.00%
tidy3d/components/geometry/mesh.py                              255      23  90.98%   82, 200, 212-214, 253, 295, 299, 354, 358, 376, 503, 550-554, 609-623
tidy3d/components/geometry/polyslab.py                          783      35  95.53%   113, 348-354, 472, 602, 628, 970-975, 1147, 1176, 1179, 1356-1365, 1441, 1524-1547, 1566, 1928, 1987
tidy3d/components/geometry/primitives.py                        318      67  78.93%   98, 254, 318, 321, 331-334, 364, 395-468
tidy3d/components/geometry/triangulation.py                      64       2  96.88%   135, 149
tidy3d/components/geometry/utils.py                             184       6  96.74%   65, 275, 293, 296-299
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                          77       0  100.00%
tidy3d/components/grid/grid.py                                  209      10  95.22%   142, 252-258, 597, 701
tidy3d/components/grid/grid_spec.py                             759      21  97.23%   211, 229-232, 666, 764, 1418-1420, 1425-1426, 1440, 1485, 1487, 1495, 1510, 2585-2589, 2663, 2671
tidy3d/components/grid/mesher.py                                484      10  97.93%   813, 907, 996, 998, 1000, 1066, 1115, 1194, 1266, 1317
tidy3d/components/material/__init__.py                            0       0  100.00%
tidy3d/components/material/multi_physics.py                      34       0  100.00%
tidy3d/components/material/solver_types.py                       10       0  100.00%
tidy3d/components/material/types.py                               6       0  100.00%
tidy3d/components/material/tcad/__init__.py                       0       0  100.00%
tidy3d/components/material/tcad/charge.py                        30       3  90.00%   37, 40, 43
tidy3d/components/material/tcad/heat.py                          35       0  100.00%
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                 52       0  100.00%
tidy3d/components/microwave/formulas/__init__.py                  0       0  100.00%
tidy3d/components/microwave/formulas/circuit_parameters.py       35       0  100.00%
tidy3d/components/mode/__init__.py                                0       0  100.00%
tidy3d/components/mode/derivatives.py                           128       2  98.44%   173, 230
tidy3d/components/mode/mode_solver.py                           878     233  73.46%   74-76, 105, 183-184, 194, 209, 255-257, 341-344, 375, 429, 459-465, 470-541, 549-555, 561-599, 605-609, 643-725, 845-966, 971-978, 986-990, 995-1028, 1039-1041, 1109, 1285-1289, 1342-1354, 1437, 1490, 1562, 1680, 1695, 1700-1702, 1707-1713, 1721-1727, 1738, 1740, 1749, 1820, 2263, 2325-2327, 2490
tidy3d/components/mode/simulation.py                            127       6  95.28%   220-227
tidy3d/components/mode/solver.py                                416      72  82.69%   118, 125, 141-142, 147-152, 165, 240, 250-251, 257, 281, 393, 479-485, 503, 510-512, 551-552, 561-591, 598-604, 651, 654, 896, 920, 977, 988, 1002, 1007-1020, 1028-1034, 1039, 1047
tidy3d/components/mode/transforms.py                             32       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%   94-101
tidy3d/components/source/current.py                              33       0  100.00%
tidy3d/components/source/field.py                               175      13  92.57%   124, 456-461, 526-532, 542
tidy3d/components/source/time.py                                147       9  93.88%   170-171, 184-186, 261, 364, 400, 432
tidy3d/components/source/utils.py                                 5       0  100.00%
tidy3d/components/spice/__init__.py                               0       0  100.00%
tidy3d/components/spice/types.py                                  4       0  100.00%
tidy3d/components/spice/analysis/__init__.py                      0       0  100.00%
tidy3d/components/spice/analysis/dc.py                           14       0  100.00%
tidy3d/components/spice/sources/__init__.py                       0       0  100.00%
tidy3d/components/spice/sources/dc.py                            21       0  100.00%
tidy3d/components/spice/sources/types.py                          5       0  100.00%
tidy3d/components/tcad/__init__.py                                0       0  100.00%
tidy3d/components/tcad/bandgap.py                                 9       0  100.00%
tidy3d/components/tcad/doping.py                                124      29  76.61%   21-28, 36-38, 51, 56-58, 63-64, 122-133, 232-235, 319
tidy3d/components/tcad/generation_recombination.py               22       0  100.00%
tidy3d/components/tcad/grid.py                                   60      10  83.33%   106-108, 113-115, 145-149
tidy3d/components/tcad/mobility.py                               14       0  100.00%
tidy3d/components/tcad/types.py                                  17       0  100.00%
tidy3d/components/tcad/viz.py                                    11       0  100.00%
tidy3d/components/tcad/analysis/__init__.py                       0       0  100.00%
tidy3d/components/tcad/analysis/heat_simulation_type.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%   212, 226, 232, 242, 277-280, 285, 308
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                 34       0  100.00%
tidy3d/components/tcad/monitors/__init__.py                       0       0  100.00%
tidy3d/components/tcad/monitors/abstract.py                      12       2  83.33%   38-39
tidy3d/components/tcad/monitors/charge.py                        11       0  100.00%
tidy3d/components/tcad/monitors/heat.py                           5       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                619     100  83.84%   14-15, 336-337, 572, 606, 628-629, 712, 802-804, 811, 824, 952, 964, 1045-1057, 1123-1124, 1129, 1144-1156, 1162-1164, 1222, 1245-1259, 1266-1268, 1271, 1285, 1291-1299, 1346-1364, 1384, 1502, 1507-1508, 1531, 1567-1568, 1586-1600, 1612-1619, 1664, 1680-1681, 1685, 1692, 1706, 1713, 1720
tidy3d/components/tcad/source/__init__.py                         0       0  100.00%
tidy3d/components/tcad/source/abstract.py                        20       1  95.00%   23
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                                10       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                      4       4  0.00%    1-1823
tidy3d/components/viz/flex_style.py                              27      11  59.26%   21-25, 39-40, 43-46
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                                  17       2  88.24%   7-8
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                     188       8  95.74%   86, 92, 95, 154, 157, 173, 224, 2081
tidy3d/material_library/material_reference.py                    10       0  100.00%
tidy3d/material_library/parametric_materials.py                 159       3  98.11%   20-21, 253
tidy3d/material_library/util.py                                 131      53  59.54%   51-52, 98, 114-121, 127-139, 192-207, 213-251
tidy3d/plugins/__init__.py                                        0       0  100.00%
tidy3d/plugins/adjoint/__init__.py                               16       2  87.50%   10-11
tidy3d/plugins/adjoint/web.py                                   287      55  80.84%   72, 77, 226-240, 246-255, 283-285, 321-324, 338-349, 363-377, 566-582, 596-621
tidy3d/plugins/adjoint/components/__init__.py                    10       0  100.00%
tidy3d/plugins/adjoint/components/base.py                       141       0  100.00%
tidy3d/plugins/adjoint/components/geometry.py                   379      16  95.78%   77, 228, 347, 538, 590, 634-636, 685, 860, 868-871, 970, 973, 978
tidy3d/plugins/adjoint/components/medium.py                     175       2  98.86%   300, 439
tidy3d/plugins/adjoint/components/simulation.py                 301       9  97.01%   227-228, 243-248, 328, 615-616, 723-724
tidy3d/plugins/adjoint/components/structure.py                   98       1  98.98%   167
tidy3d/plugins/adjoint/components/types.py                       22       2  90.91%   37-41
tidy3d/plugins/adjoint/components/data/__init__.py                0       0  100.00%
tidy3d/plugins/adjoint/components/data/data_array.py            296      26  91.22%   77, 227, 247-252, 289, 338, 388, 399-409, 413-418, 452-453
tidy3d/plugins/adjoint/components/data/dataset.py                12       0  100.00%
tidy3d/plugins/adjoint/components/data/monitor_data.py          198       8  95.96%   165, 191, 199, 232, 238, 243, 256, 429
tidy3d/plugins/adjoint/components/data/sim_data.py              122       4  96.72%   157, 257-259
tidy3d/plugins/adjoint/utils/__init__.py                          0       0  100.00%
tidy3d/plugins/adjoint/utils/filter.py                           78       1  98.72%   55
tidy3d/plugins/adjoint/utils/penalty.py                         100       3  97.00%   238, 244, 276
tidy3d/plugins/autograd/__init__.py                               7       0  100.00%
tidy3d/plugins/autograd/constants.py                              3       0  100.00%
tidy3d/plugins/autograd/differential_operators.py                27       0  100.00%
tidy3d/plugins/autograd/functions.py                            148       6  95.95%   55, 61, 275, 282, 329, 336
tidy3d/plugins/autograd/types.py                                  4       0  100.00%
tidy3d/plugins/autograd/utilities.py                             73       4  94.52%   208, 225-226, 240
tidy3d/plugins/autograd/invdes/__init__.py                        7       0  100.00%
tidy3d/plugins/autograd/invdes/filters.py                        67       3  95.52%   53-54, 203
tidy3d/plugins/autograd/invdes/misc.py                            5       1  80.00%   25
tidy3d/plugins/autograd/invdes/parametrizations.py               26       0  100.00%
tidy3d/plugins/autograd/invdes/penalties.py                      60      21  65.00%   87, 139-141, 165-169, 190-192, 229-238
tidy3d/plugins/autograd/invdes/projections.py                    15       5  66.67%   32-36, 69
tidy3d/plugins/autograd/primitives/__init__.py                    4       0  100.00%
tidy3d/plugins/autograd/primitives/interpolate.py               263       4  98.48%   17, 616, 644, 680
tidy3d/plugins/autograd/primitives/misc.py                        5       0  100.00%
tidy3d/plugins/design/__init__.py                                 6       0  100.00%
tidy3d/plugins/design/design.py                                 227       4  98.24%   107, 143-144, 374
tidy3d/plugins/design/method.py                                 316       1  99.68%   69
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                             5       0  100.00%
tidy3d/plugins/dispersion/fit.py                                271      16  94.10%   170, 315-322, 420, 500, 508, 523, 530-533, 664-665, 739, 741
tidy3d/plugins/dispersion/fit_fast.py                            38       1  97.37%   149
tidy3d/plugins/dispersion/fit_web.py                              3       3  0.00%    3-7
tidy3d/plugins/dispersion/web.py                                109      23  78.90%   104, 229-232, 248-253, 278-294, 305-308, 351-355, 366-368
tidy3d/plugins/expressions/__init__.py                           20       0  100.00%
tidy3d/plugins/expressions/base.py                              133      49  63.16%   13, 42, 56, 59, 62, 87-89, 97-99, 102-103, 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                          37       1  97.30%   49
tidy3d/plugins/expressions/metrics.py                            46       2  95.65%   50, 93
tidy3d/plugins/expressions/operators.py                          65       2  96.92%   33, 63
tidy3d/plugins/expressions/types.py                              15       4  73.33%   10-24
tidy3d/plugins/expressions/variables.py                          27       1  96.30%   97
tidy3d/plugins/invdes/__init__.py                                10       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                          57       7  87.72%   56, 96, 103-106, 108, 115, 122
tidy3d/plugins/invdes/optimizer.py                               97       4  95.88%   99, 176, 222, 295
tidy3d/plugins/invdes/penalty.py                                 24       1  95.83%   32
tidy3d/plugins/invdes/region.py                                 172      14  91.86%   82, 102, 186-187, 194-195, 207, 215, 218, 224, 230, 240, 283-284
tidy3d/plugins/invdes/result.py                                  54       0  100.00%
tidy3d/plugins/invdes/transformation.py                          26       2  92.31%   25, 80
tidy3d/plugins/invdes/utils.py                                   37       0  100.00%
tidy3d/plugins/invdes/validators.py                              35       6  82.86%   18-29
tidy3d/plugins/microwave/__init__.py                             10       0  100.00%
tidy3d/plugins/microwave/array_factor.py                        276       2  99.28%   178, 186
tidy3d/plugins/microwave/auto_path_integrals.py                  25       0  100.00%
tidy3d/plugins/microwave/custom_path_integrals.py               135       1  99.26%   394
tidy3d/plugins/microwave/impedance_calculator.py                 48       0  100.00%
tidy3d/plugins/microwave/lobe_measurer.py                       155       0  100.00%
tidy3d/plugins/microwave/path_integrals.py                      263       4  98.48%   108, 185, 298, 419
tidy3d/plugins/microwave/rf_material_library.py                  17       0  100.00%
tidy3d/plugins/microwave/rf_material_reference.py                 3       0  100.00%
tidy3d/plugins/microwave/viz.py                                  18       0  100.00%
tidy3d/plugins/microwave/models/__init__.py                       3       0  100.00%
tidy3d/plugins/microwave/models/coupled_microstrip.py            49       0  100.00%
tidy3d/plugins/microwave/models/microstrip.py                    64       0  100.00%
tidy3d/plugins/mode/__init__.py                                   3       0  100.00%
tidy3d/plugins/mode/mode_solver.py                                7       0  100.00%
tidy3d/plugins/mode/web.py                                        3       0  100.00%
tidy3d/plugins/polyslab/__init__.py                               3       0  100.00%
tidy3d/plugins/polyslab/polyslab.py                               7       0  100.00%
tidy3d/plugins/pytorch/__init__.py                                3       0  100.00%
tidy3d/plugins/pytorch/wrapper.py                                39       1  97.44%   66
tidy3d/plugins/resonance/__init__.py                              3       0  100.00%
tidy3d/plugins/resonance/resonance.py                           172      10  94.19%   110, 139, 184, 203-204, 218, 225, 248, 254, 281
tidy3d/plugins/smatrix/__init__.py                               11       0  100.00%
tidy3d/plugins/smatrix/smatrix.py                                 4       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%   136
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%   29-33, 56-60
tidy3d/plugins/smatrix/ports/__init__.py                          0       0  100.00%
tidy3d/plugins/smatrix/ports/base_lumped.py                      41       0  100.00%
tidy3d/plugins/smatrix/ports/base_terminal.py                    33       2  93.94%   49-53
tidy3d/plugins/smatrix/ports/coaxial_lumped.py                  165       0  100.00%
tidy3d/plugins/smatrix/ports/modal.py                            14       0  100.00%
tidy3d/plugins/smatrix/ports/rectangular_lumped.py              124       0  100.00%
tidy3d/plugins/smatrix/ports/wave.py                            109       2  98.17%   124, 182
tidy3d/plugins/waveguide/__init__.py                              3       0  100.00%
tidy3d/plugins/waveguide/rectangular_dielectric.py              369      80  78.32%   274, 327, 335, 338, 464-465, 613-635, 644-679, 682-700, 803, 808, 813, 849, 899, 935, 983, 1024, 1051-1090, 1142-1154
tidy3d/web/__init__.py                                           13       0  100.00%
tidy3d/web/environment.py                                         3       3  0.00%    3-7
tidy3d/web/api/__init__.py                                        0       0  100.00%
tidy3d/web/api/asynchronous.py                                   14       2  85.71%   67, 71
tidy3d/web/api/connect_util.py                                   44      18  59.09%   38-43, 50, 55-61, 66-72
tidy3d/web/api/container.py                                     336      36  89.29%   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                                21       1  95.24%   32
tidy3d/web/api/mode.py                                          208      66  68.27%   125-128, 133, 141, 195-198, 220, 222-231, 234-246, 342, 359, 402-405, 488-490, 494, 523-581, 615-618, 629-630, 668
tidy3d/web/api/tidy3d_stub.py                                   116      45  61.21%   71-74, 85, 109, 145, 180-203, 219, 237-263
tidy3d/web/api/webapi.py                                        349      73  79.08%   335, 365, 395, 433-451, 494-499, 513-518, 539, 548, 569, 596-599, 619-620, 701-709, 813-818, 864, 885, 918, 921-922, 979, 987-989, 1002, 1004, 1008, 1062, 1099, 1116-1124
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                                        3       0  100.00%
tidy3d/web/cli/app.py                                            66      35  46.97%   34-39, 59, 71-114, 120
tidy3d/web/cli/constants.py                                       9       1  88.89%   13
tidy3d/web/cli/migrate.py                                        46      35  23.91%   21-72
tidy3d/web/cli/develop/__init__.py                                8       0  100.00%
tidy3d/web/cli/develop/documentation.py                          78      54  30.77%   64-115, 144-163, 179-182, 226-230, 330-340
tidy3d/web/cli/develop/index.py                                   5       0  100.00%
tidy3d/web/cli/develop/install.py                               156     129  17.31%   38-46, 60-63, 75-98, 110-123, 140-151, 163-173, 183-184, 204-258, 283-285, 303-358, 374-375, 395-406
tidy3d/web/cli/develop/packaging.py                              35      18  48.57%   52-79, 112-118
tidy3d/web/cli/develop/tests.py                                  17       6  64.71%   29-32, 65-66
tidy3d/web/cli/develop/utils.py                                  15       6  60.00%   47-49, 68-70
tidy3d/web/core/__init__.py                                       0       0  100.00%
tidy3d/web/core/account.py                                       20       1  95.00%   66
tidy3d/web/core/cache.py                                          3       0  100.00%
tidy3d/web/core/constants.py                                     23       0  100.00%
tidy3d/web/core/core_config.py                                   13       0  100.00%
tidy3d/web/core/environment.py                                   59       8  86.44%   17, 101-108, 141, 152, 163
tidy3d/web/core/exceptions.py                                     9       0  100.00%
tidy3d/web/core/file_util.py                                     40      14  65.00%   23-25, 36-38, 44-51, 61
tidy3d/web/core/http_util.py                                    105      15  85.71%   37, 64, 70, 89, 99, 136-139, 158-160, 170, 178-179
tidy3d/web/core/s3utils.py                                      121      75  38.02%   51-52, 57-58, 63, 75, 102-103, 113, 137-138, 148, 159-164, 203-211, 240-279, 305-358, 386-417
tidy3d/web/core/stub.py                                          14       0  100.00%
tidy3d/web/core/task_core.py                                    185      31  83.24%   78-80, 193-199, 241, 295, 307, 315, 319, 337, 352, 375, 377, 417, 451, 481, 484, 521, 534-535, 546-547, 578, 601, 632, 657-660, 670
tidy3d/web/core/task_info.py                                     98       0  100.00%
tidy3d/web/core/types.py                                         38       1  97.37%   69
TOTAL                                                         34081    3100  90.90%

Diff against develop

Filename                                                      Stmts    Miss  Cover
----------------------------------------------------------  -------  ------  --------
tidy3d/__init__.py                                               +1       0  +100.00%
tidy3d/__main__.py                                               +1       0  +0.04%
tidy3d/compat.py                                                 +1       0  +6.67%
tidy3d/config.py                                                 +1       0  +100.00%
tidy3d/constants.py                                              +1       0  +100.00%
tidy3d/exceptions.py                                             +2       0  +100.00%
tidy3d/log.py                                                    +1       0  +0.05%
tidy3d/packaging.py                                              +1       0  +0.21%
tidy3d/version.py                                                +1       0  +100.00%
tidy3d/components/apodization.py                                 +1       0  +100.00%
tidy3d/components/beam.py                                         0      -1  +0.52%
tidy3d/components/field_projection.py                            +1       0  +0.03%
tidy3d/components/file_util.py                                   +1       0  +100.00%
tidy3d/components/frequencies.py                                 +1       0  +0.45%
tidy3d/components/medium.py                                      -2       0  +100.00%
tidy3d/components/mode_spec.py                                   +1       0  +0.02%
tidy3d/components/monitor.py                                     +1       0  +0.02%
tidy3d/components/run_time_spec.py                               +1       0  +100.00%
tidy3d/components/simulation.py                                  -3      -1  +0.04%
tidy3d/components/type_util.py                                   +1       0  +3.33%
tidy3d/components/types.py                                       +3       0  +0.14%
tidy3d/components/types_extra.py                                 +1       0  +2.38%
tidy3d/components/validators.py                                  +1       0  +0.02%
tidy3d/components/autograd/__init__.py                           +1       0  +100.00%
tidy3d/components/autograd/boxes.py                              +1       0  +0.33%
tidy3d/components/autograd/functions.py                          +1       0  +100.00%
tidy3d/components/autograd/types.py                              +1       0  +100.00%
tidy3d/components/autograd/utils.py                              +1       0  +100.00%
tidy3d/components/base_sim/simulation.py                         -1      -1  +0.59%
tidy3d/components/data/data_array.py                             +1       0  +0.02%
tidy3d/components/data/validators.py                             +2       0  +0.11%
tidy3d/components/geometry/bound_ops.py                          +1       0  +100.00%
tidy3d/components/grid/corner_finder.py                          +1       0  +100.00%
tidy3d/components/grid/grid_spec.py                             +16       0  +0.06%
tidy3d/components/grid/mesher.py                                 +1       0  +100.00%
tidy3d/components/material/multi_physics.py                      +1       0  +100.00%
tidy3d/components/material/solver_types.py                       +1       0  +100.00%
tidy3d/components/material/types.py                              +1       0  +100.00%
tidy3d/components/material/tcad/charge.py                        -1       0  -0.32%
tidy3d/components/microwave/data/monitor_data.py                 +1       0  +100.00%
tidy3d/components/microwave/formulas/circuit_parameters.py       +1       0  +100.00%
tidy3d/components/mode/derivatives.py                            +1       0  +0.01%
tidy3d/components/mode/solver.py                                 +2       0  +0.08%
tidy3d/components/mode/transforms.py                             +1       0  +100.00%
tidy3d/components/spice/types.py                                 +1       0  +100.00%
tidy3d/components/spice/analysis/dc.py                           +1       0  +100.00%
tidy3d/components/spice/sources/dc.py                            +1       0  +100.00%
tidy3d/components/spice/sources/types.py                         +1       0  +100.00%
tidy3d/components/tcad/bandgap.py                                +1       0  +100.00%
tidy3d/components/tcad/doping.py                                 +1       0  +0.19%
tidy3d/components/tcad/generation_recombination.py               +1       0  +100.00%
tidy3d/components/tcad/mobility.py                               +1       0  +100.00%
tidy3d/components/tcad/types.py                                  +1       0  +100.00%
tidy3d/components/tcad/viz.py                                    +1       0  +100.00%
tidy3d/components/tcad/analysis/heat_simulation_type.py          +1       0  +100.00%
tidy3d/components/tcad/monitors/abstract.py                      +1       0  +1.51%
tidy3d/components/tcad/monitors/charge.py                        +1       0  +100.00%
tidy3d/components/tcad/monitors/heat.py                          +1       0  +100.00%
tidy3d/components/tcad/source/abstract.py                        -1       0  -0.24%
tidy3d/components/viz/__init__.py                                +1       0  +100.00%
tidy3d/components/viz/flex_color_palettes.py                     +1      +1  +100.00%
tidy3d/components/viz/flex_style.py                              +1       0  +1.57%
tidy3d/components/viz/styles.py                                  +1       0  +0.74%
tidy3d/material_library/material_library.py                      +1       0  +0.02%
tidy3d/material_library/material_reference.py                    +1       0  +100.00%
tidy3d/plugins/adjoint/__init__.py                               +1       0  +0.83%
tidy3d/plugins/adjoint/web.py                                    +1       0  +0.07%
tidy3d/plugins/adjoint/components/__init__.py                    +1       0  +100.00%
tidy3d/plugins/adjoint/components/base.py                        -1       0  +100.00%
tidy3d/plugins/adjoint/components/types.py                       +1       0  +0.43%
tidy3d/plugins/adjoint/components/data/data_array.py             +1       0  +0.03%
tidy3d/plugins/adjoint/components/data/dataset.py                +1       0  +100.00%
tidy3d/plugins/adjoint/utils/filter.py                           +1       0  +0.02%
tidy3d/plugins/adjoint/utils/penalty.py                          +2       0  +0.06%
tidy3d/plugins/autograd/__init__.py                              +1       0  +100.00%
tidy3d/plugins/autograd/constants.py                             +1       0  +100.00%
tidy3d/plugins/autograd/differential_operators.py                +1       0  +100.00%
tidy3d/plugins/autograd/functions.py                             +2       0  +0.06%
tidy3d/plugins/autograd/types.py                                 +1       0  +100.00%
tidy3d/plugins/autograd/utilities.py                             +2       0  +0.15%
tidy3d/plugins/autograd/invdes/__init__.py                       +1       0  +100.00%
tidy3d/plugins/autograd/invdes/filters.py                        +1       0  +0.07%
tidy3d/plugins/autograd/invdes/misc.py                           +1       0  +5.00%
tidy3d/plugins/autograd/invdes/penalties.py                      +1       0  +0.59%
tidy3d/plugins/autograd/invdes/projections.py                    +1       0  +2.38%
tidy3d/plugins/autograd/primitives/__init__.py                   +1       0  +100.00%
tidy3d/plugins/autograd/primitives/interpolate.py                +1       0  +0.01%
tidy3d/plugins/autograd/primitives/misc.py                       +1       0  +100.00%
tidy3d/plugins/design/__init__.py                                +1       0  +100.00%
tidy3d/plugins/design/method.py                                  +1       0  +100.00%
tidy3d/plugins/dispersion/__init__.py                            +1       0  +100.00%
tidy3d/plugins/dispersion/fit.py                                  0      +3  -1.10%
tidy3d/plugins/dispersion/fit_web.py                             +1      +1  +100.00%
tidy3d/plugins/dispersion/web.py                                 +4      +2  -1.10%
tidy3d/plugins/expressions/__init__.py                           +1       0  +100.00%
tidy3d/plugins/expressions/base.py                               +1       0  +0.28%
tidy3d/plugins/expressions/functions.py                          +1       0  +0.08%
tidy3d/plugins/expressions/metrics.py                            +1       0  +0.09%
tidy3d/plugins/expressions/types.py                              +1       0  +1.90%
tidy3d/plugins/expressions/variables.py                          +1       0  +0.15%
tidy3d/plugins/invdes/__init__.py                                +1       0  +100.00%
tidy3d/plugins/invdes/initialization.py                          -1      -1  +1.51%
tidy3d/plugins/invdes/optimizer.py                               +1       0  +0.05%
tidy3d/plugins/invdes/penalty.py                                 +1       0  +0.18%
tidy3d/plugins/invdes/region.py                                  +1       0  +0.05%
tidy3d/plugins/invdes/result.py                                  +1       0  +100.00%
tidy3d/plugins/invdes/transformation.py                          +1       0  +0.31%
tidy3d/plugins/invdes/utils.py                                   +1       0  +100.00%
tidy3d/plugins/invdes/validators.py                              +1       0  +0.51%
tidy3d/plugins/microwave/__init__.py                             +1       0  +100.00%
tidy3d/plugins/microwave/array_factor.py                         +3       0  +0.01%
tidy3d/plugins/microwave/auto_path_integrals.py                  +1       0  +100.00%
tidy3d/plugins/microwave/lobe_measurer.py                        +1       0  +100.00%
tidy3d/plugins/microwave/path_integrals.py                       -1       0  +100.00%
tidy3d/plugins/microwave/rf_material_library.py                  +1       0  +100.00%
tidy3d/plugins/microwave/rf_material_reference.py                +1       0  +100.00%
tidy3d/plugins/microwave/viz.py                                  +1       0  +100.00%
tidy3d/plugins/microwave/models/__init__.py                      +1       0  +100.00%
tidy3d/plugins/microwave/models/coupled_microstrip.py            +1       0  +100.00%
tidy3d/plugins/microwave/models/microstrip.py                    +1       0  +100.00%
tidy3d/plugins/mode/__init__.py                                  +1       0  +100.00%
tidy3d/plugins/mode/web.py                                       +1       0  +100.00%
tidy3d/plugins/polyslab/__init__.py                              +1       0  +100.00%
tidy3d/plugins/polyslab/polyslab.py                              +1       0  +100.00%
tidy3d/plugins/pytorch/__init__.py                               +1       0  +100.00%
tidy3d/plugins/pytorch/wrapper.py                                +1       0  +0.07%
tidy3d/plugins/resonance/__init__.py                             +1       0  +100.00%
tidy3d/plugins/resonance/resonance.py                            +1       0  +0.04%
tidy3d/plugins/smatrix/__init__.py                               +1       0  +100.00%
tidy3d/plugins/smatrix/smatrix.py                                +1       0  +100.00%
tidy3d/plugins/smatrix/ports/base_lumped.py                      +1       0  +100.00%
tidy3d/plugins/smatrix/ports/base_terminal.py                    +1       0  +0.19%
tidy3d/plugins/smatrix/ports/coaxial_lumped.py                   +2       0  +100.00%
tidy3d/plugins/smatrix/ports/modal.py                            +1       0  +100.00%
tidy3d/plugins/smatrix/ports/rectangular_lumped.py               +2       0  +100.00%
tidy3d/plugins/smatrix/ports/wave.py                             +1       0  +0.02%
tidy3d/plugins/waveguide/__init__.py                             +1       0  +100.00%
tidy3d/web/__init__.py                                           +1       0  +100.00%
tidy3d/web/environment.py                                        +1      +1  +100.00%
tidy3d/web/api/asynchronous.py                                   +1       0  +1.09%
tidy3d/web/api/connect_util.py                                   +1       0  +0.95%
tidy3d/web/api/container.py                                      -1      -1  +0.27%
tidy3d/web/api/material_libray.py                                +1       0  +0.24%
tidy3d/web/api/mode.py                                           -1       0  -0.15%
tidy3d/web/api/webapi.py                                         -8      -1  -0.19%
tidy3d/web/cli/__init__.py                                       +1       0  +100.00%
tidy3d/web/cli/app.py                                            +1       0  +0.82%
tidy3d/web/cli/constants.py                                      +1       0  +1.39%
tidy3d/web/cli/migrate.py                                        +1       0  +1.69%
tidy3d/web/cli/develop/__init__.py                               +1       0  +100.00%
tidy3d/web/cli/develop/documentation.py                          +1       0  +0.90%
tidy3d/web/cli/develop/index.py                                   0      -1  +20.00%
tidy3d/web/cli/develop/install.py                                -3      -4  +0.96%
tidy3d/web/cli/develop/packaging.py                              +1       0  +1.51%
tidy3d/web/cli/develop/tests.py                                  +1       0  +2.21%
tidy3d/web/cli/develop/utils.py                                  +1       0  +2.86%
tidy3d/web/core/cache.py                                         +1       0  +100.00%
tidy3d/web/core/constants.py                                     +1       0  +100.00%
tidy3d/web/core/core_config.py                                   +1       0  +100.00%
tidy3d/web/core/environment.py                                   +1       0  +0.23%
tidy3d/web/core/exceptions.py                                    +1       0  +100.00%
tidy3d/web/core/file_util.py                                     +1       0  +0.90%
tidy3d/web/core/http_util.py                                      0      -2  +1.90%
tidy3d/web/core/s3utils.py                                       +2       0  +1.05%
tidy3d/web/core/stub.py                                          -5      -5  +26.32%
tidy3d/web/core/task_core.py                                     +2       0  +0.18%
tidy3d/web/core/task_info.py                                     +1       0  +100.00%
TOTAL                                                          +153     -10  +0.07%

Results for commit: d114688

Minimum allowed coverage is 90%

♻️ This comment has been updated with latest results

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 24, 2025

badge

Changed Files Coverage

Filename                                                      Stmts    Miss  Cover    Missing
----------------------------------------------------------  -------  ------  -------  ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
tidy3d/__init__.py                                               78       0  100.00%
tidy3d/__main__.py                                               52       1  98.08%   115
tidy3d/compat.py                                                  6       2  66.67%   7-8
tidy3d/config.py                                                 22       0  100.00%
tidy3d/constants.py                                              91       0  100.00%
tidy3d/exceptions.py                                             18       0  100.00%
tidy3d/log.py                                                   190      19  90.00%   55, 92-93, 219, 228, 301, 305, 371, 409, 413-418, 422, 426-428, 445
tidy3d/packaging.py                                              58       7  87.93%   106, 143-146, 172-177
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                                                 2       0  100.00%
tidy3d/components/apodization.py                                 44       0  100.00%
tidy3d/components/base.py                                       498      12  97.59%   83, 90, 365, 418-419, 868, 1024, 1160-1164
tidy3d/components/bc_placement.py                                30       2  93.33%   51, 74
tidy3d/components/beam.py                                       190      23  87.89%   149, 291-293, 297-299, 313, 318-321, 327, 330-334, 342-348
tidy3d/components/boundary.py                                   191       2  98.95%   926-927
tidy3d/components/dispersion_fitter.py                          420      22  94.76%   103-109, 195, 270, 367, 441, 461-465, 585, 660-661, 693, 829, 857, 914-915, 940, 962
tidy3d/components/field_projection.py                           354      33  90.68%   111, 154, 223, 258, 338-341, 424-425, 437, 525, 529-556, 628-644, 802-808
tidy3d/components/file_util.py                                   21       0  100.00%
tidy3d/components/frequencies.py                                105      49  53.33%   51-65, 67-71, 74, 76, 78-104
tidy3d/components/lumped_element.py                             455       6  98.68%   551-555, 1034, 1084, 1118, 1156
tidy3d/components/medium.py                                    2357     153  93.51%   156, 161, 166, 676, 691, 787, 945, 1382, 1389-1400, 1699, 1712-1713, 1912, 2017, 2020, 2033, 2036, 2046, 2131-2144, 2207-2210, 2213-2216, 2232, 2234, 2238, 2299, 2305-2306, 2312, 2325, 2406, 2438, 2494, 2811, 2821, 2861, 2914, 2923-2924, 3077, 3264, 3340, 3501, 3505, 3523, 3536, 3602, 3637, 3654, 3769-3773, 3873, 3891, 3896, 3899, 4042-4047, 4209, 4296, 4298, 4300, 4325, 4330, 4386, 4578, 4580, 4644-4648, 4700, 4705, 4710, 4715, 4875, 4877, 4903-4907, 4959, 4964, 4969, 5028, 5031, 5132, 5134, 5175-5179, 5231, 5236, 5241, 5570, 5624, 5632, 5670-5688, 5835, 6097-6099, 6134-6135, 6202-6216, 6322, 6427, 6680, 6898, 7113, 7245, 7423, 7432-7435
tidy3d/components/mode_spec.py                                   63       1  98.41%   213
tidy3d/components/monitor.py                                    360      25  93.06%   75, 83, 263, 310-319, 373, 402-405, 426, 537-538, 767, 774-776, 818, 828, 870, 1003
tidy3d/components/parameter_perturbation.py                     438      28  93.61%   11-12, 1547, 1570-1596, 1604-1624, 1782
tidy3d/components/run_time_spec.py                                6       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, 1134-1213, 1248, 1279, 1290, 1429-1435, 1502, 1533-1534, 1576, 1590-1596, 1614, 1627, 1709-1715, 1807, 1821-1854, 1873-1928
tidy3d/components/simulation.py                                1752     107  93.89%   15-16, 137-138, 202, 210, 218, 359, 368, 404, 421, 436, 770-774, 822-826, 1045-1056, 1384, 1543, 1549, 1590, 1595, 1607, 1680-1686, 1746, 2942, 3170, 3219, 3280, 3309, 3317, 3330, 3373, 3392, 3411-3420, 3446, 3454, 3515, 3577, 3604, 3683, 3807, 4132, 4157, 4293-4294, 4299, 4427-4431, 4448, 4618-4623, 4665, 4731-4732, 4793, 4798, 4802-4854, 4878, 4917-4919, 4957-4958, 4988, 5098, 5104-5115, 5149, 5170
tidy3d/components/structure.py                                  223      17  92.38%   38-39, 125, 268, 300, 323, 353, 504-508, 562-563, 592, 598, 613, 623, 719
tidy3d/components/time.py                                        75       2  97.33%   79, 89
tidy3d/components/time_modulation.py                             93       0  100.00%
tidy3d/components/transformation.py                              83       5  93.98%   69, 103, 154, 172, 188
tidy3d/components/type_util.py                                    6       1  83.33%   12
tidy3d/components/types.py                                      163      12  92.64%   12-13, 34-36, 63-67, 86, 170
tidy3d/components/types_extra.py                                  7       1  85.71%   14
tidy3d/components/validators.py                                 220      10  95.45%   63, 130-137, 256, 272, 364
tidy3d/components/autograd/__init__.py                            6       0  100.00%
tidy3d/components/autograd/boxes.py                              59      11  81.36%   31, 72, 79, 87-88, 92, 95-96, 134, 142, 147
tidy3d/components/autograd/derivative_utils.py                  123       5  95.93%   207, 215, 222, 227, 309
tidy3d/components/autograd/functions.py                          63       0  100.00%
tidy3d/components/autograd/types.py                              28       0  100.00%
tidy3d/components/autograd/utils.py                              11       0  100.00%
tidy3d/components/base_sim/monitor.py                            33       0  100.00%
tidy3d/components/base_sim/simulation.py                        161       5  96.89%   605-609, 671-675, 700
tidy3d/components/base_sim/source.py                             11       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/data_array.py                            430      21  95.12%   78, 85, 131, 156-167, 252-256, 260-263, 377-382, 386-394, 588, 613
tidy3d/components/data/dataset.py                               181       4  97.79%   295, 397-400
tidy3d/components/data/monitor_data.py                         1365      58  95.75%   117, 169, 179, 321, 446, 457, 491, 635-647, 658, 805, 851, 1184-1185, 1189-1190, 1204, 1374, 1628, 1747, 1764, 2049, 2058, 2072-2073, 2191, 2199-2210, 2269, 2499, 2578, 2591, 2714, 3077, 3196, 3218-3219, 3385, 3419, 3633-3634, 3741
tidy3d/components/data/sim_data.py                              419      24  94.27%   303, 349, 396, 401, 418, 427, 521, 529, 562, 566, 613, 625, 636, 936, 982, 1047, 1054, 1063, 1090, 1292, 1294, 1298, 1317-1318
tidy3d/components/data/utils.py                                  46       4  91.30%   40, 51, 72, 80
tidy3d/components/data/validators.py                             43       1  97.67%   53
tidy3d/components/data/zbf.py                                    50       4  92.00%   118-119, 130-131
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, 217, 331, 350
tidy3d/components/data/unstructured/triangular.py               194      11  94.33%   13-14, 148, 165, 295, 356, 486-487, 490, 506, 525
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/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%   251-256, 279-282
tidy3d/components/geometry/base.py                             1031      81  92.14%   17-18, 132, 556-559, 584, 588, 713-722, 788, 1247-1251, 1265-1268, 1389-1393, 1431-1432, 1445, 1460, 1462, 1468-1472, 1477, 1483, 1489, 1495, 1501, 1506, 1510, 1516, 1814, 1860-1864, 2063, 2292-2321, 2732, 2890, 2901, 2928-2932, 2980, 3034-3036, 3136, 3287
tidy3d/components/geometry/bound_ops.py                          29       0  100.00%
tidy3d/components/geometry/mesh.py                              255      23  90.98%   82, 200, 212-214, 253, 295, 299, 354, 358, 376, 503, 550-554, 609-623
tidy3d/components/geometry/polyslab.py                          783      35  95.53%   113, 348-354, 472, 602, 628, 970-975, 1147, 1176, 1179, 1356-1365, 1441, 1524-1547, 1566, 1928, 1987
tidy3d/components/geometry/primitives.py                        318      67  78.93%   98, 254, 318, 321, 331-334, 364, 395-468
tidy3d/components/geometry/triangulation.py                      64       2  96.88%   135, 149
tidy3d/components/geometry/utils.py                             184       6  96.74%   65, 275, 293, 296-299
tidy3d/components/geometry/utils_2d.py                          103       0  100.00%
tidy3d/components/grid/corner_finder.py                          77       0  100.00%
tidy3d/components/grid/grid.py                                  209      10  95.22%   142, 252-258, 597, 701
tidy3d/components/grid/grid_spec.py                             759      21  97.23%   211, 229-232, 666, 764, 1418-1420, 1425-1426, 1440, 1485, 1487, 1495, 1510, 2585-2589, 2663, 2671
tidy3d/components/grid/mesher.py                                484      10  97.93%   813, 907, 996, 998, 1000, 1066, 1115, 1194, 1266, 1317
tidy3d/components/material/multi_physics.py                      34       0  100.00%
tidy3d/components/material/solver_types.py                       10       0  100.00%
tidy3d/components/material/types.py                               6       0  100.00%
tidy3d/components/material/tcad/charge.py                        30       3  90.00%   37, 40, 43
tidy3d/components/microwave/data/monitor_data.py                 52       0  100.00%
tidy3d/components/microwave/formulas/circuit_parameters.py       35       0  100.00%
tidy3d/components/mode/derivatives.py                           128       2  98.44%   173, 230
tidy3d/components/mode/mode_solver.py                           878     233  73.46%   74-76, 105, 183-184, 194, 209, 255-257, 341-344, 375, 429, 459-465, 470-541, 549-555, 561-599, 605-609, 643-725, 845-966, 971-978, 986-990, 995-1028, 1039-1041, 1109, 1285-1289, 1342-1354, 1437, 1490, 1562, 1680, 1695, 1700-1702, 1707-1713, 1721-1727, 1738, 1740, 1749, 1820, 2263, 2325-2327, 2490
tidy3d/components/mode/simulation.py                            127       6  95.28%   220-227
tidy3d/components/mode/solver.py                                416      72  82.69%   118, 125, 141-142, 147-152, 165, 240, 250-251, 257, 281, 393, 479-485, 503, 510-512, 551-552, 561-591, 598-604, 651, 654, 896, 920, 977, 988, 1002, 1007-1020, 1028-1034, 1039, 1047
tidy3d/components/mode/transforms.py                             32       0  100.00%
tidy3d/components/mode/data/sim_data.py                          18       0  100.00%
tidy3d/components/source/base.py                                 53       6  88.68%   94-101
tidy3d/components/source/current.py                              33       0  100.00%
tidy3d/components/source/field.py                               175      13  92.57%   124, 456-461, 526-532, 542
tidy3d/components/source/time.py                                147       9  93.88%   170-171, 184-186, 261, 364, 400, 432
tidy3d/components/spice/types.py                                  4       0  100.00%
tidy3d/components/spice/analysis/dc.py                           14       0  100.00%
tidy3d/components/spice/sources/dc.py                            21       0  100.00%
tidy3d/components/spice/sources/types.py                          5       0  100.00%
tidy3d/components/tcad/bandgap.py                                 9       0  100.00%
tidy3d/components/tcad/doping.py                                124      29  76.61%   21-28, 36-38, 51, 56-58, 63-64, 122-133, 232-235, 319
tidy3d/components/tcad/generation_recombination.py               22       0  100.00%
tidy3d/components/tcad/grid.py                                   60      10  83.33%   106-108, 113-115, 145-149
tidy3d/components/tcad/mobility.py                               14       0  100.00%
tidy3d/components/tcad/types.py                                  17       0  100.00%
tidy3d/components/tcad/viz.py                                    11       0  100.00%
tidy3d/components/tcad/analysis/heat_simulation_type.py          10       0  100.00%
tidy3d/components/tcad/data/sim_data.py                         102       9  91.18%   212, 226, 232, 242, 277-280, 285, 308
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                 34       0  100.00%
tidy3d/components/tcad/monitors/abstract.py                      12       2  83.33%   38-39
tidy3d/components/tcad/monitors/charge.py                        11       0  100.00%
tidy3d/components/tcad/monitors/heat.py                           5       0  100.00%
tidy3d/components/tcad/simulation/heat.py                        21       0  100.00%
tidy3d/components/tcad/simulation/heat_charge.py                619     100  83.84%   14-15, 336-337, 572, 606, 628-629, 712, 802-804, 811, 824, 952, 964, 1045-1057, 1123-1124, 1129, 1144-1156, 1162-1164, 1222, 1245-1259, 1266-1268, 1271, 1285, 1291-1299, 1346-1364, 1384, 1502, 1507-1508, 1531, 1567-1568, 1586-1600, 1612-1619, 1664, 1680-1681, 1685, 1692, 1706, 1713, 1720
tidy3d/components/tcad/source/abstract.py                        20       1  95.00%   23
tidy3d/components/viz/__init__.py                                10       0  100.00%
tidy3d/components/viz/axes_utils.py                              43       0  100.00%
tidy3d/components/viz/flex_color_palettes.py                      4       4  0.00%    1-1823
tidy3d/components/viz/flex_style.py                              27      11  59.26%   21-25, 39-40, 43-46
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                                  17       2  88.24%   7-8
tidy3d/components/viz/visualization_spec.py                      29       3  89.66%   13-15
tidy3d/material_library/material_library.py                     188       8  95.74%   86, 92, 95, 154, 157, 173, 224, 2081
tidy3d/material_library/material_reference.py                    10       0  100.00%
tidy3d/material_library/parametric_materials.py                 159       3  98.11%   20-21, 253
tidy3d/material_library/util.py                                 131      53  59.54%   51-52, 98, 114-121, 127-139, 192-207, 213-251
tidy3d/plugins/adjoint/__init__.py                               16       2  87.50%   10-11
tidy3d/plugins/adjoint/web.py                                   287      55  80.84%   72, 77, 226-240, 246-255, 283-285, 321-324, 338-349, 363-377, 566-582, 596-621
tidy3d/plugins/adjoint/components/__init__.py                    10       0  100.00%
tidy3d/plugins/adjoint/components/base.py                       141       0  100.00%
tidy3d/plugins/adjoint/components/geometry.py                   379      16  95.78%   77, 228, 347, 538, 590, 634-636, 685, 860, 868-871, 970, 973, 978
tidy3d/plugins/adjoint/components/medium.py                     175       2  98.86%   300, 439
tidy3d/plugins/adjoint/components/simulation.py                 301       9  97.01%   227-228, 243-248, 328, 615-616, 723-724
tidy3d/plugins/adjoint/components/structure.py                   98       1  98.98%   167
tidy3d/plugins/adjoint/components/types.py                       22       2  90.91%   37-41
tidy3d/plugins/adjoint/components/data/data_array.py            296      26  91.22%   77, 227, 247-252, 289, 338, 388, 399-409, 413-418, 452-453
tidy3d/plugins/adjoint/components/data/dataset.py                12       0  100.00%
tidy3d/plugins/adjoint/components/data/monitor_data.py          198       8  95.96%   165, 191, 199, 232, 238, 243, 256, 429
tidy3d/plugins/adjoint/components/data/sim_data.py              122       4  96.72%   157, 257-259
tidy3d/plugins/adjoint/utils/filter.py                           78       1  98.72%   55
tidy3d/plugins/adjoint/utils/penalty.py                         100       3  97.00%   238, 244, 276
tidy3d/plugins/autograd/__init__.py                               7       0  100.00%
tidy3d/plugins/autograd/constants.py                              3       0  100.00%
tidy3d/plugins/autograd/differential_operators.py                27       0  100.00%
tidy3d/plugins/autograd/functions.py                            148       6  95.95%   55, 61, 275, 282, 329, 336
tidy3d/plugins/autograd/types.py                                  4       0  100.00%
tidy3d/plugins/autograd/utilities.py                             73       4  94.52%   208, 225-226, 240
tidy3d/plugins/autograd/invdes/__init__.py                        7       0  100.00%
tidy3d/plugins/autograd/invdes/filters.py                        67       3  95.52%   53-54, 203
tidy3d/plugins/autograd/invdes/misc.py                            5       1  80.00%   25
tidy3d/plugins/autograd/invdes/parametrizations.py               26       0  100.00%
tidy3d/plugins/autograd/invdes/penalties.py                      60      21  65.00%   87, 139-141, 165-169, 190-192, 229-238
tidy3d/plugins/autograd/invdes/projections.py                    15       5  66.67%   32-36, 69
tidy3d/plugins/autograd/primitives/__init__.py                    4       0  100.00%
tidy3d/plugins/autograd/primitives/interpolate.py               263       4  98.48%   17, 616, 644, 680
tidy3d/plugins/autograd/primitives/misc.py                        5       0  100.00%
tidy3d/plugins/design/__init__.py                                 6       0  100.00%
tidy3d/plugins/design/design.py                                 227       4  98.24%   107, 143-144, 374
tidy3d/plugins/design/method.py                                 316       1  99.68%   69
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                             5       0  100.00%
tidy3d/plugins/dispersion/fit.py                                271      16  94.10%   170, 315-322, 420, 500, 508, 523, 530-533, 664-665, 739, 741
tidy3d/plugins/dispersion/fit_fast.py                            38       1  97.37%   149
tidy3d/plugins/dispersion/fit_web.py                              3       3  0.00%    3-7
tidy3d/plugins/dispersion/web.py                                109      23  78.90%   104, 229-232, 248-253, 278-294, 305-308, 351-355, 366-368
tidy3d/plugins/expressions/__init__.py                           20       0  100.00%
tidy3d/plugins/expressions/base.py                              133      49  63.16%   13, 42, 56, 59, 62, 87-89, 97-99, 102-103, 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                          37       1  97.30%   49
tidy3d/plugins/expressions/metrics.py                            46       2  95.65%   50, 93
tidy3d/plugins/expressions/types.py                              15       4  73.33%   10-24
tidy3d/plugins/expressions/variables.py                          27       1  96.30%   97
tidy3d/plugins/invdes/__init__.py                                10       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                          57       7  87.72%   56, 96, 103-106, 108, 115, 122
tidy3d/plugins/invdes/optimizer.py                               97       4  95.88%   99, 176, 222, 295
tidy3d/plugins/invdes/penalty.py                                 24       1  95.83%   32
tidy3d/plugins/invdes/region.py                                 172      14  91.86%   82, 102, 186-187, 194-195, 207, 215, 218, 224, 230, 240, 283-284
tidy3d/plugins/invdes/result.py                                  54       0  100.00%
tidy3d/plugins/invdes/transformation.py                          26       2  92.31%   25, 80
tidy3d/plugins/invdes/utils.py                                   37       0  100.00%
tidy3d/plugins/invdes/validators.py                              35       6  82.86%   18-29
tidy3d/plugins/microwave/__init__.py                             10       0  100.00%
tidy3d/plugins/microwave/array_factor.py                        276       2  99.28%   178, 186
tidy3d/plugins/microwave/auto_path_integrals.py                  25       0  100.00%
tidy3d/plugins/microwave/custom_path_integrals.py               135       1  99.26%   394
tidy3d/plugins/microwave/impedance_calculator.py                 48       0  100.00%
tidy3d/plugins/microwave/lobe_measurer.py                       155       0  100.00%
tidy3d/plugins/microwave/path_integrals.py                      263       4  98.48%   108, 185, 298, 419
tidy3d/plugins/microwave/rf_material_library.py                  17       0  100.00%
tidy3d/plugins/microwave/rf_material_reference.py                 3       0  100.00%
tidy3d/plugins/microwave/viz.py                                  18       0  100.00%
tidy3d/plugins/microwave/models/__init__.py                       3       0  100.00%
tidy3d/plugins/microwave/models/coupled_microstrip.py            49       0  100.00%
tidy3d/plugins/microwave/models/microstrip.py                    64       0  100.00%
tidy3d/plugins/mode/__init__.py                                   3       0  100.00%
tidy3d/plugins/mode/mode_solver.py                                7       0  100.00%
tidy3d/plugins/mode/web.py                                        3       0  100.00%
tidy3d/plugins/polyslab/__init__.py                               3       0  100.00%
tidy3d/plugins/polyslab/polyslab.py                               7       0  100.00%
tidy3d/plugins/pytorch/__init__.py                                3       0  100.00%
tidy3d/plugins/pytorch/wrapper.py                                39       1  97.44%   66
tidy3d/plugins/resonance/__init__.py                              3       0  100.00%
tidy3d/plugins/resonance/resonance.py                           172      10  94.19%   110, 139, 184, 203-204, 218, 225, 248, 254, 281
tidy3d/plugins/smatrix/__init__.py                               11       0  100.00%
tidy3d/plugins/smatrix/smatrix.py                                 4       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%   136
tidy3d/plugins/smatrix/component_modelers/terminal.py           275       0  100.00%
tidy3d/plugins/smatrix/data/terminal.py                          19       4  78.95%   29-33, 56-60
tidy3d/plugins/smatrix/ports/base_lumped.py                      41       0  100.00%
tidy3d/plugins/smatrix/ports/base_terminal.py                    33       2  93.94%   49-53
tidy3d/plugins/smatrix/ports/coaxial_lumped.py                  165       0  100.00%
tidy3d/plugins/smatrix/ports/modal.py                            14       0  100.00%
tidy3d/plugins/smatrix/ports/rectangular_lumped.py              124       0  100.00%
tidy3d/plugins/smatrix/ports/wave.py                            109       2  98.17%   124, 182
tidy3d/plugins/waveguide/__init__.py                              3       0  100.00%
tidy3d/plugins/waveguide/rectangular_dielectric.py              369      80  78.32%   274, 327, 335, 338, 464-465, 613-635, 644-679, 682-700, 803, 808, 813, 849, 899, 935, 983, 1024, 1051-1090, 1142-1154
tidy3d/web/__init__.py                                           13       0  100.00%
tidy3d/web/environment.py                                         3       3  0.00%    3-7
tidy3d/web/api/asynchronous.py                                   14       2  85.71%   67, 71
tidy3d/web/api/connect_util.py                                   44      18  59.09%   38-43, 50, 55-61, 66-72
tidy3d/web/api/container.py                                     336      36  89.29%   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                                21       1  95.24%   32
tidy3d/web/api/mode.py                                          208      66  68.27%   125-128, 133, 141, 195-198, 220, 222-231, 234-246, 342, 359, 402-405, 488-490, 494, 523-581, 615-618, 629-630, 668
tidy3d/web/api/tidy3d_stub.py                                   116      45  61.21%   71-74, 85, 109, 145, 180-203, 219, 237-263
tidy3d/web/api/webapi.py                                        349      73  79.08%   335, 365, 395, 433-451, 494-499, 513-518, 539, 548, 569, 596-599, 619-620, 701-709, 813-818, 864, 885, 918, 921-922, 979, 987-989, 1002, 1004, 1008, 1062, 1099, 1116-1124
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                                        3       0  100.00%
tidy3d/web/cli/app.py                                            66      35  46.97%   34-39, 59, 71-114, 120
tidy3d/web/cli/constants.py                                       9       1  88.89%   13
tidy3d/web/cli/migrate.py                                        46      35  23.91%   21-72
tidy3d/web/cli/develop/__init__.py                                8       0  100.00%
tidy3d/web/cli/develop/documentation.py                          78      54  30.77%   64-115, 144-163, 179-182, 226-230, 330-340
tidy3d/web/cli/develop/index.py                                   5       0  100.00%
tidy3d/web/cli/develop/install.py                               156     129  17.31%   38-46, 60-63, 75-98, 110-123, 140-151, 163-173, 183-184, 204-258, 283-285, 303-358, 374-375, 395-406
tidy3d/web/cli/develop/packaging.py                              35      18  48.57%   52-79, 112-118
tidy3d/web/cli/develop/tests.py                                  17       6  64.71%   29-32, 65-66
tidy3d/web/cli/develop/utils.py                                  15       6  60.00%   47-49, 68-70
tidy3d/web/core/account.py                                       20       1  95.00%   66
tidy3d/web/core/cache.py                                          3       0  100.00%
tidy3d/web/core/constants.py                                     23       0  100.00%
tidy3d/web/core/core_config.py                                   13       0  100.00%
tidy3d/web/core/environment.py                                   59       8  86.44%   17, 101-108, 141, 152, 163
tidy3d/web/core/exceptions.py                                     9       0  100.00%
tidy3d/web/core/file_util.py                                     40      14  65.00%   23-25, 36-38, 44-51, 61
tidy3d/web/core/http_util.py                                    105      15  85.71%   37, 64, 70, 89, 99, 136-139, 158-160, 170, 178-179
tidy3d/web/core/s3utils.py                                      121      75  38.02%   51-52, 57-58, 63, 75, 102-103, 113, 137-138, 148, 159-164, 203-211, 240-279, 305-358, 386-417
tidy3d/web/core/stub.py                                          14       0  100.00%
tidy3d/web/core/task_core.py                                    185      31  83.24%   78-80, 193-199, 241, 295, 307, 315, 319, 337, 352, 375, 377, 417, 451, 481, 484, 521, 534-535, 546-547, 578, 601, 632, 657-660, 670
tidy3d/web/core/task_info.py                                     98       0  100.00%
TOTAL                                                         33795    3091  90.85%

Results for commit: d114688

Minimum allowed coverage is 90%

♻️ This comment has been updated with latest results

@yaugenst-flex yaugenst-flex force-pushed the yaugenst-flex/ruff-upgrade branch 3 times, most recently from 4a62d80 to 6d47efb Compare May 27, 2025 06:13
Run `ruff check . --fix`

Run `ruff format .`

Move test-specifc `ruff.toml` to `per-file-ignores`

Sort test imports

Import `Literal` from `typing`

Force `from __future__ import annotations` import

Rewrite `dict()` as literal (2x faster)

Disallow function calls in default arguments

Be intentional about exception context

Upgrade all (compatible) generics to built-in types

Sort `__all__` blocks

Enable `RUF` ruleset

Prefer tuple unpacking over concatenation

Forbid implicit optional

No explicit string concatenation

Remove unnecessary `pass` statements

Remove unnecessary parantheses on raised exceptions

Disallow relative imports from parent modules

Remove unused import aliases

Add lint rule comments

Revert "Disallow function calls in default arguments"

This reverts commit 12a0a6a.

Fix some stragglers

Updated ruff version in workflow

Lint `data/` dirs

rebase fixes

sentinel pattern for function calls in default arguments

rebase fixes
@yaugenst-flex yaugenst-flex force-pushed the yaugenst-flex/ruff-upgrade branch from 6d47efb to d114688 Compare May 27, 2025 06:16
@yaugenst-flex yaugenst-flex enabled auto-merge (rebase) May 27, 2025 06:23
@yaugenst-flex yaugenst-flex merged commit ffca061 into develop May 27, 2025
23 checks passed
@yaugenst-flex yaugenst-flex deleted the yaugenst-flex/ruff-upgrade branch May 27, 2025 06:46
@tylerflex
Copy link
Copy Markdown
Collaborator

tylerflex commented Jun 13, 2025

RIP dict(). sad!

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.* rc1 1st pre-release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ruff upgrade & additional lint rules

6 participants