vasprun icon indicating copy to clipboard operation
vasprun copied to clipboard

ValueError: not enough values to unpack

Open Makarov3821 opened this issue 3 years ago • 1 comments

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

Makarov3821 avatar Nov 04 '22 09:11 Makarov3821

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.

yhorbatenko avatar Jan 13 '23 12:01 yhorbatenko