-
Notifications
You must be signed in to change notification settings - Fork 10
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
Patch QE n_electrons
#271
Patch QE n_electrons
#271
Conversation
I now split the extraction between the total count and the one divided by spin-channel. |
@@ -2037,7 +2037,12 @@ def str_to_sticks(val_in): | |||
), | |||
Quantity( | |||
'number_of_electrons', | |||
rf'number of electrons\s*=\s*({re_float})\s*(?:\(up:\s*({re_float})\s*,\s*down:\s*({re_float}))?', |
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.
can you send me the text which fails for this regex pattern? as far as i can see this is generic enough for both cases. we should try to keep it in one quantity.
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.
The pattern isn't failing itself. The schema only needs the 1st match. There was a bug where the parser passed along all 3, violating the shape. The new shape rules actually brought it too light. So we should maybe consider reprocessing QE calcs...
If for some God-foresaken reason the 1st number can't be extracted, it can still be reconstructed from the latter 2.
It's very niche, I can remove that logic.
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.
can you then simply put this logic in swtting the value based on the length of the list
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 tried that first (it's in an older commit). The answer's no, since idk which value(s) is missing when the list is of length 2 or 1. The only choice is to support this corruption recovery or not. Up 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.
we can then make this as a sub-parser to resolve the electron type, this i think is still a better way than introducing multiple quantites
Pull Request Test Coverage Report for Build 12835994247Details
💛 - Coveralls |
A user pointed out that with spin-polarization turned on, the QE parser extracts 3 values for the total electron count and attempts to assign them, causing an error: