-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
Adopting a Object-Oriented way of printing the ufloats [Enhancement] #149
Comments
I'm also interested in somewhat of a modernization of the string formatting code but have some thoughts on what you say.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is it possible to convert the current api to an object oriented approach, like sympy see here.
This could allow people to write their own printers and lets them customize every aspect of the representation of the nominal value and the standard deviation.
Reasons:
The current implementation of Shorthand is incorrect see nist and for a better explanation the corresponding physics stackexchange post.
eg.
4.5(1.3)e6 should be 4.5(13)e6
or 11.7(1.7) should be 11.7(17)
Furthermore the possibility of printing the nominal value separated by a delimiter would be great. This would allow people to export uarrays to csv, tex_formatted tables and databases with fiddling with afterwards with the outputted string from ufloat.format("")
(nom_val+/-std_dev)common_exp ---> nom_val common_exp delimiter std_dev common_exp
eg.
11.7+/-1.7 --> 11.7,1.7
(4.5+-1.3)e6 --> 4.5e6,1.3e6
At last the current behaviour of printing doens't need to change it could still produce the same output by default, yet make the process more flexible
The text was updated successfully, but these errors were encountered: