Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We had a Materials Cloud seekpath tool user complain that a valid QE input is not working [1].
I looked into it, and it seemed to come from the fact that the zeroes were integers (no decimal point).
Same issue has arisen a while ago: fixes #51
Took a while to go through the regexes, but the issue stems from here
qe-tools/src/qe_tools/parsers/_input_base.py
Lines 566 to 577 in ee3f7d7
This matches 1)
\s+
(whitespace); and 2) a number. Not fully sure why, but if i add extra parentheses around the number part, everything works correctly.But together with this issue, i refactored the whole script a bit, as this number-matching-pattern was duplicated in many places. I defined it as a constant, added parenthesis around it, so it's safe and just used that constant everywhere a number needed to be matched. i think it's more understandable and maintainable this way.
Additionally i added a test that would have failed before.
cc @giovannipizzi
[1]: