Skip to content

Commit 56efbf0

Browse files
authored
Pass-through AbstractOptimizerAttribute (#335)
* handle `AbstractOptimizerAttribute` * test + format * fix runic's mess
1 parent dc86850 commit 56efbf0

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/moi_wrapper.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,3 +1045,7 @@ end
10451045
function MOI.get(model::Optimizer, ::NonLinearKKTJacobianFactorization)
10461046
return model.input_cache.factorization
10471047
end
1048+
1049+
function MOI.set(model::Optimizer, attr::MOI.AbstractOptimizerAttribute, value)
1050+
return MOI.set(model.optimizer, attr, value)
1051+
end

test/jump_wrapper.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ function test_jump_api()
5656
@testset "$(MODEL) with: $(SOLVER), $(ineq ? "ineqs" : "eqs"), $(_min ? "Min" : "Max"), $(flip ? "geq" : "leq") bridge:$with_bridge_type" begin
5757
model = MODEL(SOLVER; with_bridge_type)
5858
set_silent(model)
59+
if SOLVER === Ipopt.Optimizer
60+
# avoiding MOI.TimeLimitSec to cover the RawOptimizerAttribute path
61+
# only tests that MOI doesn't throw an unsupported error (#335)
62+
set_optimizer_attribute(model, "max_wall_time", 600.0)
63+
end
5964

6065
p_val = 4.0
6166
pc_val = 2.0

0 commit comments

Comments
 (0)