Skip to content

Commit

Permalink
Fix selective_dyn handling (materialsproject#4097)
Browse files Browse the repository at this point in the history
Co-authored-by: Shyue Ping Ong <[email protected]>
  • Loading branch information
kavanase and shyuep authored Oct 23, 2024
1 parent 930ae36 commit 3ee17e2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pymatgen/io/vasp/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1510,8 +1510,9 @@ def _parse_structure(self, elem: XML_Element) -> Structure:
lattice = _parse_vasp_array(elem.find("crystal").find("varray")) # type: ignore[union-attr]
pos = _parse_vasp_array(elem.find("varray"))
struct = Structure(lattice, self.atomic_symbols, pos)
selective_dyn = elem.find("varray/[@name='selective']")

if selective_dyn := elem.find("varray/[@name='selective']"):
if selective_dyn is not None:
struct.add_site_property("selective_dynamics", _parse_vasp_array(selective_dyn))
return struct

Expand Down

0 comments on commit 3ee17e2

Please sign in to comment.