romerogroup / pyprocar

A Python library for electronic structure pre/post-processing
GNU General Public License v3.0
172 stars 76 forks source link

error in pyprocar.bandsplot---> QE input file #136

Closed Samiul-Islam-Shadhin closed 8 months ago

Samiul-Islam-Shadhin commented 1 year ago

I am trying to plot the bandstructure from quantum espresso output file . I am getting this error: prefix = re.findall("prefix\s=\s'(.*)'", scf_in)[0] list index out of range

a screenshot of the error is attached. can anyoone please help. pyprocar

Drive link: https://drive.google.com/file/d/1RQRl3yhE2Aiukinoi3ijThWhbGA0wp9o/view?usp=sharing (fermi energy of my calculation was negative value)

lllangWV commented 1 year ago

Hey,

so this error comes from parsing the scf.in file. As you can see it is trying to parse the prefix variable, but it was not successful. To fix this I would just have to change the regex expression to parse.

In your scf.in file can you paste everything under the &CONTROL tag

Logan Lang

Samiul-Islam-Shadhin commented 1 year ago

Hi, at first , thank you very much for your generous reply. but I did not understand your point ” change the regex expression to parse.” Can you be more vivid. I am a noobie actually. I am attaching the scf.in file . can you please look into this issue! scf.txt

lllangWV commented 1 year ago

Hey,

so when I said "change the regex expression to parse.”, that was something more toward what we would have to change in the code. re.findall("prefix\s=\s'(.*)'", scf_in)* This is a package called regex and it is used to parse text given a string pattern. The string pattern ("prefix\s=\s'(.)'") is commonly called a regex expression, and here I am trying to get the string in between the single quotation marks '. So if you use double quotation marks "** this will not find anything.

I looked into the scf.in file. You have the following:

&CONTROL title = 'VSe2', calculation = 'scf', outdir = './out', pseudo_dir = '.', prefix = "VSe2", verbosity = 'high', /

When we parse this file for the prefix variable, so to fix this all you have to change is

prefix = "VSe2", -> prefix = 'VSe2',

Samiul-Islam-Shadhin commented 1 year ago

thank you very much. It helped