diff --git a/pymatgen/core/periodic_table.py b/pymatgen/core/periodic_table.py index 0dc1cf08641..a70aa046fe5 100644 --- a/pymatgen/core/periodic_table.py +++ b/pymatgen/core/periodic_table.py @@ -14,6 +14,7 @@ from typing import TYPE_CHECKING import numpy as np +from monty.dev import deprecated from monty.json import MSONable from pymatgen.core.units import SUPPORTED_UNIT_NAMES, FloatWithUnit, Ha_to_eV, Length, Mass, Unit @@ -696,10 +697,23 @@ def is_post_transition_metal(self) -> bool: return self.symbol in ("Al", "Ga", "In", "Tl", "Sn", "Pb", "Bi") @property + @deprecated( + message="Please use is_rare_earth instead, which is corrected to include Y and Sc.", deadline=(2025, 1, 1) + ) def is_rare_earth_metal(self) -> bool: - """True if element is a rare earth metal.""" + """True if element is a rare earth metal, Lanthanides (La) series and Actinides (Ac) series. + + This property is Deprecated, and scheduled for removal after 2025-01-01. + """ return self.is_lanthanoid or self.is_actinoid + @property + def is_rare_earth(self) -> bool: + """True if element is a rare earth element, including Lanthanides (La) + series, Actinides (Ac) series, Scandium (Sc) and Yttrium (Y). + """ + return self.is_lanthanoid or self.is_actinoid or self.symbol in {"Sc", "Y"} + @property def is_metal(self) -> bool: """True if is a metal.""" diff --git a/requirements.txt b/requirements.txt index 89b7dd125d7..787b6b1c803 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ numpy==1.26.0 sympy==1.12 requests==2.32.0 -monty==2024.2.26 +monty==2024.5.24 ruamel.yaml==0.18.6 scipy==1.11.3 tabulate==0.9.0