@@ -80,6 +80,11 @@ def test_wavelength_figure_multiple_datasets(da, wavelength_bins, theta_bins):
8080 da .hist (wavelength = 10 , theta = 10 ),
8181 ),
8282 )
83+
84+
85+ def test_wavelength_figure_multiple_datasets_some_with_and_some_without_implicit_bins (
86+ da , wavelength_bins , theta_bins
87+ ):
8388 assert wavelength_theta_figure (
8489 (
8590 da ,
@@ -89,12 +94,21 @@ def test_wavelength_figure_multiple_datasets(da, wavelength_bins, theta_bins):
8994 wavelength_bins = wavelength_bins ,
9095 theta_bins = theta_bins ,
9196 )
97+
98+
99+ def test_wavelength_figure_multiple_datasets_different_binnings (
100+ da , wavelength_bins , theta_bins
101+ ):
92102 assert wavelength_theta_figure (
93103 (da , da ),
94104 wavelength_bins = (wavelength_bins , wavelength_bins ),
95105 theta_bins = theta_bins ,
96106 )
97107
108+
109+ def test_wavelength_figure_multiple_datasets_fails_if_length_of_ds_and_bins_differ (
110+ da , wavelength_bins , theta_bins
111+ ):
98112 with pytest .raises (ValueError , match = r'zip\(\) argument .*' ):
99113 assert wavelength_theta_figure (
100114 (da , da ),
@@ -103,12 +117,19 @@ def test_wavelength_figure_multiple_datasets(da, wavelength_bins, theta_bins):
103117 theta_bins = theta_bins ,
104118 )
105119
120+
121+ def test_wavelength_figure_takes_q_edges_argument (da , wavelength_bins , theta_bins ):
106122 assert wavelength_theta_figure (
107123 da ,
108124 theta_bins = theta_bins ,
109125 wavelength_bins = wavelength_bins ,
110126 q_edges_to_display = (sc .scalar (1.0 , unit = '1/angstrom' ),),
111127 )
128+
129+
130+ def test_wavelength_figure_accepts_additional_plot_kwargs (
131+ da , wavelength_bins , theta_bins
132+ ):
112133 assert wavelength_theta_figure (
113134 da ,
114135 theta_bins = theta_bins ,
@@ -160,6 +181,9 @@ def test_q_figure_multiple_datasets(da, q_bins, theta_bins):
160181 da .hist (Q = 10 , theta = 10 ),
161182 ),
162183 )
184+
185+
186+ def test_q_figure_multiple_datasets_with_same_binnings (da , q_bins , theta_bins ):
163187 assert q_theta_figure (
164188 (
165189 da ,
@@ -169,12 +193,19 @@ def test_q_figure_multiple_datasets(da, q_bins, theta_bins):
169193 q_bins = q_bins ,
170194 theta_bins = theta_bins ,
171195 )
196+
197+
198+ def test_q_figure_multiple_datasets_with_different_binnings (da , q_bins , theta_bins ):
172199 assert q_theta_figure (
173200 (da , da ),
174201 q_bins = (q_bins , q_bins ),
175202 theta_bins = theta_bins ,
176203 )
177204
205+
206+ def test_q_figure_multiple_datasets_fails_if_length_of_ds_and_binnings_differ (
207+ da , q_bins , theta_bins
208+ ):
178209 with pytest .raises (ValueError , match = r'zip\(\) argument .*' ):
179210 assert q_theta_figure (
180211 (da , da ),
@@ -183,6 +214,8 @@ def test_q_figure_multiple_datasets(da, q_bins, theta_bins):
183214 theta_bins = theta_bins ,
184215 )
185216
217+
218+ def test_q_figure_can_pass_additional_plot_kwargs (da , q_bins , theta_bins ):
186219 assert q_theta_figure (
187220 da ,
188221 theta_bins = theta_bins ,
@@ -215,6 +248,11 @@ def test_z_figure_multiple_datasets(da, wavelength_bins):
215248 da .hist (wavelength = 3 ),
216249 ),
217250 )
251+
252+
253+ def test_z_figure_multiple_datasets_with_binning (da , wavelength_bins ):
254+ da = da .group ('z_index' ).fold ('z_index' , dims = ('blade' , 'wire' ), shape = (2 , 5 ))
255+
218256 assert wavelength_z_figure (
219257 (
220258 da ,
@@ -223,13 +261,24 @@ def test_z_figure_multiple_datasets(da, wavelength_bins):
223261 ),
224262 wavelength_bins = wavelength_bins ,
225263 )
264+
265+
266+ def test_z_figure_multiple_datasets_with_different_binnings (da , wavelength_bins ):
267+ da = da .group ('z_index' ).fold ('z_index' , dims = ('blade' , 'wire' ), shape = (2 , 5 ))
268+
226269 assert wavelength_z_figure (
227270 (
228271 da .bin (wavelength = 3 ),
229272 da .hist (wavelength = 3 ),
230273 ),
231274 wavelength_bins = (wavelength_bins , wavelength_bins ),
232275 )
276+
277+
278+ def test_z_figure_multiple_datasets_fails_if_length_of_ds_and_binnings_differ (
279+ da , wavelength_bins
280+ ):
281+ da = da .group ('z_index' ).fold ('z_index' , dims = ('blade' , 'wire' ), shape = (2 , 5 ))
233282 with pytest .raises (ValueError , match = r'zip\(\) argument .*' ):
234283 assert wavelength_z_figure (
235284 (
@@ -240,6 +289,9 @@ def test_z_figure_multiple_datasets(da, wavelength_bins):
240289 wavelength_bins = (wavelength_bins ,),
241290 )
242291
292+
293+ def test_z_figure_takes_additional_plot_kwargs (da , wavelength_bins ):
294+ da = da .group ('z_index' ).fold ('z_index' , dims = ('blade' , 'wire' ), shape = (2 , 5 ))
243295 assert wavelength_z_figure (
244296 da ,
245297 wavelength_bins = wavelength_bins ,
0 commit comments