You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the given code for parsing OUTCARs for multiple systems:
fs=glob('path/to/*/OUTCAR')
ms=MultiSystems()
for f in fs:
try:
ls=LabeledSystem(f)
except:
print(f)
if len(ls)>0:
ms.append(ls)
I wanted to check one of the printed (exception) files and see why specifically LabeledSystem was not able to read it since I am losing a good amount of data this way. When testing one of these files manually with LabeledSystem('path/to/failed/OUTCAR'), I get the following error:
Traceback (most recent call last):
File "/var/folders/5d/7cky48h14mg5gvzzj1hyml1r0000gn/T/ipykernel_74921/2208943671.py", line 1, in <module>
ts = LabeledSystem('converged_data/B11-Cp-CBC/V71/OUTCAR')
File "/Users/kimiaghaffari/opt/anaconda3/envs/ML/lib/python3.9/site-packages/dpdata/system.py", line 883, in __init__
self.from_fmt(file_name, fmt, type_map=type_map, begin= begin, step=step, **kwargs)
File "/Users/kimiaghaffari/opt/anaconda3/envs/ML/lib/python3.9/site-packages/dpdata/system.py", line 120, in from_fmt
return self.from_fmt_obj(load_format(fmt), file_name, **kwargs)
File "/Users/kimiaghaffari/opt/anaconda3/envs/ML/lib/python3.9/site-packages/dpdata/system.py", line 890, in from_fmt_obj
data = fmtobj.from_labeled_system(file_name, **kwargs)
File "/Users/kimiaghaffari/opt/anaconda3/envs/ML/lib/python3.9/site-packages/dpdata/plugins/vasp.py", line 65, in from_labeled_system
= dpdata.vasp.outcar.get_frames(file_name, begin=begin, step=step)
File "/Users/kimiaghaffari/opt/anaconda3/envs/ML/lib/python3.9/site-packages/dpdata/vasp/outcar.py", line 69, in get_frames
coord, cell, energy, force, virial, is_converge = analyze_block(blk, ntot, nelm)
File "/Users/kimiaghaffari/opt/anaconda3/envs/ML/lib/python3.9/site-packages/dpdata/vasp/outcar.py", line 119, in analyze_block
tmp_v = [float(ss) for ss in ii.split()[2:8]]
File "/Users/kimiaghaffari/opt/anaconda3/envs/ML/lib/python3.9/site-packages/dpdata/vasp/outcar.py", line 119, in <listcomp>
tmp_v = [float(ss) for ss in ii.split()[2:8]]
ValueError: could not convert string to float: '4199.91072-16668.21343'
I've linked the OUTCAR that gives this error to this post if anyone wants to replicate this. Please let me know what could be the cause of this, whether it is the LabeledSystem function or the OUTCAR that is the issue.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In the given code for parsing OUTCARs for multiple systems:
I wanted to check one of the printed (exception) files and see why specifically LabeledSystem was not able to read it since I am losing a good amount of data this way. When testing one of these files manually with
LabeledSystem('path/to/failed/OUTCAR')
, I get the following error:I've linked the OUTCAR that gives this error to this post if anyone wants to replicate this. Please let me know what could be the cause of this, whether it is the LabeledSystem function or the OUTCAR that is the issue.
V71.zip
Beta Was this translation helpful? Give feedback.
All reactions