Skip to content
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's print summary should include value type #3802

Closed
odow opened this issue Aug 8, 2024 · 6 comments · Fixed by #3803
Closed

Model's print summary should include value type #3802

odow opened this issue Aug 8, 2024 · 6 comments · Fixed by #3803

Comments

@odow
Copy link
Member

odow commented Aug 8, 2024

There's nothing to indicate that this is a GenericModel{BigFloat}:

julia> using JuMP

julia> file = joinpath(dirname(dirname(pathof(MOI))), "test", "FileFormats", "SDPA", "models", "example_A.dat-s")
"/Users/oscar/.julia/packages/MathOptInterface/2CULs/test/FileFormats/SDPA/models/example_A.dat-s"

julia> model = open(file, "r") do io
           return read(
               io,
               GenericModel{BigFloat};
               format = MOI.FileFormats.FORMAT_SDPA,
               number_type = BigFloat,
           )
       end
A JuMP Model
Minimization problem with:
Variables: 2
Objective function type: GenericAffExpr{BigFloat, GenericVariableRef{BigFloat}}
`Vector{GenericAffExpr{BigFloat, GenericVariableRef{BigFloat}}}`-in-`MathOptInterface.PositiveSemidefiniteConeTriangle`: 2 constraints
Model mode: AUTOMATIC
CachingOptimizer state: NO_OPTIMIZER
Solver name: No optimizer attached.
@odow
Copy link
Member Author

odow commented Aug 8, 2024

How about something like:

julia> model
A JuMP Model
├ objective_sense: MIN_SENSE
│ └ objective_function_type: AffExpr
├ num_variables: 1
├ num_constraints: 2
│ ├ VariableRef in MOI.GreaterThan{Float64}: 1
│ └ VariableRef in MOI.Integer: 1
├ backend
│ ├ mode: AUTOMATIC
│ ├ solver_name: HiGHS
│ └ value_type: Float64
└ registered names
  └ :x

@blegat
Copy link
Member

blegat commented Aug 8, 2024

I like it, we could also say if there is a bridge layer and if there are any bridge in bridge_type (we can say nothing if bridge_type is empty

@odow
Copy link
Member Author

odow commented Aug 8, 2024

So I wondered about this. There's merit to showing all of backend(model). But this makes it too big.

What about adding something like ├ backend: call `backend(model)` for more information

@odow
Copy link
Member Author

odow commented Aug 8, 2024

Bridges and caching optimizer and stuff is too complicated for general users.

Maybe we have just:

julia> model
A JuMP Model
├ value_type: Float64
├ objective_sense: MIN_SENSE
│ └ objective_function_type: AffExpr
├ num_variables: 1
├ num_constraints: 2
│ ├ VariableRef in MOI.GreaterThan{Float64}: 1
│ └ VariableRef in MOI.Integer: 1
└ registered names
  └ :x

@blegat
Copy link
Member

blegat commented Aug 8, 2024

We don't want to show all information but the bridge layer is a keyword argument to JuMP.Model we have JuMP.add_bridge so I thought we might add these too.
Not showing the backend at all as in your last comment is nice, the user can do backend(model) to see more. We could also omit value_type if it's Float64

@odow
Copy link
Member Author

odow commented Aug 9, 2024

See #3803.

For the bridges: I wonder if some mix of backend(model) and print_active_bridges(model) is enough. The bridges are irrelevant for new users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants