4
4
from diffpy .utils .diffraction_objects import ANGLEQUANTITIES , QQUANTITIES , XQUANTITIES
5
5
from diffpy .utils .tools import check_and_build_global_config , compute_mud , get_package_info , get_user_info
6
6
7
- WAVELENGTHS = {"Mo" : 0.71 , "Ag" : 0.59 , "Cu" : 1.54 }
7
+ WAVELENGTHS = {"Mo" : 0.71073 , "Ag" : 0.55941 , "Cu" : 1.5406 }
8
8
known_sources = [key for key in WAVELENGTHS .keys ()]
9
9
10
10
# Exclude wavelength from metadata to prevent duplication,
@@ -225,7 +225,8 @@ def load_user_metadata(args):
225
225
226
226
def load_user_info (args ):
227
227
"""
228
- Update username and email using get_user_info function from diffpy.utils
228
+ Load user info into args. If args are not provided, call check_and_build_global_config function from
229
+ diffpy.utils to prompt the user for inputs. Otherwise, call get_user_info with the provided arguments.
229
230
230
231
Parameters
231
232
----------
@@ -237,10 +238,11 @@ def load_user_info(args):
237
238
the updated argparse Namespace with username and email inserted
238
239
239
240
"""
240
- check_and_build_global_config ()
241
+ if args .username is None or args .email is None :
242
+ check_and_build_global_config ()
241
243
config = get_user_info (owner_name = args .username , owner_email = args .email )
242
- args .username = config [ "owner_name" ]
243
- args .email = config [ "owner_email" ]
244
+ args .username = config . get ( "owner_name" )
245
+ args .email = config . get ( "owner_email" )
244
246
return args
245
247
246
248
0 commit comments