Skip to content

Commit 1dc6972

Browse files
fix: removed mu*D requirement for one of the error msg
1 parent 468f436 commit 1dc6972

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

Diff for: src/diffpy/labpdfproc/tools.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,7 @@ def set_wavelength(args):
175175
ValueError
176176
Raised if:
177177
(1) neither wavelength or anode type is provided,
178-
and either mu*D needs to be looked up or
179-
xtype is not the two-theta grid,
178+
and xtype is not the two-theta grid,
180179
(2) both are provided,
181180
(3) anode_type is not one of the known sources,
182181
(4) wavelength is non-positive.
@@ -188,11 +187,10 @@ def set_wavelength(args):
188187
"""
189188
# first load values from config file
190189
if args.wavelength is None and args.anode_type is None:
191-
# either mu*D needs to be looked up or
192-
# xtype is not the two-theta grid
193-
if args.mud is None or args.xtype not in ANGLEQUANTITIES:
190+
if args.xtype not in ANGLEQUANTITIES:
194191
raise ValueError(
195-
f"Please provide a wavelength or anode type. "
192+
f"Please provide a wavelength or anode type "
193+
f"because the independent variable axis is not on two-theta. "
196194
f"Allowed anode types are {*known_sources, }."
197195
)
198196
elif args.wavelength is not None and args.anode_type is not None:

Diff for: tests/test_tools.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,13 @@ def test_set_wavelength(inputs, expected):
257257
@pytest.mark.parametrize(
258258
"inputs, expected_error_msg",
259259
[
260-
( # C1.1: nothing passed in, xtype is not on tth
260+
( # C1: nothing passed in, xtype is not on tth
261261
# expect error asking for either wavelength or anode type
262262
["--xtype", "q"],
263-
f"Please provide a wavelength or anode type. "
263+
f"Please provide a wavelength or anode type "
264+
f"because the independent variable axis is not on two-theta. "
264265
f"Allowed anode types are {*known_sources, }.",
265266
),
266-
# C1.2: nothing passed in, need to look up mu*D
267-
# expect error asking for either wavelength or anode type
268267
( # C2: both wavelength and anode type were specified
269268
# expect error asking not to specify both
270269
["--wavelength", "0.7", "--anode-type", "Mo"],

0 commit comments

Comments
 (0)