|
9 | 9 | @pytest.mark.parametrize( |
10 | 10 | "wavelength, q, expected_tth", |
11 | 11 | [ |
12 | | - # UC1.1: User specified empty 'q' and no 'wavelength'. |
13 | | - # Expect empty 'tth' array and UserWarning about missing wavelength. |
| 12 | + # Case 1: Allow empty arrays for q |
| 13 | + # 1. Empty q values, no wavelength, return empty arrays |
14 | 14 | (None, np.empty((0)), np.empty((0))), |
15 | | - # UC1.2: User specified empty 'q' and 'wavelength'. Expect empty 'tth' array. |
| 15 | + # 2. Empty q values, wavelength specified, return empty arrays |
16 | 16 | (4 * np.pi, np.empty((0)), np.empty(0)), |
17 | | - # UC2.1: User specified non-empty 'q' values and no 'wavelength'. |
18 | | - # Expect non-empty 'tth' array and UserWarning about missing wavelength. |
| 17 | + |
| 18 | + # Case 2: Allow wavelength to be missing. |
| 19 | + # Valid q values, no wavelength, return index array |
19 | 20 | ( |
20 | 21 | None, |
21 | 22 | np.array([0, 0.2, 0.4, 0.6, 0.8, 1]), |
22 | 23 | np.array([0, 1, 2, 3, 4, 5]), |
23 | 24 | ), |
24 | | - # UC2.2: User specified non-empty 'q' values and 'wavelength'. |
25 | | - # Expect tth values are 2*arcsin(q) in degrees. |
| 25 | +
|
| 26 | + # Case 3: Correctly specified q and wavelength |
| 27 | + # Expected tth values are 2*arcsin(q) in degrees |
26 | 28 | (4 * np.pi, np.array([0, 1 / np.sqrt(2), 1.0]), np.array([0, 90.0, 180.0])), |
27 | 29 | ], |
28 | 30 | ) |
|
0 commit comments