-
Notifications
You must be signed in to change notification settings - Fork 26
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
Issues with parsing single-letter prefixes such as for atto
#172
Comments
I went back and forth on "am" being attometer and arcminute. The astronomy field in this case won out. as far as the capitalization, some strings only use capital case for units so it needs to support that, and if it fails on the first pass it just lowers the case and tries again. Where the prefix is unambiguous both the lower case and upper case were allowed. A couple of those I will look at fixing though. |
Ahh, the curse of compromises... apparently no software project can escape from that. ;) From my point view
|
What I am playing with a domain mapping, which could be set by default or controlled through the match_flags argument. This would trigger different string conversions depending on the specific domain and enable standard SI to be the default. current planned domains include these are ones where there are some potential unit strings that mean different things in the different domains. My inclination is default to more relaxed approach so where the capitalization on the prefix is unambiguous it should be allowed but if the strict_si domain is enabled they would not be. |
That sounds like a very promising approach! Is the plan that multiple domains could be enabled at the same time? |
Still playing with it as to how it would work. Right now I am leaning towards making The other domains would be mutually exclusive so you couldn't use more than one domain. The mechanism I am using does allow a few exceptions to that so a few particular combination might be allowed, still working out the details. |
@SimonHeybrock #173 tries to address this and add the domain logic. |
This appears to work now as expected. Thanks a lot! |
For certain lower-cases unit prefixes (I have noticed for atto and femto) the string parser also interprets the uppercase letters as this prefix. Examples:
Am
andFm
work, but I believe they should not?am
does not work, gives0.00029088820866572158rad
Lowercase prefix:
Uppercased prefixes (should usually not work, unless it matches something else):
For future reference, here is how the list was produced:
The text was updated successfully, but these errors were encountered: