@@ -364,7 +364,7 @@ def test_scale_to_bad(org_do_args, target_do_args, scale_inputs):
364364 "xtype" : "tth" ,
365365 "value" : 30.005 ,
366366 },
367- [ 0 ] ,
367+ 0 ,
368368 ),
369369 ( # C2: Target value lies in the array, expect the (first) closest index
370370 {
@@ -377,7 +377,7 @@ def test_scale_to_bad(org_do_args, target_do_args, scale_inputs):
377377 "xtype" : "tth" ,
378378 "value" : 45 ,
379379 },
380- [ 0 ] ,
380+ 0 ,
381381 ),
382382 (
383383 {
@@ -390,7 +390,7 @@ def test_scale_to_bad(org_do_args, target_do_args, scale_inputs):
390390 "xtype" : "q" ,
391391 "value" : 0.25 ,
392392 },
393- [ 0 ] ,
393+ 0 ,
394394 ),
395395 # C3: Target value out of the range, expect the closest index
396396 ( # 1. Test with xtype of "q"
@@ -404,7 +404,7 @@ def test_scale_to_bad(org_do_args, target_do_args, scale_inputs):
404404 "xtype" : "q" ,
405405 "value" : 0.1 ,
406406 },
407- [ 0 ] ,
407+ 0 ,
408408 ),
409409 ( # 2. Test with xtype of "tth"
410410 {
@@ -417,20 +417,20 @@ def test_scale_to_bad(org_do_args, target_do_args, scale_inputs):
417417 "xtype" : "tth" ,
418418 "value" : 63 ,
419419 },
420- [ 1 ] ,
420+ 1 ,
421421 ),
422422 ],
423423)
424424def test_get_array_index (do_args , get_array_index_inputs , expected_index ):
425425 do = DiffractionObject (** do_args )
426- actual_index = do .get_array_index (get_array_index_inputs ["value " ], get_array_index_inputs ["xtype " ])
426+ actual_index = do .get_array_index (get_array_index_inputs ["xtype " ], get_array_index_inputs ["value " ])
427427 assert actual_index == expected_index
428428
429429
430430def test_get_array_index_bad ():
431431 do = DiffractionObject (wavelength = 2 * np .pi , xarray = np .array ([]), yarray = np .array ([]), xtype = "tth" )
432432 with pytest .raises (ValueError , match = re .escape ("The 'tth' array is empty. Please ensure it is initialized." )):
433- do .get_array_index (value = 30 )
433+ do .get_array_index (xtype = "tth" , xvalue = 30 )
434434
435435
436436def test_dump (tmp_path , mocker ):
0 commit comments