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

Ion: fix CO2- and I3- parsing errors; enhance tests #3991

Merged
merged 1 commit into from
Aug 11, 2024

Conversation

rkingsbury
Copy link
Contributor

Summary

My recent PR #3942 contained two bugs that were revealed by testing in downstream code (see pyEQL PR). This PR fixes those and expands the unit tests to catch them.

>>> Ion.from_formula('CO2-').reduced_formula
'C2O4[-0.5]'
>>> Ion.from_formula('CO2--').reduced_formula
'C2O4[-1]'
>>> Ion.from_formula('I3-').get_reduced_formula_and_factor()
('I3', 1.0)
>>> Ion.from_formula('I-').get_reduced_formula_and_factor()
('I3', 0.3333333333333333)

@rkingsbury
Copy link
Contributor Author

rkingsbury commented Aug 9, 2024

@janosh I request a quick merge and release on this one so that it doesn't adversely affect anyone doing aqueous work (e.g. Pourbaix diagrams) that involve I[-1]. Sorry I didn't catch this in the original PR!

Copy link
Member

@janosh janosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @rkingsbury! 👍

@janosh janosh merged commit b28c937 into materialsproject:master Aug 11, 2024
33 checks passed
@janosh janosh added fix Bug fix PRs core Pymatgen core labels Sep 10, 2024
@rkingsbury rkingsbury deleted the bugfix branch October 10, 2024 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Pymatgen core fix Bug fix PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants