-
Notifications
You must be signed in to change notification settings - Fork 37
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
Juno COOL printing #13
Conversation
Wait don't merge yet. I can improve printing even more! |
Is it really necessary to use an external package to print stuff in Juno? I'd like to avoid adding dependencies just for this :-) |
Requires is a 100-lines-of-code pure Julia package that allows you to have code for Juno without having Juno as a dependency. Makes no sense for me to "not want it"... The way I see it, there are 3 options:
Also, let me say that I find "just for this" a bad thing to say, as many scientists using Julia use/will use Juno and not the REPL! I am a Juno fanatic and felt heart-broken! |
Don't get me wrong, I really want the issue to be fixed! My point is that the package already defines a working Option 2 looks the way to go here, I just don't know what's wrong for Juno with the |
To be honest with you it is weird for me that you already have a dependency on Regardless of what |
Also, having cool juno printing would be the icing on the cake! You have support for so many things, like 5 different type of strings that can be made a measurement. Then you just put the cherry on top of this cake and boom! (I am trying hardcore to convince you because I don't want to clone my own fork and syncrhronise with yours all the time) |
I should have expected this question :-D As I already said above, it looked weird to me that one has to define another method for printing stuff only in Juno, when a method for printing stuff elsewhere (REPL, Jupyter) already works. If something is broken only on a system and works flawless elsewhere, I think it's that system that is broken. It shouldn't be my (or of any other package developer) duty to work around this issue. Depending on Anyway, we've found that Juno doesn't strictly need a new method and your PR turns from bugfix to a new feature ;-)
To be honest, I'm not sure I like Juno printing support. It doesn't respect methods for complex number and alignment of array elements defined in the package. Perhaps you can expand the PR to support also them? :-) |
I don't see anything wrong or not working as expected. And I also didn't write anything new to get this. Tell me want you want more and I will do it, provided that you will actually merge this PR. Don't have me doing stuff and then say "I guess I don't want them", please. For example adding the parenthesis for the complex numbers is almost trivial if you want that. |
In the REPL: julia> complex(rand() ± rand(), rand() ± rand())
(0.25740690768065977 ± 0.4055554063913367) + (0.7851017359568999 ± 0.9717133015119743)im
julia> [10.0^i ± 10.0^-i for i in 0:10]
11-element Array{Measurements.Measurement{Float64},1}:
1.0±1.0
10.0±0.1
100.0±0.01
1000.0±0.001
10000.0±0.0001
100000.0±1.0e-5
1.0e6±1.0e-6
1.0e7±1.0e-7
1.0e8±1.0e-8
1.0e9±1.0e-9
1.0e10±1.0e-10 For the complex numbers there are parentheses around each part, making it more readable and turning the output into valid input (there is also a test to be sure this is always true). Otherwise copying-and-pasting the output is a bit annoying, you have to manually add the parentheses. I see that Juno doesn't try to align at all standard arrays either, so that's a lost cause.
Ok, I promise I'll merge the PR if it supports complex numbers as well ;-) You can just adapt the As a side note, I hope you see that you have to repeat already valid methods in order to obtain the same feature only in Juno, because it doesn't respect |
Okay #12 works for me as well now after the update of Juno. I will implement 2 more methods to make this cool and a new feature and then you can merge if you want! Notice: it is not possible for me to do this without adding the Juno doesn't align standard arrays because of the Do you want this? As a Juno user I prefer having the rounded and clickable result. |
Codecov Report
@@ Coverage Diff @@
## master #13 +/- ##
==========================================
- Coverage 99.6% 98.04% -1.56%
==========================================
Files 8 8
Lines 504 512 +8
==========================================
Hits 502 502
- Misses 2 10 +8
Continue to review full report at Codecov.
|
So the tests fail because of nightlies not because of my changes, apparently. About adding tests..... I don't see how that is possible without adding Juno, sorry. I also don't see what could be tested? Whether the print statement returns something expected? Like giving 0.2 +/- 0.1 and seeing if it prints the same?
Yes I saw that I had to repeat 6 lines that compose an if statement, but I do not care about something that small if I get to see numbers and pluses in different colors. Also, all the |
I don't expect your changes to cause a failure in tests ;-) I'm aware of a couple of issues on nightly. One is a bug in Julia, already reported but not yet fixed, another one is the change of mathematical constant. Unless someones needs this to be fixed now I'll address it later.
Ok, that's fine.
Yes, that's what I do for |
Awesome, thanks! |
Thanks to you ;-) |
@Datseris is this feature still working? 🤔 In the |
Nope I don't think it is valid anymore, exactly because of the reason you said..... I haven't used this in quite a while so I'd suggest you to remove it / comment it out and when I use it again in the future I could make a new PR that fixes everything? At the moment I am very short on time to do such a thing, sorry. |
No description provided.