-
Notifications
You must be signed in to change notification settings - Fork 50
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
pyhon > 3.6 compatibility fix #7
Conversation
- run function replace popen - the logic to write the STDOUT to file hs been changed accordingly - iteritems() replaced with items()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HI,
the kpt producing worked properly but when I tried the ploting step the following Error appeared:
Traceback (most recent call last):
File "/home/user/bandup-master/src/python_interface/bandupy/files.py", line 298, in create_bandup_input
if(os.path.exists(dest)): raise OSError
OSError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/user/bandup-master/bandup", line 73, in <module>
run_requested_task(args)
File "/home/user/bandup-master/src/python_interface/bandupy/runners.py", line 61, in run_requested_task
create_bandup_input(args)
File "/home/user/bandup-master/src/python_interface/bandupy/files.py", line 320, in create_bandup_input
'overwrite it.')
File "/home/user/intel/intelpython3/lib/python3.7/warnings.py", line 110, in _showwarnmsg
msg.file, msg.line)
TypeError: _new_showwarning() takes from 1 to 4 positional arguments but 6 were given
which command are you using? simple plot or using the gui? |
I used run_BandUP_unfold_and_plot_tasks.sh file from Si example |
ok I see. |
Dear @fraricci , thank you for this fix, and sorry for not replying for almost 2 years, If it is not hard to you, can you add a bit of backward compatibility, by modifying the changes in runners.py as :
I understand that python3.6 is already old, but also some users may have reasons for not upgrading to newer versions. Regards, |
let me check, I remember it was working in py3.6. It might be that the fix in the warning_wrapper doesn't. |
with
can it be different is subversions of python3.6 ? |
Hi Stepan, similar to python 3.6.12, using python 3.6.3 results in the same error as you stated above. I made a change to the "runners.py" file (see attached) and it seems to work in conjunction with the corrected files.py and warnings_wrapper.py file posted here. |
dear @nhew1994 , also , @fraricci , did you find time to implement a single version that works bothe in python 3.6 and 3.8 ? or @nhew1994 , can you do it? |
Hello there, sorry for been unresponsive. I quickly tested the implementation by @nhew1994 that use Popen instead of run and it seems working both in 3.6 and 3.8 versions. Could you @stepan-tsirkin double check? |
This PR is substituted with #21 , which is now merged |
I tested the three mode kpts, unfold and plot and they seems working fine with python > 3.6.
An error is raised if py 3.5 is used, though
hope this is helpful