-
Notifications
You must be signed in to change notification settings - Fork 6
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
Bug in the basis set parser #14
Comments
Hey @q-posev, thank you for pointing that out. The original regex could handle numbers that are not in scientific notation. The quantifier The problem was this particular piece after the period: \d+[D+-]{0,2}\d\d). Written like this, the regex expects at least one decimal after the period followed by the optional scientific notation marker (D+/D-) and then two more obligatory decimal digits... Consequently, numbers not in scientific notation would not be parsed unless they had at least 3 digits after the period. This broke down as soon as I tried fluorine using the basis set you suggested. Moreover, it also breaks dramatically for potassium because its first entry:
No decimal digits at all... I updated the regex to be more flexible, in case you're interested here is what I came up with
Note that Anyways, you can check out the PR right here #15 . I just wanted to give you some feedback. |
Hi @gustavojra, thank you for the prompt fix and for the explanation! I will have a look at the PR. |
Not, it is not intentional, back when I created the |
OK, thanks @gustavojra ! I can prepare a PR. |
The regex that is currently used to parse the basis set files (
const prim_pat = r"([+-]?\d*?\.\d+[D+-]{0,2}\d\d)\s+?([+-]?\d*?\.\d+[D+-]{0,2}+\d\d)"
in BasisParser.jl) is not applicable to all available basis sets.For example, the 6-311+g file contains floating point values that are not in scientific notation (e.g. 1.0000 instead of 1.0D+00). So the parser crashes because it cannot parse these values. Perhaps this can be handled via the
try/catch
mechanism and using an alternative regex.Let me know if you need help fixing this. I am new to Julia but can work on the PR in my free time.
The text was updated successfully, but these errors were encountered: