-
Notifications
You must be signed in to change notification settings - Fork 40
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
Pourbaix: fix filtering extra elements #606
Conversation
@mkhorton this PR fixes the bug you found related to element filtering. However, in the course of debugging I noticed that the energies of all Pourbaix entries returned by this package differ from those returned by the legeacy For example, the legacy client returns the following
while the new client (in this package) returns
It's unclear why this is happening, as all the arguments related to corrections, etc. are identical between the old and new clients. This may be related to collection differences? Because If I just examine the solid entry using
from the legacy client and
from the new client. |
Also, all CI tests seem to be failing due to a missing API key:
|
No API key is normal. If the tests pass locally, I can merge and it should be fine. Let me know when you are good to go. Also, just an FYI that the difference in the energy for that material appears to be from the removal of an incorrect anion correction applied to sulfur in the new data. |
OK, that makes sense. I was primarily looking at sulfur-containing systems so that must have been the origin of the discrepancy. I checked some other systems and the differences were smaller or non-existent. I'm good. |
Thanks for taking a look and offering this fix @rkingsbury! |
itertools.chain.from_iterable(i.elements for i in ion_ref_comps) | ||
) | ||
# TODO - would be great if the commented line below would work | ||
# However for some reason you cannot process GibbsComputedStructureEntry with | ||
# MaterialsProjectAqueousCompatibility | ||
ion_ref_entries = self.get_entries_in_chemsys( | ||
list(set([str(e) for e in ion_ref_elts] + ["O", "H"])), | ||
list([str(e) for e in ion_ref_elts] + ["O", "H"]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This list()
is redundant
Fixes bug in which
get_pourbaix_entries
was not properly filtering out extra elements (i.e., solid entries included in the internal phase diagram because they are reference solids for ions, but that are not part of the originally-supplied chemical system)Contributor Checklist