Skip to content

style: convert variables to lowercase #159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 21, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions news/lowercasing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* Conform variable names to PEP-8

**Security:**

* <news item>
23 changes: 14 additions & 9 deletions src/diffpy/snmf/main.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import numpy as np
from snmf_class import SNMFOptimizer

X0 = np.loadtxt("input/X0.txt", dtype=float)
MM = np.loadtxt("input/MM.txt", dtype=float)
A0 = np.loadtxt("input/A0.txt", dtype=float)
Y0 = np.loadtxt("input/W0.txt", dtype=float)
N, M = MM.shape
init_comps_file = np.loadtxt("input/X0.txt", dtype=float)
source_matrix_file = np.loadtxt("input/MM.txt", dtype=float)
init_stretch_file = np.loadtxt("input/A0.txt", dtype=float)
init_weights_file = np.loadtxt("input/W0.txt", dtype=float)

my_model = SNMFOptimizer(
source_matrix=source_matrix_file,
init_weights=init_weights_file,
init_comps=init_comps_file,
init_stretch=init_stretch_file,
)

my_model = SNMFOptimizer(MM=MM, Y0=Y0, X0=X0, A0=A0)
print("Done")
np.savetxt("my_norm_X.txt", my_model.X, fmt="%.6g", delimiter=" ")
np.savetxt("my_norm_Y.txt", my_model.Y, fmt="%.6g", delimiter=" ")
np.savetxt("my_norm_A.txt", my_model.A, fmt="%.6g", delimiter=" ")
np.savetxt("my_norm_comps.txt", my_model.comps, fmt="%.6g", delimiter=" ")
np.savetxt("my_norm_weights.txt", my_model.weights, fmt="%.6g", delimiter=" ")
np.savetxt("my_norm_stretch.txt", my_model.stretch, fmt="%.6g", delimiter=" ")
Loading