deepmodeling / dpdata

A Python package for manipulating atomistic data of software in computational science
https://docs.deepmodeling.com/projects/dpdata/
GNU Lesser General Public License v3.0
202 stars 134 forks source link

[Bug] QE input file not successfully parsed when information blocks are not seperated by an empty line #719

Closed Carrotkingdom closed 2 months ago

Carrotkingdom commented 2 months ago

Summary

Please support format VC-relaxation in QE PW.

Detailed Description

When transfering the output file generated during VC-relaxation by QE: LabeledSystem('task.0/scf.out','qe/pw/scf') The error reads: Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.10/dist-packages/dpdata/system.py", line 183, in init self.from_fmt( File "/usr/local/lib/python3.10/dist-packages/dpdata/system.py", line 220, in from_fmt return self.from_fmt_obj(load_format(fmt), file_name, kwargs) File "/usr/local/lib/python3.10/dist-packages/dpdata/system.py", line 1113, in from_fmt_obj data = fmtobj.from_labeled_system(file_name, kwargs) File "/usr/local/lib/python3.10/dist-packages/dpdata/plugins/qe.py", line 50, in from_labeled_system ) = dpdata.qe.scf.get_frame(file_name) File "/usr/local/lib/python3.10/dist-packages/dpdata/qe/scf.py", line 147, in get_frame cell = get_cell(inlines) File "/usr/local/lib/python3.10/dist-packages/dpdata/qe/scf.py", line 40, in get_cell blk = get_block(lines, "CELL_PARAMETERS") File "/usr/local/lib/python3.10/dist-packages/dpdata/qe/scf.py", line 20, in get_block while len(lines[blk_idx]) != 0 and blk_idx != len(lines): IndexError: list index out of range

Further Information, Files, and Links

[Uploading scf.zip…]()

wanghan-iapcm commented 2 months ago

For the reason of the error, please see the pr https://github.com/deepmodeling/dpdata/pull/724