Skip to content

Commit 598fea9

Browse files
committed
drop unnecessary temp config recording
1 parent 2ac22ff commit 598fea9

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/pymatgen/io/vasp/inputs.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2152,21 +2152,17 @@ def electron_configuration(self) -> list[tuple[int, str, float]]:
21522152
raise RuntimeError("Cannot find entries in POTCAR.")
21532153
num_entries: int = int(match_entries.group(1))
21542154

2155+
# Get valence electron configuration (defined by ZVAL)
21552156
l_map: dict[int, str] = {0: "s", 1: "p", 2: "d", 3: "f", 4: "g", 5: "h"}
2156-
all_config: list[tuple[int, str, float]] = []
2157-
for line in lines[start_idx + 3 : start_idx + 3 + num_entries]:
2158-
parts = line.split()
2159-
n, ang_moment, _j, _E, occ = int(parts[0]), int(parts[1]), float(parts[2]), float(parts[3]), float(parts[4])
21602157

2161-
all_config.append((n, l_map[ang_moment], occ))
2162-
2163-
# Get valence electron configuration (defined by ZVAL)
2164-
valence_config: list[tuple[int, str, float]] = []
21652158
total_electrons = 0.0
2159+
valence_config: list[tuple[int, str, float]] = []
2160+
for line in lines[start_idx + 3 + num_entries - 1 : start_idx + 2 : -1]:
2161+
parts = line.split()
2162+
n, ang_moment, _j, _E, occ = int(parts[0]), int(parts[1]), float(parts[2]), float(parts[3]), float(parts[4])
21662163

2167-
for n, subshell, occ in reversed(all_config):
21682164
if occ >= 0.01: # TODO: hard-coded occupancy cutoff
2169-
valence_config.append((n, subshell, occ))
2165+
valence_config.append((n, l_map[ang_moment], occ))
21702166
total_electrons += occ
21712167

21722168
if total_electrons >= self.zval:

0 commit comments

Comments
 (0)