-
Notifications
You must be signed in to change notification settings - Fork 874
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
Fix LNONCOLLINEAR
match in Outcar
parser
#4034
Conversation
Thanks @KylinGuo for reporting this and providing the test OUTCAR. Can I have your permission to include your OUTCAR as a test file for |
It's my pleasure! Yes, please. |
Thanks a lot. All credit goes to you :) |
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.
thanks a lot for the fix @DanielYang59! 👍 almost ready to go
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.
i'm happy to merge despite the unclear implications of terminate_on_match=True
given tests pass
src/pymatgen/io/vasp/outputs.py
Outdated
self.read_pattern({"noncollinear": "LNONCOLLINEAR = T"}) | ||
if self.data.get("noncollinear", []): | ||
self.noncollinear = False | ||
self.read_pattern({"noncollinear": r"LNONCOLLINEAR\s*=\s*T"}, terminate_on_match=True) |
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.
these lines suggest that the matches
dict can contain less keys if terminate_on_match=True
and so you might get a different self.data
after self.data.update(matches).
but given all tests pass, this may not happen in practice
pymatgen/src/pymatgen/io/pwscf.py
Lines 623 to 630 in edcd465
matches = regrep( | |
self.filename, | |
patterns, | |
reverse=reverse, | |
terminate_on_match=terminate_on_match, | |
postprocess=postprocess, | |
) | |
self.data.update(matches) |
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.
any concerns @mkhorton?
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.
I think it might be safer for me to revert those changes in terminate_on_match
until I'm 100% percent it wouldn't cause any breakage.
Currently there must have been some part of Outcar
not covered by unit test, because the reverse reading in #4033 seems completely broken in Windows, but tests are still passing.
I would keep this into my TODO list, and have a closer look later.
LNONCOLLINEAR
match condition in Outcar
parserLNONCOLLINEAR
match in Outcar
parser
thanks for the lightning-fast fix @DanielYang59! 👍 |
No problem. Thanks for questioning the usage of |
Summary
LNONCOLLINEAR
match inOutcar
parser, to fix noncollinear attribute of Outcar class has wrong value for VASP calculations with LNONCOLLINEAR=.TRUE. #4031re
patternFor a future PR
terminate_on_match
to early exit upon match, I wish I didn't misunderstand the usage, but early exit should speed up the search?