44from diffpy .utils .diffraction_objects import ANGLEQUANTITIES , QQUANTITIES , XQUANTITIES
55from diffpy .utils .tools import check_and_build_global_config , compute_mud , get_package_info , get_user_info
66
7- WAVELENGTHS = {"Mo" : 0.71 , "Ag" : 0.59 , "Cu" : 1.54 }
7+ WAVELENGTHS = {"Mo" : 0.71073 , "Ag" : 0.55941 , "Cu" : 1.5406 }
88known_sources = [key for key in WAVELENGTHS .keys ()]
99
1010# Exclude wavelength from metadata to prevent duplication,
@@ -225,7 +225,8 @@ def load_user_metadata(args):
225225
226226def load_user_info (args ):
227227 """
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.
229230
230231 Parameters
231232 ----------
@@ -237,10 +238,11 @@ def load_user_info(args):
237238 the updated argparse Namespace with username and email inserted
238239
239240 """
240- check_and_build_global_config ()
241+ if args .username is None or args .email is None :
242+ check_and_build_global_config ()
241243 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" )
244246 return args
245247
246248
0 commit comments