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

ValueError: not enough values to unpack #17

Open
Makarov3821 opened this issue Nov 4, 2022 · 1 comment
Open

ValueError: not enough values to unpack #17

Makarov3821 opened this issue Nov 4, 2022 · 1 comment

Comments

@Makarov3821
Copy link

Makarov3821 commented Nov 4, 2022

Hi, I'm trying to output dos graph, but I got an error:

Traceback (most recent call last):
File "/home/zyl/.local/bin/vasprun", line 105, in
test.plot_dos(styles=options.dosplot, filename=options.figname, xlim=lim, smear=options.smear)
File "/home/zyl/.local/lib/python3.10/site-packages/vasprun/init.py", line 857, in plot_dos
mydos, labels = self.get_dos(rows, style)
File "/home/zyl/.local/lib/python3.10/site-packages/vasprun/init.py", line 785, in get_dos
a, b, c, d = np.shape(pdos)
ValueError: not enough values to unpack (expected 4, got 1)

The version is the latest 1.0.4, and my command is
vasprun -v vasprun.xml -d t -n dos-test.png
I'll attach my vasprun.xml below.
vasprun.zip

@yhorbatenko
Copy link

I have the same issue with plot_dos, but unfortunately, i do not have any solution for this problem :( . Only can say that when i do print (vasp.values['calculation']['pdos']), this command returns an empty array. However, print (vasp.values['calculation']['tdos']) does print out data from my vasprun.xml file. I assume the option -d t in your command indicates you want to plot a total dos. But why it gives the error even if the tdos array is not empty, this is a mystery for me. Hope someone can suggest how to solve this problem.

PS. plot_band also gives an error although a different one: p[kpt]=np.sum(proj[kpt,i,:,:])
IndexError: too many índices for array: array is 1-dimensional, but 4 were indexed. Maybe you encountered the same issue too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants