There are a lot of warnings which are always of no need to be fixed, while including code files. This makes the IJulia page messy. How to hide these warnings in Julia language or IJulia? Can anyone help? Thanks!
Thanks for your swift reply! I have tried but got an error of no definition of installkernel() function.
I use Julia 0.5.2, IJulia 1.5.1, on windows 7.
I also tested addkernel() function. Also got the error of “no function defined”.
@kristoffer.carlsson Totally agree with you. It is the common workflow to redefine the function during developing and testing. I write the functions using Juno, and calling them in IJulia to show the results. It works well for me. The only pain thing is the ugly IJulia notebook caused by the large amount of warnings.
I try to fix it with the following code suggested by @stevengj. However, the code can not run correctly.
using IJulia
IJulia.installkernel("Julia nodeps", "--depwarn=no")
@stevengj Thanks for your reply. I am able to run “installkernel()” and also able to change to the new kernel. However, the warnings are still there. I found that this function created a new kernel.json adding a new parameter of “–depwarn=no”.
In fact, before posting this question I have already tried to add this to kernel.json manually. But, it does not work it only suppresses the deprecation warnings.
Thank you so much for your help. By the way, the package of PyCall.jl and PyPlot.jl are extremely helpful. Without these two packages, maybe I cannot keep on using Julia. I can use many packages from Python which are still not existed in Julia. Thanks for your great work!
Yes, as @kristoffer.carlsson pointed out, the specific warnings you are showing are not deprecation warnings, so they won’t be affected by --depwarn=no.
In the meantime, however, the presence of all of these warning suggests that you may have a coding style that is not idiomatic for Julia. Why are you including code files that redefine the same functions over and over?
@stevengj Thanks for your suggestion. Most of the time, the warnings indicate the potential improper coding.
The “redefine the same functions” may be caused by two reasons
(a) I “include()” code files repeatedly in the *.jl files. (b) It is related to the workflow. I edit the code files in Juno and call the functions and check the result in IJulia. If the result is not good enough, I revise the code in Juno and “include()” the code file in IJulia again. I found this workflow is quite convenient for me.
For global suppression of logging at different levels such as debug, info, warn, or error, use the following (I’ve confirmed that it works in iJulia in Jupyter Lab/Notebook):
Logging.disable_logging(Logging.Info)
This suppresses all messages/logging for debug and info. This can be referenced in Julia docs logging.
(Posting this here as this page is the top google result for “julia ignore warning”; and it was the solution that worked for me, after trying the above).