-
Notifications
You must be signed in to change notification settings - Fork 121
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
String to float conversion edge case #838
Comments
Actually, this might be more appropriate for Hydra, since it involves instantiation. If so, I will be happy to move it. |
I think that the culprit is this regex in OmegaConf's custom yaml loader :) |
Yup! That sure looks like it! |
tl;dr we should probably restrict underscore handling to less cases. That would match most underscore allowing languages including python. I see yaml 1.2 doesn't even specify I see our existing RE probably originates in ruamel. It's interesting that yaml being a superset of json, diverges from json here ? |
Disallow numbers with trailing underscore from being converted to float. The specific change here is to treat 0_e0 as a string. Fixes issue omry#838
I also see some inconsistencies between the antlr (interpolation) and basic loader. |
Disallow numbers with trailing underscore from being converted to float. The specific change here is to treat 0_e0 as a string. Fixes issue #838
Disallow numbers with trailing underscore from being converted to float. The specific change here is to treat 0_e0 as a string. Fixes issue omry#838
Disallow numbers with trailing underscore from being converted to float. The specific change here is to treat 0_e0 as a string. Fixes issue #838
Hello! Hypothesis found an odd test case during one of hydra-zen's nightly jobs.
The yaml field-value
'0_e0'
gets converted to a float:however this string is not actually a valid representation of
0.0
:I do not think that the underscore can precede
e
directly.The text was updated successfully, but these errors were encountered: