Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions dpdata/vasp/xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ def analyze_atominfo(atominfo_xml):
check_name(atominfo_xml.find("array"), "atoms")
eles = []
types = []
visited = set()
for ii in atominfo_xml.find("array").find("set"):
eles.append(ii.findall("c")[0].text.strip())
types.append(int(ii.findall("c")[1].text))
uniq_ele = []
for ii in eles:
if ii not in uniq_ele:
uniq_ele.append(ii)
return uniq_ele, types
atom_type = int(ii.findall("c")[1].text)
if atom_type not in visited:
eles.append(ii.findall("c")[0].text.strip())
visited.add(atom_type)
types.append(atom_type)
return eles, types


def analyze_calculation(cc):
Expand Down
Loading