File tree 2 files changed +5
-17
lines changed
2 files changed +5
-17
lines changed Original file line number Diff line number Diff line change @@ -297,7 +297,7 @@ def _preprocess_args(args):
297
297
args = load_user_info (args )
298
298
args = set_input_lists (args )
299
299
args .output_directory = set_output_directory (args )
300
- args . wavelength = set_wavelength (args )
300
+ args = set_wavelength (args )
301
301
args = load_user_metadata (args )
302
302
return args
303
303
@@ -307,8 +307,6 @@ def test_load_metadata(mocker, user_filesystem):
307
307
cli_inputs = [
308
308
"2.5" ,
309
309
"." ,
310
- "--wavelength" ,
311
- "1.54" ,
312
310
"--user-metadata" ,
313
311
"key=value" ,
314
312
"--username" ,
@@ -323,8 +321,8 @@ def test_load_metadata(mocker, user_filesystem):
323
321
expected_metadata = {
324
322
"mud" : 2.5 ,
325
323
"input_directory" : str (filepath ),
326
- "anode_type" : "Cu " ,
327
- "wavelength" : 1.54 ,
324
+ "anode_type" : "Mo " ,
325
+ "wavelength" : 0.71 ,
328
326
"output_directory" : str (Path .cwd ().resolve ()),
329
327
"xtype" : "tth" ,
330
328
"key" : "value" ,
Original file line number Diff line number Diff line change @@ -217,18 +217,9 @@ def load_package_info(args):
217
217
return args
218
218
219
219
220
- def _set_anode_type (args ):
221
- if args .wavelength in WAVELENGTHS .values ():
222
- args .anode_type = next (key for key , value in WAVELENGTHS .items () if value == args .wavelength )
223
- else :
224
- delattr (args , "anode_type" )
225
- return args
226
-
227
-
228
220
def load_metadata (args , filepath ):
229
221
"""
230
- Load metadata from args,
231
- except for anode type if wavelength does not match, and do not load output_correction or force_overwrite
222
+ Load relevant metadata from args
232
223
233
224
Parameters
234
225
----------
@@ -237,10 +228,9 @@ def load_metadata(args, filepath):
237
228
238
229
Returns
239
230
-------
240
- A dictionary with all arguments from the parser
231
+ A dictionary with relevant arguments from the parser
241
232
"""
242
233
243
- args = _set_anode_type (args )
244
234
metadata = vars (args )
245
235
for key in METADATA_KEYS_TO_EXCLUDE :
246
236
metadata .pop (key , None )
You can’t perform that action at this time.
0 commit comments