Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] could not convert string to float #611

Open
TongaoY opened this issue Mar 1, 2024 · 0 comments
Open

[BUG] could not convert string to float #611

TongaoY opened this issue Mar 1, 2024 · 0 comments
Labels
bug Something isn't working vasp

Comments

@TongaoY
Copy link

TongaoY commented Mar 1, 2024

Bug summary

Traceback (most recent call last):
File "d:\work\keti\dm\dptrain\2024-3-3-Mg\data.py", line 5, in
data = dpdata.LabeledSystem('2024-3-3-Mg\OUTCAR', fmt = 'vasp/outcar')
File "C:\Users\13706\AppData\Roaming\Python\Python310\site-packages\dpdata\system.py", line 183, in init
self.from_fmt(
File "C:\Users\13706\AppData\Roaming\Python\Python310\site-packages\dpdata\system.py", line 220, in from_fmt
return self.from_fmt_obj(load_format(fmt), file_name, **kwargs)
File "C:\Users\13706\AppData\Roaming\Python\Python310\site-packages\dpdata\system.py", line 1113, in from_fmt_obj
data = fmtobj.from_labeled_system(file_name, **kwargs)
File "C:\Users\13706\AppData\Roaming\Python\Python310\site-packages\dpdata\plugins\vasp.py", line 79, in from_labeled_system
) = dpdata.vasp.outcar.get_frames(
File "C:\Users\13706\AppData\Roaming\Python\Python310\site-packages\dpdata\vasp\outcar.py", line 76, in get_frames
coord, cell, energy, force, virial, is_converge = analyze_block(
File "C:\Users\13706\AppData\Roaming\Python\Python310\site-packages\dpdata\vasp\outcar.py", line 174, in analyze_block
info = [float(ss) for ss in tmp_l.split()]
File "C:\Users\13706\AppData\Roaming\Python\Python310\site-packages\dpdata\vasp\outcar.py", line 174, in
info = [float(ss) for ss in tmp_l.split()]
ValueError: could not convert string to float: '-----------------------------------------------------------------------------------'
有时还会出现IndexError: list index out of range
dp.zip

dpdata Version

0.2.17

Input Files, Running Commands, Error Log, etc.

Traceback (most recent call last):
File "d:\work\keti\dm\dptrain\2024-3-3-Mg\data.py", line 5, in
data = dpdata.LabeledSystem('2024-3-3-Mg\OUTCAR', fmt = 'vasp/outcar')
File "C:\Users\13706\AppData\Roaming\Python\Python310\site-packages\dpdata\system.py", line 183, in init
self.from_fmt(
File "C:\Users\13706\AppData\Roaming\Python\Python310\site-packages\dpdata\system.py", line 220, in from_fmt
return self.from_fmt_obj(load_format(fmt), file_name, **kwargs)
File "C:\Users\13706\AppData\Roaming\Python\Python310\site-packages\dpdata\system.py", line 1113, in from_fmt_obj
data = fmtobj.from_labeled_system(file_name, **kwargs)
File "C:\Users\13706\AppData\Roaming\Python\Python310\site-packages\dpdata\plugins\vasp.py", line 79, in from_labeled_system
) = dpdata.vasp.outcar.get_frames(
File "C:\Users\13706\AppData\Roaming\Python\Python310\site-packages\dpdata\vasp\outcar.py", line 76, in get_frames
coord, cell, energy, force, virial, is_converge = analyze_block(
File "C:\Users\13706\AppData\Roaming\Python\Python310\site-packages\dpdata\vasp\outcar.py", line 174, in analyze_block
info = [float(ss) for ss in tmp_l.split()]
File "C:\Users\13706\AppData\Roaming\Python\Python310\site-packages\dpdata\vasp\outcar.py", line 174, in
info = [float(ss) for ss in tmp_l.split()]
ValueError: could not convert string to float: '-----------------------------------------------------------------------------------'
有时还会出现IndexError: list index out of range
dp.zip

Steps to Reproduce

import dpdata
import numpy as np

data = dpdata.LabeledSystem('OUTCAR', fmt = 'vasp/outcar')
print('# the data contains %d frames' % len(data))

Further Information, Files, and Links

No response

@TongaoY TongaoY added the bug Something isn't working label Mar 1, 2024
@njzjz njzjz added the vasp label Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working vasp
Projects
None yet
Development

No branches or pull requests

2 participants