We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb27e05 commit e948661Copy full SHA for e948661
dpdata/vasp/xml.py
@@ -22,14 +22,14 @@ def analyze_atominfo(atominfo_xml):
22
check_name(atominfo_xml.find("array"), "atoms")
23
eles = []
24
types = []
25
+ visited = set()
26
for ii in atominfo_xml.find("array").find("set"):
- eles.append(ii.findall("c")[0].text.strip())
27
- types.append(int(ii.findall("c")[1].text))
28
- uniq_ele = []
29
- for ii in eles:
30
- if ii not in uniq_ele:
31
- uniq_ele.append(ii)
32
- 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
33
34
35
def analyze_calculation(cc):
0 commit comments