-
Notifications
You must be signed in to change notification settings - Fork 16
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
Unit conventions #12
Comments
Here is a script you all can try that uses pint for various types of quantities, please give it a try. |
I'm leaning toward not wanting to use pint, instead relying on clear conventions, clear variable names, and good testing. A similar question, though, is whether we want to use uncertainties for uncertainties? It could save a lot of manual error propagation which has potential for bugs. The API doesn't have to rely on it, I think, but we could use uncertainties under the hood. |
I am a huge fan of uncertainties. If you're just using gaussian error propagation it takes care of all that for you. If you're doing something fancier (e.g., asymmetric error bars) you would want to write your own stuff anyway. |
I did implement (Specifically:
|
I have become convinced that My proposal is:
|
(CGS? You're such an astrophysicist...) Until you suggest we use ergs for something. There I'll draw the line. ;-) |
What about variable naming convention, do we still suffix energy variables with |
Good question, I am worried that appending units to variable names could end up making things too verbose, but I do see the utility of doing that. What do others think? |
One possible compromise would be to append unit names onto publicly
accessible arguments and properties, and leave them off (or optional) on
internal variables and attributes.
|
Units are noted in the DataFrame column names for now, e.g., "Energy Level (MeV)".
Units are noted in the DataFrame column names for now, e.g., "Energy Level (MeV)".
Can re-close this issue? I think we have decided to prioritize simplicity over using |
I only hesitated because I wasn't very clear on when to name a variable with e.g. |
Sounds good. |
Following up on our discussion about using pint, I looked a bit more into its usability in our ecosystem. It seems very tightly coupled with numpy and uncertainties to the point where using it is nearly transparent, but its integration with pandas is poor. Quantities with both uncertainties and units can be stored in pandas data structures, but they need to be handled one-by-one instead of as an entire DataFrame or Series. (This is a known issue with pandas not supporting different methods of incorporating units.)
This could be a deal-breaker if we decide to rely on pandas heavily in this project.
I, for one, am not a big pandas user so the cost-benefit of using pint is weighed heavily toward benefit. For example, is this spectrum in units of counts, or counts per second, or counts per second per keV? Is this branching ratio a percentage or a dimensionless number? I have an activity in Becquerels; how do I do the conversion to mCi again?
The text was updated successfully, but these errors were encountered: