YamboStaticScreeningDB error

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
Xiaoming Wang
Posts: 67
Joined: Fri Dec 18, 2020 7:14 am

YamboStaticScreeningDB error

Post by Xiaoming Wang » Thu May 13, 2021 5:22 am

Hello,

I'd like to read and plot the em1s data using yambopy and got the following error
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/wxiaom86/.local/lib/python3.7/site-packages/yambopy-0.1-py3.7.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

Seems type mismatch?

Best,
Xiaoming
Xiaoming Wang
The University of Toledo

Xiaoming Wang
Posts: 67
Joined: Fri Dec 18, 2020 7:14 am

Re: YamboStaticScreeningDB error

Post by Xiaoming Wang » Thu May 13, 2021 7:07 am

I worked out by changing line 63 to

Code: Select all

self.cutoff = str(database.variables['CUTOFF'][:][0],'UTF-8').strip()
.
Xiaoming Wang
The University of Toledo

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

Re: YamboStaticScreeningDB error

Post by palful » Thu May 13, 2021 11:56 am

Dear Xiaoming,

Thank you very much for the bug fix! I have implemented it and pushed in the yambopy repository.
The self.cutoff line was a leftover from the python 2.7 version where the type conversion wasn't needed: this was the cause.

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

Xiaoming Wang
Posts: 67
Joined: Fri Dec 18, 2020 7:14 am

Re: YamboStaticScreeningDB error

Post by Xiaoming Wang » Thu May 13, 2021 7:59 pm

Dear Fulvio,

Thanks. It's good to know that.
Another problem that I have is the gvector read by yambopy. In line 53 of em1sdb.py, the np.rint function would round the gvector of 0.5 to 0, which changes from the X_RL_vecs in the ndb.em1s dataset.

Best,
Xiaoming
Xiaoming Wang
The University of Toledo

Post Reply