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: default hydrates=False in reduced_formula #3350

Merged
merged 3 commits into from
Oct 9, 2023

Conversation

rkingsbury
Copy link
Contributor

Summary

Major changes:

  • default to hydrates=False in Ion.get_reduced_formula_and_factor()
  • explicitly use Ion.get_reduced_formula_and_factor() rather than super().get_reduced_formula_and_factor() in `reduced_formula

Checklist

  • Google format doc strings added. Check with ruff.
  • Type annotations included. Check with mypy.
  • Tests added for new features/fixes.

@janosh
Copy link
Member

janosh commented Oct 6, 2023

@rkingsbury Is this intentionally in draft mode?

@rkingsbury rkingsbury marked this pull request as ready for review October 9, 2023 11:01
@rkingsbury
Copy link
Contributor Author

@janosh it was intentional, but I think it's good to go. All tests pass, but I wanted to make sure that this didn't mess up anything on the API side. When we re-did the Pourbaix ion data, I used Ion.reduced_formula as the database keys (the MPContribs identifiers). However, it doesn't appear that any of the ions in the dataset were formatted as hydrates (for example, Be3(OH)3[3+] is listed there, but could be written Be3OH2.1H2O).

In the API client, the only call is Ion.from_formula() (here) followed by Ion.composition so I don't think this change will cause any problems.

@janosh janosh added breaking Breaking change core Pymatgen core labels Oct 9, 2023
@janosh janosh merged commit 16c0dac into materialsproject:master Oct 9, 2023
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking change core Pymatgen core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants