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

Issue #4033 appears again: outcar unable to parse magnetization #4237

Closed
qchempku2017 opened this issue Dec 28, 2024 · 7 comments · May be fixed by #4068
Closed

Issue #4033 appears again: outcar unable to parse magnetization #4237

qchempku2017 opened this issue Dec 28, 2024 · 7 comments · May be fixed by #4068
Labels

Comments

@qchempku2017
Copy link

qchempku2017 commented Dec 28, 2024

Python version

python 3.11.0 and python 3.10.0

Pymatgen version

2024.11.13

Operating system version

Windows 11 24H2 26100.2605

Current behavior

Hi pymatgen developers, recently I am experiencing OUTCAR parsing issues again. After I performed a series of VASP calculations on Bohrium platform and downloaded the results to my local windows 11 laptop, I was unable to parse magnetization using pymatgen.vasp.io.outputs Outcar class through jupyter lab. Both python 3.10.0 and 3.11.0 did not work.

ocar = Outcar("./lfp-init-vasp-results/lfp-init-vasp-x-0.000-0/14017527/16068048/OUTCAR") threw a few warnings:
C:\Users\66422\miniconda3\envs\matsci\lib\site-packages\pymatgen\io\vasp\outputs.py:2114: EncodingWarning: We strongly encourage explicit encoding, and we would use UTF-8 by default as per PEP 686 with zopen(filename, mode="rt") as file: C:\Users\66422\miniconda3\envs\matsci\lib\site-packages\pymatgen\io\vasp\outputs.py:2365: EncodingWarning: We strongly encourage explicit encoding, and we would use UTF-8 by default as per PEP 686 with zopen(self.filename, mode="rt") as file:

then calling ocar.magmetization gave me:
()

However, my Outcar file looks fine when opened with text editor:
image

python version 3.11.0 and 3.10.0; pymatgen version 2024.11.13; monty version 2024.12.10, installed with pip in a conda environment, using Tsinghua University TUNA source.

Even though this issue should in principle have been fixed after resolving #4033 with #4034 and #4068, it appeared again in my case.

Expected Behavior

I was expecting ocar.magentization call to yield something like:
({'s': 0.023, 'p': 0.031, 'd': 4.302, 'tot': 4.357}, {'s': 0.023, 'p': 0.031, 'd': 4.302, 'tot': 4.357}, {'s': 0.023, 'p': 0.031, 'd': 4.302, 'tot': 4.357}, {'s': 0.023, 'p': 0.031, 'd': 4.302, 'tot': 4.357}, {'s': 0.023, 'p': 0.031, 'd': 4.302, 'tot': 4.357}, {'s': 0.023, 'p': 0.031, 'd': 4.302, 'tot': 4.357}, {'s': 0.023, 'p': 0.031, 'd': 4.302, 'tot': 4.357}, {'s': 0.023, 'p': 0.031, 'd': 4.302, 'tot': 4.357}, {'s': 0.023, 'p': 0.031, 'd': 4.302, 'tot': 4.357}, {'s': 0.023, 'p': 0.031, 'd': 4.302, 'tot': 4.357}, {'s': 0.023, 'p': 0.031, 'd': 4.302, 'tot': 4.357}, {'s': 0.023, 'p': 0.031, 'd': 4.302, 'tot': 4.357}, {'s': 0.023, 'p': 0.031, 'd': 4.302, 'tot': 4.357}, {'s': 0.023, 'p': 0.031, 'd': 4.302, 'tot': 4.357}, {'s': 0.023, 'p': 0.031, 'd': 4.302, 'tot': 4.357}, {'s': 0.023, 'p': 0.031, 'd': 4.302, 'tot': 4.357}, {'s': 0.004, 'p': 0.013, 'd': 0.0, 'tot': 0.016}, {'s': 0.004, 'p': 0.013, 'd': 0.0, 'tot': 0.016}, {'s': 0.004, 'p': 0.013, 'd': 0.0, 'tot': 0.016}, {'s': 0.004, 'p': 0.013, 'd': 0.0, 'tot': 0.016}, {'s': 0.004, 'p': 0.013, 'd': 0.0, 'tot': 0.016}, {'s': 0.004, 'p': 0.013, 'd': 0.0, 'tot': 0.016}, {'s': 0.004, 'p': 0.013, 'd': 0.0, 'tot': 0.016}, {'s': 0.004, 'p': 0.013, 'd': 0.0, 'tot': 0.016}, {'s': 0.004, 'p': 0.013, 'd': 0.0, 'tot': 0.016}, {'s': 0.004, 'p': 0.013, 'd': 0.0, 'tot': 0.016}, {'s': 0.004, 'p': 0.013, 'd': 0.0, 'tot': 0.016}, {'s': 0.004, 'p': 0.013, 'd': 0.0, 'tot': 0.016}, {'s': 0.004, 'p': 0.013, 'd': 0.0, 'tot': 0.016}, {'s': 0.004, 'p': 0.013, 'd': 0.0, 'tot': 0.016}, {'s': 0.004, 'p': 0.013, 'd': 0.0, 'tot': 0.016}, {'s': 0.004, 'p': 0.013, 'd': 0.0, 'tot': 0.016}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.011, 'p': 0.127, 'd': 0.0, 'tot': 0.138}, {'s': 0.008, 'p': 0.1, 'd': 0.0, 'tot': 0.108}, {'s': 0.008, 'p': 0.1, 'd': 0.0, 'tot': 0.108}, {'s': 0.008, 'p': 0.1, 'd': 0.0, 'tot': 0.108}, {'s': 0.008, 'p': 0.1, 'd': 0.0, 'tot': 0.108}, {'s': 0.008, 'p': 0.1, 'd': 0.0, 'tot': 0.108}, {'s': 0.008, 'p': 0.1, 'd': 0.0, 'tot': 0.108}, {'s': 0.008, 'p': 0.1, 'd': 0.0, 'tot': 0.108}, {'s': 0.008, 'p': 0.1, 'd': 0.0, 'tot': 0.108}, {'s': 0.008, 'p': 0.1, 'd': 0.0, 'tot': 0.108}, {'s': 0.008, 'p': 0.1, 'd': 0.0, 'tot': 0.108}, {'s': 0.008, 'p': 0.1, 'd': 0.0, 'tot': 0.108}, {'s': 0.008, 'p': 0.1, 'd': 0.0, 'tot': 0.108}, {'s': 0.008, 'p': 0.1, 'd': 0.0, 'tot': 0.108}, {'s': 0.008, 'p': 0.1, 'd': 0.0, 'tot': 0.108}, {'s': 0.008, 'p': 0.1, 'd': 0.0, 'tot': 0.108}, {'s': 0.008, 'p': 0.1, 'd': 0.0, 'tot': 0.108}, {'s': 0.007, 'p': 0.097, 'd': 0.0, 'tot': 0.104}, {'s': 0.007, 'p': 0.097, 'd': 0.0, 'tot': 0.104}, {'s': 0.007, 'p': 0.097, 'd': 0.0, 'tot': 0.104}, {'s': 0.007, 'p': 0.097, 'd': 0.0, 'tot': 0.104}, {'s': 0.007, 'p': 0.097, 'd': 0.0, 'tot': 0.104}, {'s': 0.007, 'p': 0.097, 'd': 0.0, 'tot': 0.104}, {'s': 0.007, 'p': 0.097, 'd': 0.0, 'tot': 0.104}, {'s': 0.007, 'p': 0.097, 'd': 0.0, 'tot': 0.104}, {'s': 0.007, 'p': 0.097, 'd': 0.0, 'tot': 0.104}, {'s': 0.007, 'p': 0.097, 'd': 0.0, 'tot': 0.104}, {'s': 0.007, 'p': 0.097, 'd': 0.0, 'tot': 0.104}, {'s': 0.007, 'p': 0.097, 'd': 0.0, 'tot': 0.104}, {'s': 0.007, 'p': 0.097, 'd': 0.0, 'tot': 0.104}, {'s': 0.007, 'p': 0.097, 'd': 0.0, 'tot': 0.104}, {'s': 0.007, 'p': 0.097, 'd': 0.0, 'tot': 0.104}, {'s': 0.007, 'p': 0.097, 'd': 0.0, 'tot': 0.104})
i.e., the same result I obtained when using Bohrium notebook.

Minimal example

No response

Relevant files to reproduce this bug

OUTCAR.zip
Please uncompress.

@esoteric-ephemera
Copy link
Contributor

I'm able to parse the magnetization with pymatgen==2024.11.13, can you try parsing on a non-windows machine to see if that's the issue?

@qchempku2017
Copy link
Author

qchempku2017 commented Dec 29, 2024

I'm able to parse the magnetization with pymatgen==2024.11.13, can you try parsing on a non-windows machine to see if that's the issue?

Yes, the code can be parsed with Linux or on Bohrium's linux image nodes. I guess this issue is windows-specific again.

@DanielYang59
Copy link
Contributor

DanielYang59 commented Dec 30, 2024

@qchempku2017 Hi thanks for opening the issue

The patch materialsvirtuallab/monty#712 should fix this issue for windows but it's not included in the monty v2024.12.10 release, and that's the reason #4068 is still marked as draft (and #4033 is not yet resolved).

Feel free to ping me if that issue persists after #4068 is merged

@qchempku2017
Copy link
Author

@qchempku2017 Hi thanks for opening the issue

The patch materialsvirtuallab/monty#712 should fix this issue for windows but it's not included in the monty v2024.12.10 release, and that's the reason #4068 is still marked as draft (and #4033 is not yet resolved).

Feel free to ping me if that issue persists after #4068 is merged

Thank you @DanielYang59. I'm looking forward to the release!

@DanielYang59
Copy link
Contributor

@qchempku2017 monty 2025.1.3 is out now and I believe this should resolve this issue. Let me know if otherwise.

Happy coding :)

@qchempku2017
Copy link
Author

@qchempku2017 monty 2025.1.3 is out now and I believe this should resolve this issue. Let me know if otherwise.

Happy coding :)

All issues gone! Thank you very much!

@DanielYang59
Copy link
Contributor

Great to know, and enjoy :)

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

Successfully merging a pull request may close this issue.

3 participants