Yambopy errors in plotem1s process

Post here any question you encounter when running the scripts of the yambo-py suite. Post here problem strictly to the python interface as problem coming from the yambo runs should go in the appropriate subforum.

Moderators: palful, amolina, mbonacci

Post Reply
User avatar
jasonhan0710
Posts: 58
Joined: Wed Dec 23, 2020 6:48 am
Location: China

Yambopy errors in plotem1s process

Post by jasonhan0710 » Tue Jun 22, 2021 2:36 pm

Dear all,

I want to get the dielectric function in GW calculation. In GW calculation, I used the the COHSEX to get the em1s files. Then, I copy all the em1s files into SAVE folder. and I want to use

Code: Select all

yambopy plotem1s ./SAVE
command to plot the dielectric function. However, it reported that

Code: Select all

Traceback (most recent call last):
  File "/data/home/djy3/.local/bin/yambopy", line 4, in <module>
    __import__('pkg_resources').run_script('yambopy==0.1', 'yambopy')
  File "/data/home/djy3/software/anaconda3/lib/python3.8/site-packages/pkg_resources/__init__.py", line 650, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/data/home/djy3/software/anaconda3/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1446, in run_script
    exec(code, namespace, namespace)
  File "/data/home/djy3/.local/lib/python3.8/site-packages/yambopy-0.1-py3.8.egg/EGG-INFO/scripts/yambopy", line 390, in <module>
    ycmd = YambopyCmd(*sys.argv)
  File "/data/home/djy3/.local/lib/python3.8/site-packages/yambopy-0.1-py3.8.egg/EGG-INFO/scripts/yambopy", line 383, in __init__
    self.cmd = cmdclass(args[2:])
  File "/data/home/djy3/.local/lib/python3.8/site-packages/yambopy-0.1-py3.8.egg/EGG-INFO/scripts/yambopy", line 98, in __init__
    ys = YamboStaticScreeningDB(save=folder)
  File "/data/home/djy3/.local/lib/python3.8/site-packages/yambopy-0.1-py3.8.egg/yambopy/dbs/em1sdb.py", line 63, in __init__
    self.cutoff = ("".join(database.variables['CUTOFF'][:][0]).strip())
TypeError: sequence item 0: expected str instance, numpy.bytes_ found
Is there anyone can help me fix this problem? Thank you!

Best regards,
Jason
Jason Han

Assistant Professor
Department of Physics
National University of Defense Technology
Hunan, China

User avatar
palful
Posts: 56
Joined: Tue Jan 26, 2016 11:23 am
Location: Modena and Milan

Re: Yambopy errors in plotem1s process

Post by palful » Tue Jun 22, 2021 6:04 pm

Dear Jason,

Are you sure that you have the latest version of yambopy?

This bug was corrected some time ago and the line in question: self.cutoff = ("".join(database.variables['CUTOFF'][:][0]).strip()), has been replaced.
Try to do "git pull" in order to download the updated version, and then reinstall yambopy with the setup.py script.

Let us know if it worked!

Cheers,
Fulvio
Dr. Fulvio Paleari
S3-CNR Institute of Nanoscience and MaX Center
Modena, Italy

User avatar
jasonhan0710
Posts: 58
Joined: Wed Dec 23, 2020 6:48 am
Location: China

Re: Yambopy errors in plotem1s process

Post by jasonhan0710 » Wed Jun 23, 2021 1:47 am

Dear Fulvio,

It works. Thank you!

Best,
Jason
Jason Han

Assistant Professor
Department of Physics
National University of Defense Technology
Hunan, China

Post Reply