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

WIP: Base.show for Model #1602

Merged
merged 3 commits into from
Nov 28, 2018
Merged

WIP: Base.show for Model #1602

merged 3 commits into from
Nov 28, 2018

Conversation

mlubin
Copy link
Member

@mlubin mlubin commented Nov 10, 2018

Demo:

using JuMP, GLPK

m = Model(with_optimizer(GLPK.Optimizer))
@variable(m, x[1:2] >= 0)
@constraint(m, c, sum(x) <= 1)
julia> m
A JuMP Model
Variables: 2
`MathOptInterface.SingleVariable`-in-`MathOptInterface.GreaterThan{Float64}`: 2 constraints
`MathOptInterface.ScalarAffineFunction{Float64}`-in-`MathOptInterface.LessThan{Float64}`: 1 constraints
Model mode: Automatic
CachingOptimizer state: EmptyOptimizer
Solver name: SolverName() attribute not implemented by the optimizer.
Names registered in the model: c, x

julia> JuMP.optimize!(m)
julia> m
A JuMP Model
Variables: 2
`MathOptInterface.SingleVariable`-in-`MathOptInterface.GreaterThan{Float64}`: 2 constraints
`MathOptInterface.ScalarAffineFunction{Float64}`-in-`MathOptInterface.LessThan{Float64}`: 1 constraints
Model mode: Automatic
CachingOptimizer state: AttachedOptimizer
Solver name: SolverName() attribute not implemented by the optimizer.
Names registered in the model: c, x

Depends on jump-dev/MathOptInterface.jl#565.

@blegat
Copy link
Member

blegat commented Nov 28, 2018

@mlubin Ok to merge this so that I can rebase #1646 on top ?

@mlubin
Copy link
Member Author

mlubin commented Nov 28, 2018

It's missing tests but I guess it's ok to merge.

@blegat
Copy link
Member

blegat commented Nov 28, 2018

There is a test in #1646 that I can modify to make the output match

@codecov
Copy link

codecov bot commented Nov 28, 2018

Codecov Report

Merging #1602 into master will decrease coverage by 0.41%.
The diff coverage is 20.83%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1602      +/-   ##
==========================================
- Coverage   90.93%   90.51%   -0.42%     
==========================================
  Files          28       28              
  Lines        3782     3805      +23     
==========================================
+ Hits         3439     3444       +5     
- Misses        343      361      +18
Impacted Files Coverage Δ
src/macros.jl 89.89% <ø> (ø) ⬆️
src/objective.jl 93.33% <ø> (ø) ⬆️
src/print.jl 73.07% <0%> (-5.68%) ⬇️
src/JuMP.jl 75% <62.5%> (-1.05%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 16ef512...9a9210c. Read the comment docs.

@blegat blegat merged commit e5264e7 into master Nov 28, 2018
@blegat blegat deleted the ml/printout branch December 12, 2018 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants