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

w90io.read_hr takes long time on windows #16

Open
Zijia-Cheng opened this issue Jan 7, 2022 · 1 comment
Open

w90io.read_hr takes long time on windows #16

Zijia-Cheng opened this issue Jan 7, 2022 · 1 comment

Comments

@Zijia-Cheng
Copy link

I have tried to use read_hr function on both windows and mac. It works smoothly on Mac, while it takes forever on windows(>15mins). It should not be related to computer performance as the windows computer should perform better than macbook. When I interrupt the kernal it always stops at this line:

KeyboardInterrupt Traceback (most recent call last)
in
----> 1 HR, Rvectors, Rweights = w90io.read_hr('wannier90_hr.dat')

D:\machine learning\python\lib\site-packages\wannier90_utils-0.1.0-py3.7.egg\w90utils\io_hr.py in read_hr(fname)
23
24 istart_hr = 3+ndegen_lines
---> 25 raw_data = np.fromstring(''.join(contents[istart_hr:]), sep='\n').reshape((-1, 7))
26
27 hr = raw_data[:, 5] + 1j*raw_data[:, 6]

KeyboardInterrupt:

@jimustafa
Copy link
Owner

Thank you @CZJ2020 for reporting the issue you are experiencing. Unfortunately, I do not have access to a Windows system. Could you try splitting the call into

tmp_str = ''.join(contents[istart_hr:])
raw_data = np.fromstring(tmp_str, sep='\n')
raw_data = raw_data.reshape((-1, 7))

and seeing which of those lines is causing it to hang.

Maybe it is the newline \n character on Windows... and it needs to be something like sep=os.linesep. Hope this helps, and please let me know what you find.

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

2 participants