Skip to content

Commit 0e86148

Browse files
committed
changed create_parser
Fixed typo in line 22, renamed 'lift' to 'lift_factor', made ALLOWED_DATA_TYPES global variable
1 parent d6730ec commit 0e86148

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

diffpy/snmf/stretchednmfapp.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import argparse
33
from pathlib import Path
44

5+
ALLOWED_DATA_TYPES = ['powder_diffraction', 'pd', 'pair_distribution_function', 'pdf']
6+
57

68
def create_parser():
79
parser = argparse.ArgumentParser(
@@ -12,15 +14,16 @@ def create_parser():
1214
help="Directory containing experimental data. Defaults to current working directory.")
1315
parser.add_argument('-o', '--output-directory', type=str,
1416
help="The directory where the results will be written. Defaults to '<input_directory/snmf_results>'.")
15-
parser.add_argument('t', '--data-type', type=str, choices=['powder_diffraction', 'pdf'],
17+
parser.add_argument('t', '--data-type', type=str, choices=ALLOWED_DATA_TYPES,
1618
help="The type of the experimental data.")
17-
parser.add_argument('-l', '--lift', type=float, default=1,
19+
parser.add_argument('-l', '--lift-factor', type=float, default=1,
1820
help="The lifting factor. Data will be lifted by lifted_data = data + abs(min(data) * lift). Default is 1.")
19-
parser.add_argument('components', type=int,
20-
help="he number of component signals for the NMF decomposition. Must be an integer greater than 0")
21+
parser.add_argument('number-of-components', type=int,
22+
help="The number of component signals for the NMF decomposition. Must be an integer greater than 0")
2123
parser.add_argument('-v', '--version', action='version', help='Print the software version number')
2224
args = parser.parse_args()
2325
return args
2426

27+
2528
def main():
2629
pass

0 commit comments

Comments
 (0)