From d6204d942b79f72e91e8f70088bb7d25823a62e6 Mon Sep 17 00:00:00 2001 From: ruoxi yang Date: Tue, 17 Sep 2024 18:08:36 -0700 Subject: [PATCH] fix chempot_diagram (#4072) --- src/pymatgen/analysis/chempot_diagram.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pymatgen/analysis/chempot_diagram.py b/src/pymatgen/analysis/chempot_diagram.py index b051f58321e..6247aed2e15 100644 --- a/src/pymatgen/analysis/chempot_diagram.py +++ b/src/pymatgen/analysis/chempot_diagram.py @@ -646,7 +646,7 @@ def simple_pca(data: np.ndarray, k: int = 2) -> tuple[np.ndarray, np.ndarray, np Returns: tuple: projected data, eigenvalues, eigenvectors """ - data -= np.mean(data.T, axis=1) # centering the data + data = data - np.mean(data.T, axis=1) # centering the data cov = np.cov(data.T) # calculating covariance matrix v, w = np.linalg.eig(cov) # performing eigendecomposition idx = v.argsort()[::-1] # sorting the components