deepmodeling/dpdata

[BUG] list index out of range when converting ABACUS MD output files to data.gro

Closed this issue · 2 comments

Bug summary

When using dpdata to convert ABACUS MD output files into data.gro file, I encountered an error 'list index out of range' and cannot get a result.

dpdata Version

dpdata v0.2.17

Input Files, Running Commands, Error Log, etc.

Related ABACUS input and output files are uploaded.
Running commands are recommended by ABACUS MD tutorials:

import dpdata
data = dpdata.LabeledSystem("./", fmt="abacus/md")
data.to_gro("data.gro")

And the error log is

Traceback (most recent call last):
  File "/lustre/home/2201110377/research/proj-activelearning-promoter/2x1-510-K4O2-NVT-550K/dump_to_gro.py", line 2, in <module>
    data = dpdata.LabeledSystem("./", fmt="abacus/md")
  File "/lustre/home/2201110377/conda/miniconda3/envs/dpgen/lib/python3.9/site-packages/dpdata/system.py", line 183, in __init__
    self.from_fmt(
  File "/lustre/home/2201110377/conda/miniconda3/envs/dpgen/lib/python3.9/site-packages/dpdata/system.py", line 220, in from_fmt
    return self.from_fmt_obj(load_format(fmt), file_name, **kwargs)
  File "/lustre/home/2201110377/conda/miniconda3/envs/dpgen/lib/python3.9/site-packages/dpdata/system.py", line 1113, in from_fmt_obj
    data = fmtobj.from_labeled_system(file_name, **kwargs)
  File "/lustre/home/2201110377/conda/miniconda3/envs/dpgen/lib/python3.9/site-packages/dpdata/plugins/abacus.py", line 66, in from_labeled_system
    return dpdata.abacus.md.get_frame(file_name)
  File "/lustre/home/2201110377/conda/miniconda3/envs/dpgen/lib/python3.9/site-packages/dpdata/abacus/md.py", line 165, in get_frame
    atom_names, natoms, types, coords = get_coords(
  File "/lustre/home/2201110377/conda/miniconda3/envs/dpgen/lib/python3.9/site-packages/dpdata/abacus/scf.py", line 89, in get_coords
    atom_names.append(coords_lines[line_idx].split()[0])
IndexError: list index out of range

MD.zip

Steps to Reproduce

By running dump_to_gro.py, this issue can be reproduced.

Further Information, Files, and Links

I used dpdata to convert ABACUS MD output files for several times before. But they are much smaller structures with no more than 150 atoms in total while this structure has more than 200 atoms. Maybe this problem is relevant to the size of input structure?

Hi @iid-ccme, thanks for your feedback. This is a bug in dpdata/abacus, and commit #591 will fix it.

OK, thank you very much.