File tree Expand file tree Collapse file tree 1 file changed +10
-16
lines changed
Expand file tree Collapse file tree 1 file changed +10
-16
lines changed Original file line number Diff line number Diff line change @@ -409,24 +409,18 @@ def get_frames(fname):
409409 cell .append (ii .split ()[4 :7 ])
410410 if "Atomic kind:" in ii :
411411 atom_symbol_list .append (ii .split ()[3 ])
412- if "Atom Kind Element" in ii :
412+
413+ # beginning of coords block
414+ if "Atom Kind Element" in ii or "Atom Kind Element" in ii :
413415 coord_flag = True
414- coord_idx = idx
416+ # parse coords lines
417+ elif coord_flag :
418+ if ii == "\n " :
419+ coord_flag = len (coord ) == 0 # skip empty line at the beginning
420+ else :
421+ coord .append (ii .split ()[4 :7 ])
422+ atom_symbol_idx_list .append (ii .split ()[1 ])
415423
416- # get the coord block info
417- if coord_flag :
418- if idx == coord_idx + 1 :
419- if ii == "\n " :
420- pass
421- else :
422- coord .append (ii .split ()[4 :7 ])
423- atom_symbol_idx_list .append (ii .split ()[1 ])
424- if idx > coord_idx + 1 :
425- if ii == "\n " :
426- coord_flag = False
427- else :
428- coord .append (ii .split ()[4 :7 ])
429- atom_symbol_idx_list .append (ii .split ()[1 ])
430424 if "ENERGY|" in ii :
431425 energy = ii .split ()[8 ]
432426 if " Atom Kind " in ii :
You can’t perform that action at this time.
0 commit comments