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

Wrong name of Pourbaix Entry #3349

Closed
yuxin-chang opened this issue Sep 25, 2023 · 2 comments
Closed

Wrong name of Pourbaix Entry #3349

yuxin-chang opened this issue Sep 25, 2023 · 2 comments

Comments

@yuxin-chang
Copy link

The ion entry of Sn was in a wrong name:
the ion entry with composition Sn1 O2 H1 has name SnOH2[+1]
the ion entry with composition H1 Sn1 O2 has name SnOH2[-1]
As printed out, the number of O and H are opposite

mpr = MPRester()
entries = mpr.get_pourbaix_entries([ "Sn"])
for entry in entries:
    print(entry.name,entry.composition )

The output is:
Sn[+2] Sn1
SnOH[+1] Sn1 O1 H1
SnOH2[+1] Sn1 O2 H1
SnO3[-2] Sn1 O3
SnOH2[-1] H1 Sn1 O2
Sn[+4] Sn1

@shyuep
Copy link
Member

shyuep commented Sep 25, 2023

What is your MPRester version? Also, this should be reported to the mp-api package since it has nothing to do with pymatgen.

@shyuep shyuep closed this as completed Sep 25, 2023
@rkingsbury
Copy link
Contributor

@yuxin-chang I thought this was an issue in Ion.reduced_formula, but I'm not able to reproduce:

>>> from pymatgen.core.ion import Ion
>>> i=Ion.from_formula('SnHO2+')
>>> print(i.reduced_formula, i.composition)
SnHO2[+1] Sn1 H1 O2
>>> i=Ion.from_formula('SnHO2-')
>>> print(i.reduced_formula, i.composition)
SnHO2[-1] Sn1 H1 O2

Please update your pymatgen and mp-api clients to the latest versions and let us know if this is still a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants