-
Notifications
You must be signed in to change notification settings - Fork 112
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
Add the units: parts per hundred thousand (pcm), million (ppm), billion (ppb), trillion (ppt), and quadrillion (ppq) #699
Conversation
Appreciate if someone can review and merge this. It is a very useful unit for chemical analysis. |
We define our own ppm/ppb, but it's its own dimension, which feels better than having 3ppm == 0.000003. |
Sorry @cstjean, I didn't understand your comment, could you explain? |
Co-authored-by: Sebastian Stock <42280794+sostock@users.noreply.github.com>
We have @dimension PPer "PartsPer" PartsPer
@refunit ppb "ppb" PartsPerBillion PPer false
@unit ppm "ppm" PPM 1000ppb false (perhaps that's not super clean, but eh) I'm not sure what's more appropriate for Unitful, but for us, in terms of "units exist to handle conversion code and prevent errors", making it its own dimension is the right call, even if it means having to add a Are there circumstances where you'd want 1ppm to be equal to 0.000001? For us, it's no, but I can definitely see that it could be true in some calculations, and in that case, this PR makes more sense than our code. Dividing by What do you think? For us it doesn't matter (I think?) as we can override the units. But obviously since changing it afterwards is difficult, so I thought I'd raise the issue at least. |
SI also defines |
The Wikipedia page also mentions |
@sostock, added. |
Thank you all for the input. We are looking forward to seeing it merged and released. We already have some downstream applications that will benefit from these new units. |
@sostock, the PR is ready. Can you check if it's ready to merge? |
@sostock, could we have a patch release with this PR? |
No, this is a feature, so it cannot go into a patch release. I will release it as v1.19.0 shortly. |
Reference: Parts-per notation - Wikipedia
closes #684