Skip to content

Commit 5f5f85f

Browse files
authored
Update POI (#316)
* Update POI * change error * up to poi 0.14 * fix poi and update test
1 parent 2542e45 commit 5f5f85f

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ JuMP = "1"
2323
LazyArrays = "0.21, 0.22, 1"
2424
MathOptInterface = "1.18"
2525
MathOptSetDistances = "0.2.9"
26-
ParametricOptInterface = "0.12.1"
26+
ParametricOptInterface = "0.14"
2727
julia = "1.6"

src/parameters.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ function MOI.get(
315315
if _is_parameter(model, variable)
316316
error("Trying to get a forward variable sensitivity for a parameter")
317317
end
318-
return MOI.get(model.optimizer, attr, model.variables[variable])
318+
return MOI.get(model.optimizer, attr, variable)
319319
end
320320

321321
# reverse mode

test/jump.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ function test_psd_square_error()
729729

730730
@constraint(model, con, [-p*x 0; 0 x] in PSDCone())
731731

732-
@test_throws MOI.SetAttributeNotAllowed optimize!(model)
732+
@test_throws MOI.Bridges.ModifyBridgeNotAllowed optimize!(model)
733733

734734
# DiffOpt.set_forward_parameter(model, p, 1.0)
735735
# DiffOpt.forward_differentiate!(model)

test/moi_wrapper.jl

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,20 @@ function test_moi_test_runtests()
3434
# )
3535
MOI.set(model, MOI.Silent(), true)
3636
config =
37-
MOI.Test.Config(; atol = 1e-7, exclude = Any[MOI.compute_conflict!])
38-
MOI.Test.runtests(model, config)
37+
MOI.Test.Config(; atol = 1e-7, exclude = Any[MOI.compute_conflict!,])
38+
MOI.Test.runtests(
39+
model,
40+
config;
41+
exclude = Any[
42+
# removed because of the `ZerosBridge` issue:
43+
# https://github.com/jump-dev/MathOptInterface.jl/issues/2861
44+
# - zeros bridge does not support duals because it cumbersome
45+
# - many bridges do not support get ConstraintFunction because it is cumbersome
46+
# so there is no way out of this error for now.
47+
# at the same time this is a modeling corner case tha could be avoided
48+
# by the user.
49+
"test_conic_linear_VectorOfVariables_2"],
50+
)
3951
return
4052
end
4153

0 commit comments

Comments
 (0)