jump-dev / MatrixOptInterface.jl

An interface to pass matrix form problems
MIT License
11 stars 4 forks source link

Add support to MOI 0.10 #28

Closed frapac closed 3 years ago

frapac commented 3 years ago

All tests are passing, except this one:

MOI.copy_to(MOI.Bridges.Constraint.Scalarize{Float64}(model), form)
MOI.set(model, MOI.VariableName(), MOI.VariableIndex.(1:2), var_names)
MOI.set(model, MOI.ConstraintName(), MOI.ConstraintIndex{MOI.ScalarAffineFunction{Float64}, MOI.EqualTo{Float64}}.(1:2), con_names)
MOI.set(model, MOI.ConstraintName(), MOI.ConstraintIndex{MOI.VariableIndex, MOI.GreaterThan{Float64}}.(1:2), vcon_names)
MOIT.util_test_models_equal(model, expected, var_names, [con_names; vcon_names])

The problem is that VariableIndex does not support ConstraintName (whereas previously, SingleVariable does). Not sure what exactly to do about that.

codecov[bot] commented 3 years ago

Codecov Report

Merging #28 (7c26c3e) into master (4652d04) will increase coverage by 0.68%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #28      +/-   ##
==========================================
+ Coverage   85.80%   86.48%   +0.68%     
==========================================
  Files           5        5              
  Lines         317      333      +16     
==========================================
+ Hits          272      288      +16     
  Misses         45       45              
Impacted Files Coverage Δ
src/conic_form.jl 77.77% <100.00%> (+0.69%) :arrow_up:
src/matrix_input.jl 98.82% <100.00%> (+0.07%) :arrow_up:
src/sparse_matrix.jl 100.00% <100.00%> (ø)
src/MatrixOptInterface.jl 87.50% <0.00%> (-0.50%) :arrow_down:
src/change_form.jl 78.16% <0.00%> (+1.05%) :arrow_up:

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 4652d04...7c26c3e. Read the comment docs.

blegat commented 3 years ago

Remove

MOI.set(model, MOI.ConstraintName(), MOI.ConstraintIndex{MOI.VariableIndex, MOI.GreaterThan{Float64}}.(1:2), vcon_names)

and do

MOIT.util_test_models_equal(model, expected, var_names, con_names)

We dropped names for VariableIndex constraints.

frapac commented 3 years ago

Indeed, that solves the issue. Thanks for the pointer!