-
Notifications
You must be signed in to change notification settings - Fork 39
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
Precision and number of significant digits #113
Comments
Hi @claudecharlot, currently, each var = Variable(...)
var.digits = 2 # Example If you don't set it, it defaults to five significant digits. Based on the value of this setting, the values of the variable and its associated uncertainties are automatically rounded to the corresponding number of significant digits when you export everything to If you really want to control decimal places independent of the size of the number, there is currently no implementation. Do you need this? I have a hard time thinking of a case where one would want to do that rather than using significant digits relative to the size of the number itself. |
Hi Andreas, Yes defining the number of significant digits along with a rounding is just what we need. Limiting the number of decimals was an intermediate suggestion as I did not know you had already implemented the number of significant digits :-) Thanks, |
Great! For data, I agree: converting to integer before / while setting the variable values will work fine. |
Hi, would it be possible to round a variable to have the same number of decimals as its associated uncertainty without an 'a priori' knowledge of both numbers? For example, let's assume I have x = 1.222 +/- 0.035. The general problem is that often data will be read from large graphs or histograms, where numbers are stored with any number of digits and no rounding. Another related topic is also that often the relative precision would not be the same for all points in the histograms, and one would actually round all of them to the same given number of decimals (e.g. 15.3 +/- 1.5 and 12.4 +/- 0.3) Many thanks, Marco |
Hi Marco (@cippy), In principle, I guess this could work if, once the values are read in, one looped over the value-uncertainty pairs and then rounded the values individually according to the size of their corresponding uncertainties. Is this something you'd be interested in? If so, would you like to try to implement this? The best way to start would be to think about some tests that one would run to make sure the code does what it's supposed to do. |
Hi Clemens, I might try to come up with some code to do it. Marco |
Hello,
Which tools do we have in hepdata lib to limite precision in number of decimal/number of significant digits according to CMS rules, in particular when data are retreived from histograms?
Ideally we would need the following I think:
The last could be obtained by having the possibility to quote numbers in EE format and them limit the number of figures in the mantissa.
Cheers,
Claude
The text was updated successfully, but these errors were encountered: