-
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 acceleration due to gravity and pounds force units #75
Conversation
Sorry for the delayed response, and thanks a lot for your interest in the package! These are good additions but I'm actually a little worried that the naming scheme could become confusing if we do this differently for a lot of dual purpose units/constants. Perhaps you could help me hash out how to handle this? One option would be to distinguish by consistent naming convention. For example, right now in Unitful there's Another option is that I could make a separate package for constants-as-units. There'd be a separate string macro to return a constant as a unit. This could be annoying, since then you wouldn't be able to put everything in one string macro. On the other hand, it would be pretty clean, and I bet it would be possible to have this work anonymously to support using any constant as a unit (to be used sparingly...) Maybe there are other alternatives? Or perhaps I'm overthinking it and I should just merge as is. |
Thanks for the response, these seem like great questions. I took a while to reply because I don't have any great answers, only more questions :-) One thing I'm trying to understand is the utility of a constant So which units will a constant be defined in? I don't think there's a general answer to this, given that Unitful supports various customary units (thanks btw, this package is already amazing for dealing with unfamiliar customary units). Physical quantities will naturally be defined in SI units, at least. I wouldn't be keen on having constants like Hmm, so far I'm somewhat liking the idea of very systematically mangling the names, hopefully with a symbol which just can't be confused with a unit. Or what about putting all constants into a separate submodule (rather than a separate package), and just conflating the names of unit and constant? Thus |
Well, I actually want to use this, so regardless of the larger issues, perhaps you'd consider merging a simplified version of this, perhaps one where the name of the constant is stashed away from the public API if you'd rather not commit to it right now? What I wanted in making this change was primarily to gain access to the following via the
Defining the actual constant was a side issue, simply to make the above two things cleaner. Now that I look back on what I've got here, I wonder whether it might have been better to use |
You could always put your That being said, I don't want to inconvenience you if that solution doesn't work for you for whatever reason, so I'll just merge this for now, with the warning that I might change it in the future. |
Oh, thanks! I was quite happy to wait a little longer, just wanted to restart the conversation to avoid the PR falling off my radar completely as I've had to move on to other work. I'm fine if you change this later. Regarding |
The acceleration due to gravity and pounds force are common engineering units. (I yesterday had the misfortune to encounter these on data sheets for accelerometers and vibration isolators, respectively :-) )
Here I've added the official value of
gn
from CODATA (http://physics.nist.gov/cgi-bin/cuu/Value?gn) as a constant in m/s^2.I wasn't sure what to use as the symbolic name for the associated unit of acceleration. Unfortunately
g
is often used in applications, which is obviously completely ambiguous with grams, so I've usedge
for now, as the wikipedia page suggests it as a synonym forgn
(https://en.wikipedia.org/wiki/Gravity_of_Earth). Is there a standard place to go looking for a better or official name for this? The unit vs constant seem to usually be conflated, it's pretty cool that this package expresses those concepts independently!