pymatgen icon indicating copy to clipboard operation
pymatgen copied to clipboard

Ion.oxi_state_guesses fails for 'Br' or 'Br(aq)'

Open rkingsbury opened this issue 1 year ago • 0 comments

Python version

Python 3.10.6

Pymatgen version

Version: 2024.2.8

Operating system version

Ubuntu (Windows WSL2)

Current behavior

Ion.oxi_state_guesses fails for Br, and for Br2 unless all_oxi_state_guesses is set. This is a problem because 1) Composition.oxi_state_guesses works in this case and 2) Br is the standard state of bromine

>>> from pymatgen.core.ion import Ion
>>> Ion.from_formula('Br').oxi_state_guesses()
()
>>> Ion.from_formula('Br').oxi_state_guesses(all_oxi_states=True)
()
>>> Ion.from_formula('Br2').oxi_state_guesses()
()
>>> Ion.from_formula('Br2').oxi_state_guesses(all_oxi_states=True)
({'Br': 0.0},)
>>> from pymatgen.core import Composition
>>> Composition('Br').oxi_state_guesses()
({'Br': 0.0},)

Expected Behavior

>>> Ion.from_formula('Br').oxi_state_guesses()
({'Br': 0.0},)
>>> Ion.from_formula('Br(aq)').oxi_state_guesses()
({'Br': 0.0},)

Minimal example

No response

Relevant files to reproduce this bug

No response

rkingsbury avatar Mar 13 '24 15:03 rkingsbury