Skip to content

Commit cdf96df

Browse files
committed
Apply pre-commit
1 parent 5e39538 commit cdf96df

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

tests/test_transforms.py

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -198,25 +198,27 @@ def test_tth_to_d_invalid(wavelength, tth, expected_error_type, expected_error_m
198198
tth_to_d(tth, wavelength)
199199

200200

201-
202-
@pytest.mark.parametrize("wavelength, d, expected_tth", [
203-
# UC1: Empty d values, no wavelength, return empty arrays
204-
(None, np.empty((0)), np.empty((0))),
205-
# UC2: Empty d values, wavelength specified, return empty arrays
206-
(4 * np.pi, np.empty((0)), np.empty(0)),
207-
# UC3: User specified valid d values, no wavelength, return empty arrays
208-
(
209-
None,
210-
np.array([1, 0.8, 0.6, 0.4, 0.2, 0]),
211-
np.array([0, 1, 2, 3, 4, 5]),
212-
),
213-
# UC4: User specified valid d values (with wavelength)
214-
(
215-
4 * np.pi,
216-
np.array([4 * np.pi, 4 / np.sqrt(2) * np.pi, 4 / np.sqrt(3) * np.pi]),
217-
np.array([60.0, 90.0, 120.0]),
218-
),
219-
])
201+
@pytest.mark.parametrize(
202+
"wavelength, d, expected_tth",
203+
[
204+
# UC1: Empty d values, no wavelength, return empty arrays
205+
(None, np.empty((0)), np.empty((0))),
206+
# UC2: Empty d values, wavelength specified, return empty arrays
207+
(4 * np.pi, np.empty((0)), np.empty(0)),
208+
# UC3: User specified valid d values, no wavelength, return empty arrays
209+
(
210+
None,
211+
np.array([1, 0.8, 0.6, 0.4, 0.2, 0]),
212+
np.array([0, 1, 2, 3, 4, 5]),
213+
),
214+
# UC4: User specified valid d values (with wavelength)
215+
(
216+
4 * np.pi,
217+
np.array([4 * np.pi, 4 / np.sqrt(2) * np.pi, 4 / np.sqrt(3) * np.pi]),
218+
np.array([60.0, 90.0, 120.0]),
219+
),
220+
],
221+
)
220222
def test_d_to_tth(wavelength, d, expected_tth):
221223
actual_tth = d_to_tth(d, wavelength)
222224
assert np.allclose(actual_tth, expected_tth)

0 commit comments

Comments
 (0)