@@ -50,13 +50,15 @@ def test_validate_components_none():
50
50
assert SCENE ._validate_num_mediums (val = None ) is None
51
51
52
52
53
- def test_plot_eps ():
54
- ax = SCENE_FULL .plot_eps (x = 0 )
53
+ @pytest .mark .parametrize ("swap_axes" , [True , False ])
54
+ def test_plot_eps (swap_axes ):
55
+ ax = SCENE_FULL .plot_eps (x = 0 , swap_axes = swap_axes )
55
56
SCENE_FULL ._add_cbar_eps (eps_min = 1 , eps_max = 2 , ax = ax )
56
57
plt .close ()
57
58
58
59
59
- def test_plot_eps_multiphysics ():
60
+ @pytest .mark .parametrize ("swap_axes" , [True , False ])
61
+ def test_plot_eps_multiphysics (swap_axes ):
60
62
s = td .Scene (
61
63
structures = [
62
64
td .Structure (
@@ -70,20 +72,22 @@ def test_plot_eps_multiphysics():
70
72
]
71
73
)
72
74
assert s .structures [0 ].medium .name == "SiO2"
73
- s .plot_eps (x = 0 )
75
+ s .plot_eps (x = 0 , swap_axes = swap_axes )
74
76
75
77
76
- def test_plot_eps_bounds ():
77
- _ = SCENE_FULL .plot_eps (x = 0 , hlim = [- 0.45 , 0.45 ])
78
+ @pytest .mark .parametrize ("swap_axes" , [True , False ])
79
+ def test_plot_eps_bounds (swap_axes ):
80
+ _ = SCENE_FULL .plot_eps (x = 0 , hlim = [- 0.45 , 0.45 ], swap_axes = swap_axes )
78
81
plt .close ()
79
- _ = SCENE_FULL .plot_eps (x = 0 , vlim = [- 0.45 , 0.45 ])
82
+ _ = SCENE_FULL .plot_eps (x = 0 , vlim = [- 0.45 , 0.45 ], swap_axes = swap_axes )
80
83
plt .close ()
81
- _ = SCENE_FULL .plot_eps (x = 0 , hlim = [- 0.45 , 0.45 ], vlim = [- 0.45 , 0.45 ])
84
+ _ = SCENE_FULL .plot_eps (x = 0 , hlim = [- 0.45 , 0.45 ], vlim = [- 0.45 , 0.45 ], swap_axes = swap_axes )
82
85
plt .close ()
83
86
84
87
85
- def test_plot ():
86
- SCENE_FULL .plot (x = 0 )
88
+ @pytest .mark .parametrize ("swap_axes" , [True , False ])
89
+ def test_plot (swap_axes ):
90
+ SCENE_FULL .plot (x = 0 , swap_axes = swap_axes )
87
91
plt .close ()
88
92
89
93
@@ -93,44 +97,48 @@ def test_plot_1d_scene():
93
97
plt .close ()
94
98
95
99
96
- def test_plot_bounds ():
97
- _ = SCENE_FULL .plot (x = 0 , hlim = [- 0.45 , 0.45 ])
100
+ @pytest .mark .parametrize ("swap_axes" , [True , False ])
101
+ def test_plot_bounds (swap_axes ):
102
+ _ = SCENE_FULL .plot (x = 0 , hlim = [- 0.45 , 0.45 ], swap_axes = swap_axes )
98
103
plt .close ()
99
- _ = SCENE_FULL .plot (x = 0 , vlim = [- 0.45 , 0.45 ])
104
+ _ = SCENE_FULL .plot (x = 0 , vlim = [- 0.45 , 0.45 ], swap_axes = swap_axes )
100
105
plt .close ()
101
- _ = SCENE_FULL .plot (x = 0 , hlim = [- 0.45 , 0.45 ], vlim = [- 0.45 , 0.45 ])
106
+ _ = SCENE_FULL .plot (x = 0 , hlim = [- 0.45 , 0.45 ], vlim = [- 0.45 , 0.45 ], swap_axes = swap_axes )
102
107
plt .close ()
103
108
104
109
105
- def test_structure_alpha ():
106
- _ = SCENE_FULL .plot_structures_eps (x = 0 , alpha = None )
110
+ @pytest .mark .parametrize ("swap_axes" , [True , False ])
111
+ def test_structure_alpha (swap_axes ):
112
+ _ = SCENE_FULL .plot_structures_eps (x = 0 , alpha = None , swap_axes = swap_axes )
107
113
plt .close ()
108
- _ = SCENE_FULL .plot_structures_eps (x = 0 , alpha = - 1 )
114
+ _ = SCENE_FULL .plot_structures_eps (x = 0 , alpha = - 1 , swap_axes = swap_axes )
109
115
plt .close ()
110
- _ = SCENE_FULL .plot_structures_eps (x = 0 , alpha = 1 )
116
+ _ = SCENE_FULL .plot_structures_eps (x = 0 , alpha = 1 , swap_axes = swap_axes )
111
117
plt .close ()
112
- _ = SCENE_FULL .plot_structures_eps (x = 0 , alpha = 0.5 )
118
+ _ = SCENE_FULL .plot_structures_eps (x = 0 , alpha = 0.5 , swap_axes = swap_axes )
113
119
plt .close ()
114
- _ = SCENE_FULL .plot_structures_eps (x = 0 , alpha = 0.5 , cbar = True )
120
+ _ = SCENE_FULL .plot_structures_eps (x = 0 , alpha = 0.5 , cbar = True , swap_axes = swap_axes )
115
121
plt .close ()
116
122
new_structs = [
117
123
td .Structure (geometry = s .geometry , medium = SCENE_FULL .medium ) for s in SCENE_FULL .structures
118
124
]
119
125
S2 = SCENE_FULL .copy (update = {"structures" : new_structs })
120
- _ = S2 .plot_structures_eps (x = 0 , alpha = 0.5 )
126
+ _ = S2 .plot_structures_eps (x = 0 , alpha = 0.5 , swap_axes = swap_axes )
121
127
plt .close ()
122
128
123
129
124
- def test_plot_with_units ():
130
+ @pytest .mark .parametrize ("swap_axes" , [True , False ])
131
+ def test_plot_with_units (swap_axes ):
125
132
scene_with_units = SCENE_FULL .updated_copy (plot_length_units = "nm" )
126
- scene_with_units .plot (x = - 0.5 )
133
+ scene_with_units .plot (x = - 0.5 , swap_axes = swap_axes )
127
134
128
135
129
- def test_filter_structures ():
136
+ @pytest .mark .parametrize ("swap_axes" , [True , False ])
137
+ def test_filter_structures (swap_axes ):
130
138
s1 = td .Structure (geometry = td .Box (size = (1 , 1 , 1 )), medium = SCENE .medium )
131
139
s2 = td .Structure (geometry = td .Box (size = (1 , 1 , 1 ), center = (1 , 1 , 1 )), medium = SCENE .medium )
132
140
plane = td .Box (center = (0 , 0 , 1.5 ), size = (td .inf , td .inf , 0 ))
133
- SCENE ._filter_structures_plane_medium (structures = [s1 , s2 ], plane = plane )
141
+ SCENE ._filter_structures_plane_medium (structures = [s1 , s2 ], plane = plane , swap_axes = swap_axes )
134
142
135
143
136
144
def test_get_structure_plot_params ():
0 commit comments