wannier90 icon indicating copy to clipboard operation
wannier90 copied to clipboard

Some of the Python scripts generated by wannier90 for Berry curvature and Fermi-lines plotting are not working

Open abid-a opened this issue 4 years ago • 6 comments

Hi developers, Scripts.zip

During calculations wannier90 generate python script which can be used to plot the data. However, i have observed that some of the python scripts for plotting the Berry curvature and Fermi-lines are not working properly, For instance, scripts such as "wannier90-kslice-curv_x.py", "wannier90-kslice-curv_y.py", "wannier90-kslice-curv_z.py", "wannier90-kslice-curv_x-fermi_lines.py", "wannier90-kslice-curv_y-fermi_lines.py" and "wannier90-kslice-curv_z-fermi_lines.py" are not working. For example, by running the script "wannier90-kslice-curv_z.py" it gives an error like that:

File "wannier90-kslice-curv_z.py", line 45, in valint = ml.griddata(points_x,points_y, val_log, xint, yint) AttributeError: module 'matplotlib.mlab' has no attribute 'griddata'

I think this error is due to the fact the script use old matplotlib which is not compatible with the new one in python3. You may read the discussion here: https://www.reddit.com/r/Python/comments/87lbao/matplotlib_griddata_deprecation_help/

Some of these python scripts are attached to this email, please find the enclosed attachment. Let me make a request to the developer to modify these scripts so that it can work successfully. As I am very poor in python and that's why unable to modify it. Your efforts would be highly appreciated in this regard. Thank You Regds Abid Quaid-i-Azam university, Islamabad

abid-a avatar Feb 20 '21 05:02 abid-a

@ivosouza0 @stepan-tsirkin were you the authors of these scripts? If so, can you give a look and update the scripts?

giovannipizzi avatar Jun 11 '21 22:06 giovannipizzi

I'll have a look!

ivosouza0 avatar Jun 12 '21 16:06 ivosouza0

Hi,

I have the same issue as follows:

AttributeError: module 'matplotlib.mlab' has no attribute 'griddata'

Could you please tell us the solution or share the correct python code?

Cheers

Peggy121 avatar Oct 21 '21 15:10 Peggy121

Hello.

You must use matplotlib-2.1.2.

Att

GiselleCastro avatar Jan 12 '22 17:01 GiselleCastro

See! https://github.com/matplotlib/natgrid/blob/master/README For interpolate nn

GiselleCastro avatar Jan 12 '22 17:01 GiselleCastro

And execute python -mpip install git+https://github.com/matplotlib/natgrid.git

GiselleCastro avatar Jan 12 '22 17:01 GiselleCastro

See! https://github.com/matplotlib/natgrid/blob/master/README For interpolate nn

hi, I want to know how to install natgrid. Can you tell me in detail?

kaiqi-wang avatar Oct 20 '22 06:10 kaiqi-wang

From a message in the mailing list:

I encountered a similar issue a while back and was able to tackle it by commenting out the line "valint = ml.griddata(points_x,points_y, val_log, xint,yint)" and replacing it with "valint = interpolate.griddata((points_x,points_y), val_log, (grid_x, grid_y), method='nearest') # or 'cubic' or 'nearest', as requiredS". Hope it helps.

We should test and fix it.

giovannipizzi avatar Nov 14 '23 05:11 giovannipizzi