Closed eimrek closed 11 months ago
All modified lines are covered by tests :white_check_mark:
Comparison is base (
ee3f7d7
) 89.87% compared to head (b2a5657
) 89.89%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
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
https://github.com/aiidateam/qe-tools/blob/ee3f7d78fc5cfab35584e36ccee12a56d00ec5da/src/qe_tools/parsers/_input_base.py#L566-L577
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]: