Skip to content

Commit f5f3089

Browse files
authored
Bugfix for Interstitial Oxidation States (#208)
* Update `core.py` * Update core.py * Update test_core.py
1 parent 18dcfb6 commit f5f3089

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pymatgen/analysis/defects/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -706,9 +706,9 @@ def name(self) -> str:
706706
def defect_structure(self) -> Structure:
707707
"""Returns the defect structure."""
708708
struct: Structure = self.structure.copy()
709-
# use the highest value oxidation state among the two most popular ones
709+
# use the highest value oxidation state among the most popular ones
710710
# found in the ICSD
711-
inter_states = self.site.specie.icsd_oxidation_states[:2]
711+
inter_states = self.site.specie.common_oxidation_states
712712
if len(inter_states) == 0:
713713
_logger.warning(
714714
"No oxidation states found for %s. "

tests/test_core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ def test_interstitial(gan_struct) -> None:
119119
inter_fpos = [0, 0, 0.75]
120120
n_site = PeriodicSite(Specie("N"), inter_fpos, s.lattice)
121121
inter = Interstitial(s, n_site)
122-
assert inter.oxi_state == 3
123-
assert inter.get_charge_states() == [-1, 0, 1, 2, 3, 4]
122+
assert inter.oxi_state == 5
123+
assert inter.get_charge_states() == [-1, 0, 1, 2, 3, 4, 5, 6]
124124
assert np.allclose(inter.defect_structure[0].frac_coords, inter_fpos)
125125
sc = inter.get_supercell_structure()
126126
assert sc.formula == "Ga64 N65"

0 commit comments

Comments
 (0)