MaterialsProject 2020 Compatibility was implicitly changed from v2024.7.18

Let me share because this was puzzling to me in the first place, although it is an edge case.

The current Materials Project database says the GGA energy of Au4Sb8 (mp-738) is corrected by -0.13 eV/atom.
However, I think this correction was not applied in previous versions.

I think this came from [this commit] (Fix doc of oxidation_state_guesses. Fixes #3867. · materialsproject/pymatgen@cc663cc · GitHub), which changes candidate oxidation states from Element.oxidation_states to Element.common_oxidation_states in Composition.get_oxidation_guesses.
Composition.get_oxidation_guesses is called from MaterialsProject2020Compatibility to get oxidation states for anion species, including Sb.
The previous pymatgen (<=2024.6.10) assigns a negative oxidation state for Au, and a positive one for Sb, which results in no anion correction.
The fixed version only assigns a positive oxidation state for Au and is now negative for Sb, which results in artificial anion correction.

Scripts

from importlib.metadata import version
print(f'pymatgen: {version('pymatgen')}')

from pymatgen.core import Composition

c = Composition('Au4Sb8')
print(c._get_oxi_state_guesses(all_oxi_states=False, max_sites=-20, oxi_states_override=None, target_charge=0))
pymatgen: 2024.7.18
(({'Au': 3.0, 'Sb': -1.5},), ({'Au': (3,), 'Sb': (-2, -1)},))
pymatgen: 2024.6.10
(({'Au': -1.0, 'Sb': 0.5}, {'Au': 5.0, 'Sb': -2.5}, {'Au': 3.0, 'Sb': -1.5}, {'Au': 2.0, 'Sb': -1.0}), ({'Au': (-1,), 'Sb': (-2, 3)}, {'Au': (5,), 'Sb': (-2, -3)}, {'Au': (3,), 'Sb': (-2, -1)}, {'Au': (2,), 'Sb': (-1, -1)}))

Thanks @lan496! This looks to be related to a larger change in how oxidation states are assigned to compositions. Running your snippet with the most up-to-date pymatgen (2025.3.10) shows the same behavior as 2024.7.18

This might require refitting of the actual corrections scheme or further discussion on our side about fixing this. Assigning oxidation states especially by composition isn’t precise, and the corrections shouldn’t depend so sensitively on oxidation states

Thanks for your response! I realize that it is challenging to assign oxidation states from composition robustly