Skip to content
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

Option to always use truncated display of Measurements #40

Closed
karlwessel opened this issue May 9, 2019 · 4 comments · Fixed by #43
Closed

Option to always use truncated display of Measurements #40

karlwessel opened this issue May 9, 2019 · 4 comments · Fixed by #43

Comments

@karlwessel
Copy link

Would it be possible to get an option to tell Measurements to always use the truncated display of error values?

I'm almost never concerned about all of the digits of a Measurement but even when using an IO with compact display like the REPL it still happens often that Measurements are displayed as a whole. Especially in combination with Unitful.jl or in Tuples or arrays.

@giordano
Copy link
Member

giordano commented May 9, 2019

There is already a PR for Unitful.jl to fix the issue when using the two packages together: PainterQubits/Unitful.jl#213

@karlwessel
Copy link
Author

karlwessel commented May 9, 2019

I did not know of that PR, that will be definitively a huge improvement!

However there are still cases where the display is not truncated, like in this MWE:

julia> using Measurements

julia> a = 10π ± π
31.4 ± 3.1

julia> a, a
(31.41592653589793 ± 3.141592653589793, 31.41592653589793 ± 3.141592653589793)

An option to always use truncation would solve this for all cases where one has no control over whether the IO has :limit mode set.

Or, if a global option is not possible, is there some way one can easily force Measurements to be displayed truncated?

@giordano
Copy link
Member

giordano commented May 9, 2019

I don't really like global options. I'm thinking about simply always using truncated display.

@karlwessel
Copy link
Author

karlwessel commented May 9, 2019

That would also be totally fine (and reasonable) for me. However, in that case an easy method to display the untruncated version would probably be good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants