Skip to content

Commit 07938c9

Browse files
offset test case goes to the end
1 parent d5fd01f commit 07938c9

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

tests/test_diffraction_objects.py

+24-24
Original file line numberDiff line numberDiff line change
@@ -191,28 +191,7 @@ def test_init_invalid_xtype():
191191
"org_do_args, target_do_args, scale_inputs, expected",
192192
[
193193
# Test whether the original y-array is scaled as expected
194-
( # C1: Same x-array and y-array with 2.1 offset, expect y-array to shift up by 2.1
195-
{
196-
"xarray": np.array([10, 15, 25, 30, 60, 140]),
197-
"yarray": np.array([2, 3, 4, 5, 6, 7]),
198-
"xtype": "tth",
199-
"wavelength": 2 * np.pi,
200-
},
201-
{
202-
"xarray": np.array([10, 15, 25, 30, 60, 140]),
203-
"yarray": np.array([2, 3, 4, 5, 6, 7]),
204-
"xtype": "tth",
205-
"wavelength": 2 * np.pi,
206-
},
207-
{
208-
"q": None,
209-
"tth": 60,
210-
"d": None,
211-
"offset": 2.1,
212-
},
213-
{"xtype": "tth", "yarray": np.array([4.1, 5.1, 6.1, 7.1, 8.1, 9.1])},
214-
),
215-
( # C2: Same x-arrays
194+
( # C1: Same x-arrays
216195
# x-value has exact matches at tth=60 (y=60) and tth=60 (y=6),
217196
# for original and target diffraction objects,
218197
# expect original y-array to multiply by 6/60=1/10
@@ -236,7 +215,7 @@ def test_init_invalid_xtype():
236215
},
237216
{"xtype": "tth", "yarray": np.array([1, 2, 2.5, 3, 6, 10])},
238217
),
239-
( # C3: Different x-arrays with same length,
218+
( # C2: Different x-arrays with same length,
240219
# x-value has closest match at q=0.12 (y=10) and q=0.14 (y=1)
241220
# for original and target diffraction objects,
242221
# expect original y-array to multiply by 1/10
@@ -260,7 +239,7 @@ def test_init_invalid_xtype():
260239
},
261240
{"xtype": "q", "yarray": np.array([1, 2, 4, 6])},
262241
),
263-
( # C4: Different x-array lengths
242+
( # C3: Different x-array lengths
264243
# x-value has closest matches at tth=61 (y=50) and tth=62 (y=5),
265244
# for original and target diffraction objects,
266245
# expect original y-array to multiply by 5/50=1/10
@@ -284,6 +263,27 @@ def test_init_invalid_xtype():
284263
},
285264
{"xtype": "tth", "yarray": np.array([1, 2, 3, 4, 5, 6, 10])},
286265
),
266+
( # C4: Same x-array and y-array with 2.1 offset, expect y-array to shift up by 2.1
267+
{
268+
"xarray": np.array([10, 15, 25, 30, 60, 140]),
269+
"yarray": np.array([2, 3, 4, 5, 6, 7]),
270+
"xtype": "tth",
271+
"wavelength": 2 * np.pi,
272+
},
273+
{
274+
"xarray": np.array([10, 15, 25, 30, 60, 140]),
275+
"yarray": np.array([2, 3, 4, 5, 6, 7]),
276+
"xtype": "tth",
277+
"wavelength": 2 * np.pi,
278+
},
279+
{
280+
"q": None,
281+
"tth": 60,
282+
"d": None,
283+
"offset": 2.1,
284+
},
285+
{"xtype": "tth", "yarray": np.array([4.1, 5.1, 6.1, 7.1, 8.1, 9.1])},
286+
),
287287
],
288288
)
289289
def test_scale_to(org_do_args, target_do_args, scale_inputs, expected):

0 commit comments

Comments
 (0)