Skip to content

Commit

Permalink
use symbol over sym as sym could be mistaken for symmetry?
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielYang59 committed Feb 1, 2025
1 parent c735cca commit 66da01c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/pymatgen/core/periodic_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ def __init__(self, symbol: SpeciesLike) -> None:

self._is_named_isotope = data.get("Is named isotope", False)
if self._is_named_isotope:
for sym, info in _PT_DATA.items():
for symbol, info in _PT_DATA.items():
if info["Atomic no"] == self.Z and not info.get("Is named isotope", False):
self.symbol = sym
self.symbol = symbol
break
# For specified/named isotopes, treat the same as named element
# (the most common isotope). Then we pad the data block with the
Expand Down Expand Up @@ -611,10 +611,10 @@ def from_Z(Z: int, A: int | None = None) -> Element:
Returns:
Element with atomic number Z.
"""
for sym, data in _PT_DATA.items():
for symbol, data in _PT_DATA.items():
atomic_mass_num = data.get("Atomic mass no") if A else None
if data["Atomic no"] == Z and atomic_mass_num == A:
return Element(sym)
return Element(symbol)

raise ValueError(f"Unexpected atomic number {Z=}")

Expand Down Expand Up @@ -659,8 +659,8 @@ def from_row_and_group(row: int, group: int) -> Element:
Note:
The 18 group number system is used, i.e. noble gases are group 18.
"""
for sym in _PT_DATA:
el = Element(sym)
for symbol in _PT_DATA:
el = Element(symbol)
if 57 <= el.Z <= 71:
el_pseudo_row = 8
el_pseudo_group = (el.Z - 54) % 32
Expand Down

0 comments on commit 66da01c

Please sign in to comment.