Skip to content

Commit 86c035a

Browse files
committed
updated unit tests for test_eme.py
1 parent a9b91b7 commit 86c035a

File tree

4 files changed

+38
-14
lines changed

4 files changed

+38
-14
lines changed

tests/test_components/test_eme.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -282,22 +282,22 @@ def test_eme_monitor():
282282
center=(1, 2, 3), size=(2, 2, 2), freqs=[300e12], num_modes=2, name="eme_coeffs"
283283
)
284284

285-
286-
def test_eme_simulation():
285+
@pytest.mark.parametrize("transpose", [True, False])
286+
def test_eme_simulation(transpose):
287287
sim = make_eme_sim()
288-
_ = sim.plot(x=0, ax=AX)
289-
_ = sim.plot(y=0, ax=AX)
290-
_ = sim.plot(z=0, ax=AX)
291-
_ = sim.plot_grid(x=0, ax=AX)
292-
_ = sim.plot_grid(y=0, ax=AX)
293-
_ = sim.plot_grid(z=0, ax=AX)
294-
_ = sim.plot_eps(x=0, ax=AX)
295-
_ = sim.plot_eps(y=0, ax=AX)
296-
_ = sim.plot_eps(z=0, ax=AX)
288+
_ = sim.plot(x=0, ax=AX, transpose=transpose)
289+
_ = sim.plot(y=0, ax=AX, transpose=transpose)
290+
_ = sim.plot(z=0, ax=AX, transpose=transpose)
291+
_ = sim.plot_grid(x=0, ax=AX, transpose=transpose)
292+
_ = sim.plot_grid(y=0, ax=AX, transpose=transpose)
293+
_ = sim.plot_grid(z=0, ax=AX, transpose=transpose)
294+
_ = sim.plot_eps(x=0, ax=AX, transpose=transpose)
295+
_ = sim.plot_eps(y=0, ax=AX, transpose=transpose)
296+
_ = sim.plot_eps(z=0, ax=AX, transpose=transpose)
297297
sim2 = sim.updated_copy(axis=1)
298-
_ = sim2.plot(x=0, ax=AX)
299-
_ = sim2.plot(y=0, ax=AX)
300-
_ = sim2.plot(z=0, ax=AX)
298+
_ = sim2.plot(x=0, ax=AX, transpose=transpose)
299+
_ = sim2.plot(y=0, ax=AX, transpose=transpose)
300+
_ = sim2.plot(z=0, ax=AX, transpose=transpose)
301301

302302
# need at least one freq
303303
with pytest.raises(pd.ValidationError):

tidy3d/components/mode/mode_solver.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,8 @@ def _get_solver_grid(
344344
represent the region where custom medium data is needed for proper subpixel.
345345
truncate_symmetry : bool = True
346346
Truncate to symmetry quadrant if symmetry present.
347+
transpose : bool = False
348+
Swap the coordinates in the plane. (This overrides the default lexicographic axis order).
347349
348350
Returns
349351
-------
@@ -2106,6 +2108,8 @@ def plot(
21062108
----------
21072109
ax : matplotlib.axes._subplots.Axes = None
21082110
Matplotlib axes to plot on, if not specified, one is created.
2111+
transpose : bool = False
2112+
Swap horizontal and vertical axes. (This overrides the default lexicographic axis order).
21092113
21102114
Returns
21112115
-------
@@ -2160,6 +2164,8 @@ def plot_eps(
21602164
Defaults to the structure default alpha.
21612165
ax : matplotlib.axes._subplots.Axes = None
21622166
Matplotlib axes to plot on, if not specified, one is created.
2167+
transpose : bool = False
2168+
Swap horizontal and vertical axes. (This overrides the default lexicographic axis order).
21632169
21642170
Returns
21652171
-------
@@ -2223,6 +2229,8 @@ def plot_structures_eps(
22232229
If ``True``, it is plotteed in white (suitable for black backgrounds).
22242230
ax : matplotlib.axes._subplots.Axes = None
22252231
Matplotlib axes to plot on, if not specified, one is created.
2232+
transpose : bool = False
2233+
Swap horizontal and vertical axes. (This overrides the default lexicographic axis order).
22262234
22272235
Returns
22282236
-------
@@ -2270,6 +2278,8 @@ def plot_grid(
22702278
----------
22712279
ax : matplotlib.axes._subplots.Axes = None
22722280
Matplotlib axes to plot on, if not specified, one is created.
2281+
transpose : bool = False
2282+
Swap horizontal and vertical axes. (This overrides the default lexicographic axis order).
22732283
**kwargs
22742284
Optional keyword arguments passed to the matplotlib ``LineCollection``.
22752285
For details on accepted values, refer to
@@ -2419,6 +2429,8 @@ def plot_pml(
24192429
----------
24202430
ax : matplotlib.axes._subplots.Axes = None
24212431
Matplotlib axes to plot on, if not specified, one is created.
2432+
transpose : bool = False
2433+
Swap horizontal and vertical axes. (This overrides the default lexicographic axis order).
24222434
24232435
Returns
24242436
-------

tidy3d/components/tcad/simulation/heat.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ def plot_heat_conductivity(
9898
The x range if plotting on xy or xz planes, y range if plotting on yz plane.
9999
vlim : Tuple[float, float] = None
100100
The z range if plotting on xz or yz planes, y plane if plotting on xy plane.
101+
transpose : bool = False
102+
Swap horizontal and vertical axes. (This overrides the default lexicographic axis order).
101103
102104
Returns
103105
-------

tidy3d/components/tcad/simulation/heat_charge.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,8 @@ def plot_property(
993993
The x range if plotting on xy or xz planes, y range if plotting on yz plane.
994994
vlim : Tuple[float, float] = None
995995
The z range if plotting on xz or yz planes, y plane if plotting on xy plane.
996+
transpose : bool = False
997+
Swap horizontal and vertical axes. (This overrides the default lexicographic axis order).
996998
997999
Returns
9981000
-------
@@ -1097,6 +1099,8 @@ def plot_heat_conductivity(
10971099
The x range if plotting on xy or xz planes, y range if plotting on yz plane.
10981100
vlim : Tuple[float, float] = None
10991101
The z range if plotting on xz or yz planes, y plane if plotting on xy plane.
1102+
transpose : bool = False
1103+
Swap horizontal and vertical axes. (This overrides the default lexicographic axis order).
11001104
11011105
Returns
11021106
-------
@@ -1156,6 +1160,8 @@ def plot_boundaries(
11561160
Options are ["heat_conductivity", "electric_conductivity"]
11571161
ax : matplotlib.axes._subplots.Axes = None
11581162
Matplotlib axes to plot on, if not specified, one is created.
1163+
transpose : bool = False
1164+
Swap horizontal and vertical axes. (This overrides the default lexicographic axis order).
11591165
11601166
Returns
11611167
-------
@@ -1466,6 +1472,8 @@ def _construct_heat_charge_boundaries(
14661472
target plane.
14671473
boundary_spec : List[HeatBoundarySpec]
14681474
list of boundary conditions associated with structures.
1475+
transpose : bool = False
1476+
Swap the boundary-box coordinates in the plane. (This overrides the default lexicographic axis order).
14691477
14701478
Returns
14711479
-------
@@ -1550,6 +1558,8 @@ def plot_sources(
15501558
Opacity of the sources, If ``None`` uses Tidy3d default.
15511559
ax : matplotlib.axes._subplots.Axes = None
15521560
Matplotlib axes to plot on, if not specified, one is created.
1561+
transpose : bool = False
1562+
Swap horizontal and vertical axes. (This overrides the default lexicographic axis order).
15531563
15541564
Returns
15551565
-------

0 commit comments

Comments
 (0)