File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 3
3
from pathlib import Path
4
4
5
5
from diffpy .labpdfproc .functions import apply_corr , compute_cve
6
+ from diffpy .labpdfproc .tools import load_additional_info
6
7
from diffpy .utils .parsers .loaddata import loadData
7
8
from diffpy .utils .scattering_objects .diffraction_objects import XQUANTITIES , Diffraction_object
8
9
@@ -56,12 +57,21 @@ def get_args():
56
57
action = "store_true" ,
57
58
help = "outputs will not overwrite existing file unless --force is spacified" ,
58
59
)
60
+ p .add_argument (
61
+ "-add" ,
62
+ "--additional-info" ,
63
+ metavar = ("KEY=VALUE" ),
64
+ action = "append" ,
65
+ help = "specify key-value pairs to be loaded into metadata. You can specify multiple "
66
+ "paris by calling -add multiple times" ,
67
+ )
59
68
args = p .parse_args ()
60
69
return args
61
70
62
71
63
72
def main ():
64
73
args = get_args ()
74
+ args = load_additional_info (args )
65
75
wavelength = WAVELENGTHS [args .anode_type ]
66
76
filepath = Path (args .input_file )
67
77
outfilestem = filepath .stem + "_corrected"
Original file line number Diff line number Diff line change
1
+ def load_additional_info (args ):
2
+ if args .additional_info :
3
+ for item in args .additional_info :
4
+ key , value = item .split ("=" )
5
+ setattr (args , key , value )
6
+ delattr (args , "additional_info" )
7
+ return args
You can’t perform that action at this time.
0 commit comments