You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At least in Pluto notebooks, I want the initial call output = trunk(nlp) to show the complete output.
From the little I gathered, there are two strategies:
Don't have a separate print functions, instead, put everything in show; or
Use MIME types to show a different output for Pluto (which I guess is related to HTML).
This is moved from JuliaSmoothOptimizers/SolverTools.jl#93
To define the issue better:
The is a show method in https://github.com/JuliaSmoothOptimizers/SolverCore.jl/blob/main/src/stats.jl#L405
And a print method right below.
This means that on the REPL, the output of
is
And to see details, you have to use
print(output)
Which shows
At least in Pluto notebooks, I want the initial call
output = trunk(nlp)
to show the complete output.From the little I gathered, there are two strategies:
print
functions, instead, put everything inshow
; orI like option 2 more. @tmigot @dpo, opinions?
There is some information about display vs show vs print in this JuliaCon 2020 video: https://www.youtube.com/watch?v=S1Fb5oNhhbc that might be useful.
To reproduce, open a Pluto notebook and add the following cells:
Cell 1
using ADNLPModel, JSOSolvers
Cell 2
let
nlp = ADNLPModel(x -> (x[1] - 1)^2 + 4 * (x[2] - x[1]^2)^2, [-1.2; 1.0])
output = trunk(nlp)
end
There is also a
compact::Bool
flag inshow
, that might be enough to have a single function with everything.The text was updated successfully, but these errors were encountered: