From f91c0195c71a599d6925026a0fb873c223d0c3f7 Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Thu, 14 Dec 2023 16:15:59 -0800 Subject: [PATCH] better var names --- pymatgen/phonon/bandstructure.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pymatgen/phonon/bandstructure.py b/pymatgen/phonon/bandstructure.py index 0c5c17e5968..c052e00ee8e 100644 --- a/pymatgen/phonon/bandstructure.py +++ b/pymatgen/phonon/bandstructure.py @@ -140,17 +140,17 @@ def __init__( self.nac_frequencies = [] self.nac_eigendisplacements = [] if nac_frequencies is not None: - for t in nac_frequencies: - self.nac_frequencies.append(([i / np.linalg.norm(t[0]) for i in t[0]], t[1])) + for freq in nac_frequencies: + self.nac_frequencies.append(([idx / np.linalg.norm(freq[0]) for idx in freq[0]], freq[1])) if nac_eigendisplacements is not None: - for t in nac_eigendisplacements: - self.nac_eigendisplacements.append(([i / np.linalg.norm(t[0]) for i in t[0]], t[1])) + for freq in nac_eigendisplacements: + self.nac_eigendisplacements.append(([idx / np.linalg.norm(freq[0]) for idx in freq[0]], freq[1])) def min_freq(self) -> tuple[Kpoint, float]: """Returns the point where the minimum frequency is reached and its value.""" - i = np.unravel_index(np.argmin(self.bands), self.bands.shape) + idx = np.unravel_index(np.argmin(self.bands), self.bands.shape) - return self.qpoints[i[1]], self.bands[i] + return self.qpoints[idx[1]], self.bands[idx] def has_imaginary_freq(self, tol: float = 1e-5) -> bool: """True if imaginary frequencies are present in the BS."""