Skip to content

Commit b61eaca

Browse files
committed
Start comment with a cap letter
1 parent 47750a0 commit b61eaca

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

tests/test_diffraction_objects.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def test_init_invalid_xtype():
186186
"org_do_args, target_do_args, scale_inputs, expected",
187187
[
188188
# Test that scale_to() scales to the correct values
189-
# C1: same x-array and y-array, check offset
189+
# C1: Same x-array and y-array, check offset
190190
(
191191
{
192192
"xarray": np.array([10, 15, 25, 30, 60, 140]),
@@ -208,7 +208,7 @@ def test_init_invalid_xtype():
208208
},
209209
{"xtype": "tth", "yarray": np.array([4.1, 5.1, 6.1, 7.1, 8.1, 9.1])},
210210
),
211-
# C2: same length x-arrays with exact x-value match
211+
# C2: Same length x-arrays with exact x-value match
212212
(
213213
{
214214
"xarray": np.array([10, 15, 25, 30, 60, 140]),
@@ -230,7 +230,7 @@ def test_init_invalid_xtype():
230230
},
231231
{"xtype": "tth", "yarray": np.array([1, 2, 2.5, 3, 6, 10])},
232232
),
233-
# C3: same length x-arrays with approximate x-value match
233+
# C3: Same length x-arrays with approximate x-value match
234234
(
235235
{
236236
"xarray": np.array([0.12, 0.24, 0.31, 0.4]),
@@ -252,7 +252,7 @@ def test_init_invalid_xtype():
252252
},
253253
{"xtype": "q", "yarray": np.array([1, 2, 4, 6])},
254254
),
255-
# C4: different x-array lengths with approximate x-value match
255+
# C4: Different x-array lengths with approximate x-value match
256256
(
257257
{
258258
"xarray": np.array([10, 25, 30.1, 40.2, 61, 120, 140]),
@@ -290,7 +290,7 @@ def test_scale_to(org_do_args, target_do_args, scale_inputs, expected):
290290
@pytest.mark.parametrize(
291291
"org_do_args, target_do_args, scale_inputs",
292292
[
293-
# UC1: user did not specify anything
293+
# UC1: User did not specify anything
294294
(
295295
{
296296
"xarray": np.array([0.1, 0.2, 0.3]),
@@ -311,7 +311,7 @@ def test_scale_to(org_do_args, target_do_args, scale_inputs, expected):
311311
"offset": 0,
312312
},
313313
),
314-
# UC2: user specified more than one of q, tth, and d
314+
# UC2: User specified more than one of q, tth, and d
315315
(
316316
{
317317
"xarray": np.array([10, 25, 30.1, 40.2, 61, 120, 140]),
@@ -352,12 +352,12 @@ def test_scale_to_bad(org_do_args, target_do_args, scale_inputs):
352352
@pytest.mark.parametrize(
353353
"wavelength, xarray, yarray, xtype_1, xtype_2, value, expected_index",
354354
[
355-
# UC1: exact match
355+
# UC1: Exact match
356356
(4 * np.pi, np.array([30.005, 60]), np.array([1, 2]), "tth", "tth", 30.005, [0]),
357-
# UC2: target value lies in the array, returns the (first) closest index
357+
# UC2: Target value lies in the array, returns the (first) closest index
358358
(4 * np.pi, np.array([30, 60]), np.array([1, 2]), "tth", "tth", 45, [0]),
359359
(4 * np.pi, np.array([30, 60]), np.array([1, 2]), "tth", "q", 0.25, [0]),
360-
# UC3: target value out of the range, returns the closest index
360+
# UC3: Target value out of the range, returns the closest index
361361
(4 * np.pi, np.array([0.25, 0.5, 0.71]), np.array([1, 2, 3]), "q", "q", 0.1, [0]),
362362
(4 * np.pi, np.array([30, 60]), np.array([1, 2]), "tth", "tth", 63, [1]),
363363
],
@@ -411,7 +411,7 @@ def test_dump(tmp_path, mocker):
411411
@pytest.mark.parametrize(
412412
"do_init_args, expected_do_dict, divide_by_zero_warning_expected",
413413
[
414-
( # instantiate just array attributes
414+
( # Instantiate just array attributes
415415
{
416416
"xarray": np.array([0.0, 90.0, 180.0]),
417417
"yarray": np.array([1.0, 2.0, 3.0]),
@@ -440,7 +440,7 @@ def test_dump(tmp_path, mocker):
440440
},
441441
True,
442442
),
443-
( # instantiate just array attributes
443+
( # Instantiate just array attributes
444444
{
445445
"xarray": np.array([np.inf, 2 * np.sqrt(2) * np.pi, 2 * np.pi]),
446446
"yarray": np.array([1.0, 2.0, 3.0]),
@@ -487,11 +487,11 @@ def test_init_valid(do_init_args, expected_do_dict, divide_by_zero_warning_expec
487487
@pytest.mark.parametrize(
488488
"do_init_args, expected_error_msg",
489489
[
490-
( # C1: no arguments provided
490+
( # C1: No arguments provided
491491
{},
492492
"missing 3 required positional arguments: 'xarray', 'yarray', and 'xtype'",
493493
),
494-
( # C2: only xarray and yarray provided
494+
( # C2: Only xarray and yarray provided
495495
{"xarray": np.array([0.0, 90.0]), "yarray": np.array([0.0, 90.0])},
496496
"missing 1 required positional argument: 'xtype'",
497497
),

tests/test_transforms.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ def test_tth_to_q(wavelength, tth, expected_q, wavelength_warning_msg):
9696
@pytest.mark.parametrize(
9797
"wavelength, tth, expected_error_type, expected_error_msg",
9898
[
99-
# C1: invalid tth value of > 180 degrees, no wavelength, expect two theta ValueError
99+
# C1: Invalid tth value of > 180 degrees, no wavelength, expect two theta ValueError
100100
(
101101
None,
102102
np.array([0, 30, 60, 90, 120, 181]),
103103
ValueError,
104104
"Two theta exceeds 180 degrees. Please check the input values for errors.",
105105
),
106-
# C2: invalid tth value of > 180 degrees with wavelength, expect two theta ValueError
106+
# C2: Invalid tth value of > 180 degrees with wavelength, expect two theta ValueError
107107
(
108108
4 * np.pi,
109109
np.array([0, 30, 60, 90, 120, 181]),
@@ -121,16 +121,16 @@ def test_tth_to_q_bad(wavelength, tth, expected_error_type, expected_error_msg):
121121
"q, expected_d, warning_expected",
122122
[
123123
# Test conversion of q to d with valid values
124-
# C1: empty q values, expect empty d values
124+
# C1: Empty q values, expect empty d values
125125
(np.array([]), np.array([]), False),
126126
# C2:
127-
# 1. valid q values, expect d values without warning
127+
# 1. Valid q values, expect d values without warning
128128
(
129129
np.array([0.1, 1 * np.pi, 2 * np.pi, 3 * np.pi, 4 * np.pi, 5 * np.pi]),
130130
np.array([62.83185307, 2, 1, 0.66667, 0.5, 0.4]),
131131
False,
132132
),
133-
# 2. valid q values containing 0, expect d values with divide by zero warning
133+
# 2. Valid q values containing 0, expect d values with divide by zero warning
134134
(
135135
np.array([0, 1 * np.pi, 2 * np.pi, 3 * np.pi, 4 * np.pi, 5 * np.pi]),
136136
np.array([np.inf, 2, 1, 0.66667, 0.5, 0.4]),
@@ -173,9 +173,9 @@ def test_d_to_q(d, expected_q, zero_divide_error_expected):
173173
"wavelength, tth, expected_d, divide_by_zero_warning_expected",
174174
[
175175
# Test conversion of q to d with valid values
176-
# C1: empty tth values, no, expect empty d values
176+
# C1: Empty tth values, no, expect empty d values
177177
(None, np.array([]), np.array([]), False),
178-
# C2: empty tth values, wavelength provided, expect empty d values
178+
# C2: Empty tth values, wavelength provided, expect empty d values
179179
(4 * np.pi, np.array([]), np.array([]), False),
180180
# C3: User specified valid tth values between 0-180 degrees (without wavelength)
181181
(None, np.array([0, 30, 60, 90, 120, 180]), np.array([0, 1, 2, 3, 4, 5]), False),
@@ -203,14 +203,14 @@ def test_tth_to_d(wavelength, tth, expected_d, divide_by_zero_warning_expected,
203203
@pytest.mark.parametrize(
204204
"wavelength, tth, expected_error_type, expected_error_msg",
205205
[
206-
# C1: user specified an invalid tth value of > 180 degrees (without wavelength)
206+
# C1: User specified an invalid tth value of > 180 degrees (without wavelength)
207207
(
208208
None,
209209
np.array([0, 30, 60, 90, 120, 181]),
210210
ValueError,
211211
"Two theta exceeds 180 degrees. Please check the input values for errors.",
212212
),
213-
# C2: user specified an invalid tth value of > 180 degrees (with wavelength)
213+
# C2: User specified an invalid tth value of > 180 degrees (with wavelength)
214214
(
215215
4 * np.pi,
216216
np.array([0, 30, 60, 90, 120, 181]),
@@ -259,9 +259,9 @@ def test_d_to_tth(wavelength, d, expected_tth, divide_by_zero_warning_expected,
259259
@pytest.mark.parametrize(
260260
"wavelength, d, expected_error_type",
261261
[
262-
# C1: user specified invalid d values that result in tth > 180 degrees
262+
# C1: User specified invalid d values that result in tth > 180 degrees
263263
(4 * np.pi, np.array([1.2, 1, 0.8, 0.6, 0.4, 0.2]), ValueError),
264-
# C2: user specified a wrong wavelength that result in tth > 180 degrees
264+
# C2: User specified a wrong wavelength that result in tth > 180 degrees
265265
(100, np.array([1.2, 1, 0.8, 0.6, 0.4, 0.2]), ValueError),
266266
],
267267
)

0 commit comments

Comments
 (0)