|
1 | 1 | import copy |
2 | 2 | from pathlib import Path |
3 | 3 |
|
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 |
7 | 6 |
|
8 | 7 | WAVELENGTHS = {"Mo": 0.71, "Ag": 0.59, "Cu": 1.54} |
9 | 8 | known_sources = [key for key in WAVELENGTHS.keys()] |
@@ -154,7 +153,9 @@ def set_xtype(args): |
154 | 153 | """ |
155 | 154 | if args.xtype.lower() not in XQUANTITIES: |
156 | 155 | 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 | + ) |
158 | 159 | return args |
159 | 160 |
|
160 | 161 |
|
@@ -236,10 +237,9 @@ def load_user_info(args): |
236 | 237 | the updated argparse Namespace with username and email inserted |
237 | 238 |
|
238 | 239 | """ |
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"] |
243 | 243 | return args |
244 | 244 |
|
245 | 245 |
|
|
0 commit comments