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

Permit electrodes with non-TM redox active species #484

Merged
merged 1 commit into from Jul 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 16 additions & 13 deletions emmet-core/emmet/core/electrode.py
Expand Up @@ -289,19 +289,22 @@ def from_entries(

# Check if more than one working ion per transition metal and warn
warnings = []
transition_metal_fraction = sum(
[
discharge_comp.get_atomic_fraction(element)
for element in discharge_comp
if element.is_transition_metal
]
)
if (
discharge_comp.get_atomic_fraction(working_ion_ele)
/ transition_metal_fraction
> 1.0
):
warnings.append("More than one working ion per transition metal")
if any([element.is_transition_metal for element in discharge_comp]):
transition_metal_fraction = sum(
[
discharge_comp.get_atomic_fraction(element)
for element in discharge_comp
if element.is_transition_metal
]
)
if (
discharge_comp.get_atomic_fraction(working_ion_ele)
/ transition_metal_fraction
> 1.0
):
warnings.append("More than one working ion per transition metal")
else:
warnings.append("Transition metal not found")

return cls(
battery_id=battery_id,
Expand Down