Skip to content

Commit d6730ec

Browse files
committed
initial commit stretchednmfapp.py
1 parent 6f6bda8 commit d6730ec

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

diffpy/snmf/stretchednmfapp.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import numpy as np
2+
import argparse
3+
from pathlib import Path
4+
5+
6+
def create_parser():
7+
parser = argparse.ArgumentParser(
8+
prog="stretched_nmf",
9+
description="Stretched Nonnegative Matrix Factorization"
10+
)
11+
parser.add_argument('-i', '--input-directory', type=str, default=None,
12+
help="Directory containing experimental data. Defaults to current working directory.")
13+
parser.add_argument('-o', '--output-directory', type=str,
14+
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'],
16+
help="The type of the experimental data.")
17+
parser.add_argument('-l', '--lift', type=float, default=1,
18+
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('-v', '--version', action='version', help='Print the software version number')
22+
args = parser.parse_args()
23+
return args
24+
25+
def main():
26+
pass

0 commit comments

Comments
 (0)