Skip to content

Commit e79a2fd

Browse files
fix: updates for fixtures and tools
1 parent eb5b771 commit e79a2fd

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/diffpy/labpdfproc/tools.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import copy
22
from pathlib import Path
33

4-
from diffpy.labpdfproc.mud_calculator import compute_mud
5-
from diffpy.utils.scattering_objects.diffraction_objects import QQUANTITIES, XQUANTITIES
6-
from diffpy.utils.tools import get_package_info, get_user_info
4+
from diffpy.utils.diffraction_objects import ANGLEQUANTITIES, QQUANTITIES, XQUANTITIES
5+
from diffpy.utils.tools import compute_mud, get_package_info, get_user_info
76

87
WAVELENGTHS = {"Mo": 0.71, "Ag": 0.59, "Cu": 1.54}
98
known_sources = [key for key in WAVELENGTHS.keys()]
@@ -154,7 +153,9 @@ def set_xtype(args):
154153
"""
155154
if args.xtype.lower() not in XQUANTITIES:
156155
raise ValueError(f"Unknown xtype: {args.xtype}. Allowed xtypes are {*XQUANTITIES, }.")
157-
args.xtype = "q" if args.xtype.lower() in QQUANTITIES else "tth"
156+
args.xtype = (
157+
"q" if args.xtype.lower() in QQUANTITIES else "tth" if args.xtype.lower() in ANGLEQUANTITIES else "d"
158+
)
158159
return args
159160

160161

@@ -236,10 +237,9 @@ def load_user_info(args):
236237
the updated argparse Namespace with username and email inserted
237238
238239
"""
239-
config = {"username": args.username, "email": args.email}
240-
config = get_user_info(config)
241-
args.username = config["username"]
242-
args.email = config["email"]
240+
config = get_user_info(owner_name=args.username, owner_email=args.email)
241+
args.username = config["owner_name"]
242+
args.email = config["owner_email"]
243243
return args
244244

245245

tests/test_fixtures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import pytest
44

5-
from diffpy.utils.parsers import loadData
5+
from diffpy.utils.parsers.loaddata import loadData
66

77

88
# Test that our readable and unreadable files are indeed readable and

tests/test_tools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
set_wavelength,
1919
set_xtype,
2020
)
21-
from diffpy.utils.scattering_objects.diffraction_objects import XQUANTITIES
21+
from diffpy.utils.diffraction_objects import XQUANTITIES
2222

2323
# Use cases can be found here: https://github.com/diffpy/diffpy.labpdfproc/issues/48
2424

@@ -194,7 +194,7 @@ def test_set_wavelength_bad(inputs, msg):
194194
params4 = [
195195
([], ["tth"]),
196196
(["--xtype", "2theta"], ["tth"]),
197-
(["--xtype", "d"], ["tth"]),
197+
(["--xtype", "d"], ["d"]),
198198
(["--xtype", "q"], ["q"]),
199199
]
200200

0 commit comments

Comments
 (0)