Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Deprecation] Replace Element property is_rare_earth_metal with is_rare_earth to include Y and Sc #3817

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion pymatgen/core/periodic_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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."""
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down