-
-
Notifications
You must be signed in to change notification settings - Fork 395
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
Model printing is rather verbose #3651
Comments
We don't recommend We don't have any plans to improve the output, like detecting sets and printing stylized models. At one point (many years ago) JuMP used to do that, but it proved too complicated and fragile to maintain. |
We'd have to decide if truncating printing by default is breaking though. I'm imagining something like: function _print_model(io::IO, model::AbstractModel; force::Bool)
N = num_variables(model)
if N > 100 && !force
@warn(
"There a $N variables in the model. Printing may produce an " *
"undesirably large amount of output. To force printing, use " *
"`print(model; force = true)`"
)
return
end |
Right, lossily truncating the output is of course not always wanted.
This should also count number of constraints perhaps. |
I suppose i knew it would be printed the way it did, I suppose i should look more into https://jump.dev/MathOptInterface.jl/stable/reference/standard_form/ |
Consider something as simple as
This produces ~30k lines of output.
Given that each
x[i]
can even have it's own type,i can't imagine solving this is too simple,
but surely this can be improved?
(I've encountered this the hard way, with chrome tab crashing
(and, you can't even increase per-tab memory limits nowadays!),
and had to fix it by manually going into
.ipynb
notebook...)The text was updated successfully, but these errors were encountered: