Giter Club home page Giter Club logo

Comments (5)

odow avatar odow commented on June 1, 2024

We don't recommend print(model) for large models. But perhaps we should figure out a way to truncate the output.

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.

from jump.jl.

odow avatar odow commented on June 1, 2024

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

from jump.jl.

LebedevRI avatar LebedevRI commented on June 1, 2024

Right, lossily truncating the output is of course not always wanted.
I understand that this issue is rather a nitpick.

I'm imagining something like:

This should also count number of constraints perhaps.

from jump.jl.

odow avatar odow commented on June 1, 2024

Here are some related issues where we have discussed this previously #3574, #2171, #795

I think the issue is that there is no one-size-fits-all approach to what people want from print(model).

What did you want or expect to happen in the original case?

from jump.jl.

LebedevRI avatar LebedevRI commented on June 1, 2024

I suppose i knew it would be printed the way it did,
but i suppose i would've expected it to be printed in more succinct, non-unrolled, form.

I suppose i should look more into https://jump.dev/MathOptInterface.jl/stable/reference/standard_form/

from jump.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.