lanl-ansi / Juniper.jl

A JuMP-based Nonlinear Integer Program Solver
https://lanl-ansi.github.io/Juniper.jl/stable/
MIT License
180 stars 22 forks source link

Bugfix when optimizer without attributes #202

Closed Wikunia closed 4 years ago

Wikunia commented 4 years ago

Bugfix for #201

This converts the optimizer to an optimizer with attributes in all cases. Haven't added a test for this yet as it creates quite some output from Ipopt.

codecov[bot] commented 4 years ago

Codecov Report

Merging #202 into master will decrease coverage by 0.28%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #202      +/-   ##
==========================================
- Coverage   92.33%   92.04%   -0.29%     
==========================================
  Files          22       22              
  Lines        2126     2012     -114     
==========================================
- Hits         1963     1852     -111     
+ Misses        163      160       -3     
Impacted Files Coverage Δ
src/bb_inits_and_defaults.jl 100.00% <ø> (ø)
src/MOI_wrapper/results.jl 80.76% <0.00%> (-3.11%) :arrow_down:
src/MOI_wrapper/variables.jl 73.23% <0.00%> (-1.77%) :arrow_down:
src/MOI_wrapper/constraints.jl 85.71% <0.00%> (-1.25%) :arrow_down:
src/util.jl 87.76% <0.00%> (-1.20%) :arrow_down:
src/MOI_wrapper/MOI_wrapper.jl 83.16% <0.00%> (-1.17%) :arrow_down:
src/printing.jl 78.94% <0.00%> (-0.60%) :arrow_down:
src/bb_strategies.jl 99.09% <0.00%> (-0.48%) :arrow_down:
src/bb_integral_or_branch.jl 96.77% <0.00%> (-0.37%) :arrow_down:
src/BnBTree.jl 93.43% <0.00%> (-0.26%) :arrow_down:
... and 10 more

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 1511404...98ec44c. Read the comment docs.

Wikunia commented 4 years ago

Do you mind to check this as well @umbe0 ? @ccoffrin I would like to figure out why the code coverage fails in quite a lot of cases before merging. Do you think it's okay to not have a test for this as the log would be quite huge or can you think of a way to not print it to the stdout?

umbe0 commented 4 years ago

Hi @Wikunia, I updated the Juniper package and I tried to execute my optimization with the setting m = Model(with_optimizer(Juniper.Optimizer; nl_solver = with_optimizer(Ipopt.Optimizer), mip_solver = with_optimizer(Cbc.Optimizer))) but the same error keeps coming out.

Wikunia commented 4 years ago

Hi @umbe0 thanks for trying it out. It's not merged and tagged yet. You have to install it via

(@v1.5) pkg> add Juniper#bugfix-optimizer_constructor

Thanks again!

umbe0 commented 4 years ago

Ah, sorry, I did not know. Anyway, I followed your indication and, at least in my case, it run correctly! The solver reaches convergence providing all the outputs and no error message. Thank you very much!

ccoffrin commented 4 years ago

@Wikunia, regarding the test. It is possible to capture stdout and stderr so that you will not see the solver's output. For example you can look at how it is done here,

https://github.com/JuliaOpt/Pajarito.jl/blob/master/test/qptest.jl

But I am also open to the idea of not having an explicit test for this case. We might think about adding it to MINLPTests.jl, as it is part of testing the JuMP API.

Wikunia commented 4 years ago

I've added a test case. But have no idea why codecov is failing.

ccoffrin commented 4 years ago

Coverage looks fine, so I would not worry about the codecov error, I would merge and tag.