robinzyb / cp2kdata

cp2k postprocessing tools
https://robinzyb.github.io/cp2kdata/
GNU Lesser General Public License v3.0
54 stars 18 forks source link

Questions in converting cp2k data #14

Closed PolyuWeldingSpock closed 11 months ago

PolyuWeldingSpock commented 1 year ago

Hello

I have issues in converting cp2k data into deepmd format.

My initial AIMD trajectory format is .dcd. Then I converted it into .xyz with VMD program. I tried to convert dp format. but it failed. The command I used is: import dpdata dir = "." output = "pos." dp = dpdata.LabelSystem (dir, cp2k_output_name=output, fmt = cp2kdata/md) Then it failed. Obtian Energies From ./POSCAR-1.ener Obtian Structures From ./pos.xyz Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/polyucmp/anaconda3/envs/deepmd/lib/python3.10/site-packages/dpdata/system.py", line 281, in __init__ self.from_fmt( File "/home/polyucmp/anaconda3/envs/deepmd/lib/python3.10/site-packages/dpdata/system.py", line 318, in from_fmt return self.from_fmt_obj(load_format(fmt), file_name, **kwargs) File "/home/polyucmp/anaconda3/envs/deepmd/lib/python3.10/site-packages/dpdata/system.py", line 1162, in from_fmt_obj data = fmtobj.from_labeled_system(file_name, **kwargs) File "/home/polyucmp/anaconda3/envs/deepmd/lib/python3.10/site-packages/cp2kdata/dpdata_plugin.py", line 71, in from_labeled_system cp2kmd = Cp2kOutput(output_file=cp2k_output_name, run_type="MD", path_prefix=path_prefix) File "/home/polyucmp/anaconda3/envs/deepmd/lib/python3.10/site-packages/cp2kdata/output.py", line 100, in __init__ Parse_Run_Type[self.GlobalInfo.run_type]() File "/home/polyucmp/anaconda3/envs/deepmd/lib/python3.10/site-packages/cp2kdata/output.py", line 378, in parse_md self.atomic_frames_list, energies_list_from_pos, self.chemical_symbols = parse_pos_xyz(pos_xyz_file_list[0]) File "/home/polyucmp/anaconda3/envs/deepmd/lib/python3.10/site-packages/cp2kdata/block_parser/md_xyz.py", line 26, in parse_pos_xyz energies_list.append(match["energy"]) TypeError: 'NoneType' object is not subscriptable I cannot figure out what happened. Hope you can help me. Files are also attached.

dpdata.zip

robinzyb commented 1 year ago

just for reminder a link here https://github.com/deepmodeling/dpdata/discussions/137#discussioncomment-6379773

robinzyb commented 1 year ago

https://github.com/robinzyb/cp2kdata/issues/15