-
Notifications
You must be signed in to change notification settings - Fork 9
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
Consider using a library for physical units/conversions #2
Comments
I am tempted by this. However, a potentially much simpler solution is to rely on standard units for everything (kg, m, s, etc.) except perhaps when outputting a domain-specific output in diagnostics or plots, e.g. for chamber experiments, concentration is often reported in /cc and coagulation coefficient rate in (cubic centimeter or cm^3 per second) cc/s, but condensation growth in nm/s and sizes (most often diameters, not radii) in nm; yet for wall-specific distances we use cm, and so on; in fact, the actual "normalized" concentration unit is ... /cc/nm. Anyway, you get the total mess. That's why, I would personally vote to do everything in standard units in the backend, avoiding conversions altogether except in the io. Anyway something to consider. This will obviously become a serious issue as we will rely on a lot of parameterizations and global constants, as well as dimensionless quantities. Moving all to standard units can be easier than having to worry about conversions. |
Keeping everything in standard units is great! That said, the intent of this issue was to add unit types to numerical quantities to give us a way to programmatically validate that we haven't accidentally used a non-standard unit somewhere. I see automatic conversion between units as a secondary benefit. |
Sorry, I misunderstood that. Yes, fully endorse! |
Thanks for the paper! I really like the goal of Quant, covering even the 'kind-of-quantity' errors that I've struggled with before in dimension evaluation. Unfortunately, there hasn't been further development beyond the proof of concept 4 years ago. Similar situation with units, which hasn't seen development since 2017. I think that leaves us with pint, I sifted through some of pint's open issues and found something that may interest us. We deal with a lot of "dimensionless" fractions, like "molecules of ozone / molecules of air", which pint currently has trouble handling. There are open issues with a suggested solution: How to handle ppm and ppmv The Quant paper was referenced in Issue 1216, so the repo owner and collaborators know about the 'kind-of-quantity' problem. Thoughts on going with pint? |
Some examples:
Also, this paper has some more examples/libraries: https://arxiv.org/pdf/1807.07643.pdf.
The text was updated successfully, but these errors were encountered: