Skip to content

Commit

Permalink
fix chempot_diagram (#4072)
Browse files Browse the repository at this point in the history
  • Loading branch information
yang-ruoxi committed Sep 18, 2024
1 parent 150f816 commit d6204d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pymatgen/analysis/chempot_diagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d6204d9

Please sign in to comment.