Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: bandsplot() missing 1 required positional argument: 'dirname' #129

Open
kaiqi-wang opened this issue Sep 2, 2023 · 3 comments

Comments

@kaiqi-wang
Copy link

kaiqi-wang commented Sep 2, 2023

Dear all,

I meet a problem when I use pip install pyprocar and after use it . Anyone can help me ?

Traceback (most recent call last):
File "/fs2/home/software/miniconda3/bin/procar.py", line 809, in
args.func(args)
File "/fs2/home/software/miniconda3/bin/procar.py", line 23, in call_bandsplot
pyprocar.bandsplot(
TypeError: bandsplot() missing 1 required positional argument: 'dirname'

This is my bash script:_

#!/bin/bash
procar.py repair PROCAR-band PROCAR-repaired

#openpwd
emin=-10
emax=10

echo $emin $emax
compound="OsBi2"
A1="Os"
A2="Bi"
cmap='hot_r'
vmin=0
vmax=1

procar.py bandsplot --outcar OUTCAR-scf
--mode parametric
--cmap $cmap
--vmin $vmin
--vmax $vmax
-a 0 1 2 3 4 5
--elimit $emin $emax -t "${compound} ${A1}"
--savefig "Fatband_${compound}_${A1}.png"
PROCAR-repaired

@ahromero
Copy link
Collaborator

ahromero commented Sep 2, 2023 via email

@lllangWV
Copy link
Collaborator

lllangWV commented Sep 2, 2023

Hey kaiqi-wang!

This issue is happening because we have updated bandsplot.py. I need to update scripts/procar.py to reflect these changes.

In the meantime, you can either create a python script and use the updated bandsplot function, or you can use an older version of pyprocar==5.6.6. You install this version through pip or go to the github releases.

Tell me if these solutions are satisfactory for you. If you have any other questions, please let us know!

@kaiqi-wang
Copy link
Author

kaiqi-wang commented Sep 3, 2023

Hey kaiqi-wang!

This issue is happening because we have updated bandsplot.py. I need to update scripts/procar.py to reflect these changes.

In the meantime, you can either create a python script and use the updated bandsplot function, or you can use an older version of pyprocar==5.6.6. You install this version through pip or go to the github releases.

Tell me if these solutions are satisfactory for you. If you have any other questions, please let us know!

Thank you very much. I already know the reason and hope other users can pay attention. In versions before v6.0.0, the dirname parameter defaults to the folder where OUTCAR and PROCAR are located, but after this, it is necessary to specify the specific folder. I am using a bash script that does not support the parameter dirname when using pyprocar. (I mean in that way). I have changed the instructions for installing the script on the official website to a Python script and it can be run. Like this:

#!/usr/bin/env python

import pyprocar

pyprocar.bandsplot(
code='vasp',
dirname='./', # Pay attention here. Must be specified, otherwise an error will be reported
elimit=[-2,2],
mode='plain',
color='blue',
savefig='band.png')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants