Skip to content

Commit 7118dd2

Browse files
author
John Halloran
committed
chore: convert variables to lowercase
1 parent 373da11 commit 7118dd2

File tree

2 files changed

+318
-275
lines changed

2 files changed

+318
-275
lines changed

src/diffpy/snmf/main.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
import numpy as np
22
from snmf_class import SNMFOptimizer
33

4-
X0 = np.loadtxt("input/X0.txt", dtype=float)
5-
MM = np.loadtxt("input/MM.txt", dtype=float)
6-
A0 = np.loadtxt("input/A0.txt", dtype=float)
7-
Y0 = np.loadtxt("input/W0.txt", dtype=float)
8-
N, M = MM.shape
4+
init_comps_file = np.loadtxt("input/X0.txt", dtype=float)
5+
source_matrix_file = np.loadtxt("input/MM.txt", dtype=float)
6+
init_stretch_file = np.loadtxt("input/A0.txt", dtype=float)
7+
init_weights_file = np.loadtxt("input/W0.txt", dtype=float)
8+
9+
my_model = SNMFOptimizer(
10+
source_matrix=source_matrix_file,
11+
init_weights=init_weights_file,
12+
init_comps=init_comps_file,
13+
init_stretch=init_stretch_file,
14+
)
915

10-
my_model = SNMFOptimizer(MM=MM, Y0=Y0, X0=X0, A0=A0)
1116
print("Done")
12-
np.savetxt("my_norm_X.txt", my_model.X, fmt="%.6g", delimiter=" ")
13-
np.savetxt("my_norm_Y.txt", my_model.Y, fmt="%.6g", delimiter=" ")
14-
np.savetxt("my_norm_A.txt", my_model.A, fmt="%.6g", delimiter=" ")
17+
np.savetxt("my_norm_comps.txt", my_model.comps, fmt="%.6g", delimiter=" ")
18+
np.savetxt("my_norm_weights.txt", my_model.weights, fmt="%.6g", delimiter=" ")
19+
np.savetxt("my_norm_stretch.txt", my_model.stretch, fmt="%.6g", delimiter=" ")

0 commit comments

Comments
 (0)