Skip to content

Ion: default hydrates=False in reduced_formula - #3350

Merged
janosh merged 3 commits into
materialsproject:masterfrom
rkingsbury:ion_rform
Oct 9, 2023
Merged

janosh merged 3 commits into
materialsproject:masterfrom
rkingsbury:ion_rform

Conversation

@rkingsbury

Copy link
Copy Markdown
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

janosh commented Oct 6, 2023

Copy link
Copy Markdown
Member

@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
Copy Markdown
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
@rkingsbury
rkingsbury deleted the ion_rform branch October 10, 2024 01:55
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.

2 participants