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
197 stars 133 forks source link

When I use a script to convert aimd_siesta to deepmd format. I encounter the following error: #441

Closed marciosampaio closed 1 year ago

marciosampaio commented 1 year ago

Converting aimd_siesta (attached file, as an example). I encounter error:

File "siesta_2_deepmd.py", line 12, in dsys = dpdata.LabeledSystem('NaCl.msg.out', fmt='siesta/aimd_output') File "/home/marcio/miniconda3/lib/python3.8/site-packages/dpdata/system.py", line 881, in init self.from_fmt(file_name, fmt, type_map=type_map, begin= begin, step=step, kwargs) File "/home/marcio/miniconda3/lib/python3.8/site-packages/dpdata/system.py", line 127, in from_fmt return self.from_fmt_obj(load_format(fmt), file_name, kwargs) File "/home/marcio/miniconda3/lib/python3.8/site-packages/dpdata/system.py", line 888, in from_fmt_obj data = fmtobj.from_labeled_system(file_name, **kwargs) File "/home/marcio/miniconda3/lib/python3.8/site-packages/dpdata/plugins/siesta.py", line 61, in from_labeled_system = dpdata.siesta.aiMD_output.get_aiMD_frame(file_name) File "/home/marcio/miniconda3/lib/python3.8/site-packages/dpdata/siesta/aiMD_output.py", line 134, in get_aiMD_frame tot_natoms = int(get_single_line_tail(fname, 'Number of atoms', 3)[0]) File "/home/marcio/miniconda3/lib/python3.8/site-packages/dpdata/siesta/aiMD_output.py", line 15, in get_single_line_tail part_res.append(float(value.split()[temp])) ValueError: could not convert string to float: 'Number'

I really appreciate any help. Thank you so much for your time. siesta.log siesta.log

marciosampaio commented 1 year ago

Dear All,

I solved the problem. Number of atoms are written as a comment.

Many thanks