Skip to content

Commit 8e43660

Browse files
committed
test: update the test code for DiffractionObject.get_array_index
1 parent 93bc105 commit 8e43660

File tree

2 files changed

+28
-5
lines changed

2 files changed

+28
-5
lines changed

news/fix-get-array-index.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Added:**
2+
3+
* <news item>
4+
5+
**Changed:**
6+
7+
* <news item>
8+
9+
**Deprecated:**
10+
11+
* <news item>
12+
13+
**Removed:**
14+
15+
* <news item>
16+
17+
**Fixed:**
18+
19+
* Let ``DiffractionObject.get_array_index`` to use the ``xtype`` from its inputs.
20+
21+
**Security:**
22+
23+
* <news item>

tests/test_diffraction_objects.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,8 @@ def test_scale_to_bad(org_do_args, target_do_args, scale_inputs):
376376
},
377377
0,
378378
),
379-
( # C2: Target value lies in the array, expect the (first) closest
380-
# index
379+
# C2: Target value lies in the array, expect the closest index
380+
( # 1. same xtype
381381
{
382382
"wavelength": 4 * np.pi,
383383
"xarray": np.array([30, 60]),
@@ -390,7 +390,7 @@ def test_scale_to_bad(org_do_args, target_do_args, scale_inputs):
390390
},
391391
0,
392392
),
393-
(
393+
( # 2. different xtype
394394
{
395395
"wavelength": 4 * np.pi,
396396
"xarray": np.array([30, 60]),
@@ -399,9 +399,9 @@ def test_scale_to_bad(org_do_args, target_do_args, scale_inputs):
399399
},
400400
{
401401
"xtype": "q",
402-
"value": 0.25,
402+
"value": 0.5,
403403
},
404-
0,
404+
1,
405405
),
406406
# C3: Target value out of the range, expect the closest index
407407
( # 1. Test with xtype of "q"

0 commit comments

Comments
 (0)