Skip to content

Commit 1c3f8df

Browse files
jd-laraodow
andauthored
Update to JuMP v0.23 (#88)
Co-authored-by: Oscar Dowson <odow@users.noreply.github.com>
1 parent 2ddaa29 commit 1c3f8df

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919
- version: '1'
2020
os: ubuntu-latest
2121
arch: x64
22-
- version: '1.0'
22+
- version: '1.6'
2323
os: ubuntu-latest
2424
arch: x64
25-
- version: '1.0'
25+
- version: '1.6'
2626
os: ubuntu-latest
2727
arch: x86
2828
- version: '1'

Project.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ParameterJuMP"
22
uuid = "774612a8-9878-5177-865a-ca53ae2495f9"
33
repo = "https://github.com/JuliaStochOpt/ParameterJuMP.jl.git"
4-
version = "0.3.2"
4+
version = "0.4.0"
55

66
[deps]
77
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
@@ -10,10 +10,10 @@ MutableArithmetics = "d8a4904e-b15c-11e9-3269-09a3773c0cb0"
1010
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
1111

1212
[compat]
13-
JuMP = "0.22"
14-
MathOptInterface = "0.10"
15-
MutableArithmetics = "0.3"
16-
julia = "1"
13+
JuMP = "0.23"
14+
MathOptInterface = "1"
15+
MutableArithmetics = "1"
16+
julia = "1.6"
1717

1818
[extras]
1919
GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6"

src/constraints.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ end
299299
# constraint modification
300300
# ------------------------------------------------------------------------------
301301

302-
function JuMP.set_coefficient(con::CtrRef{F, S}, p::ParameterRef, coef::Number) where {F<:SAF, S}
302+
function JuMP.set_normalized_coefficient(con::CtrRef{F, S}, p::ParameterRef, coef::Number) where {F<:SAF, S}
303303
data = _getparamdata(p)
304304
dict = _get_param_dict(data, S)
305305
old_coef = 0.0

src/print.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function JuMP.function_string(::Type{REPLMode}, p::ParameterRef)
1+
function JuMP.function_string(::Type{MIME("text/plain")}, p::ParameterRef)
22
par_name = name(p)
33
if !isempty(par_name)
44
return par_name
@@ -7,7 +7,7 @@ function JuMP.function_string(::Type{REPLMode}, p::ParameterRef)
77
end
88
end
99

10-
function JuMP.function_string(::Type{IJuliaMode}, p::ParameterRef)
10+
function JuMP.function_string(::Type{MIME("text/latex")}, p::ParameterRef)
1111
par_name = name(p)
1212
if !isempty(par_name)
1313
# TODO: This is wrong if parameter name constains extra "]"
@@ -40,4 +40,4 @@ function JuMP.function_string(mode, a::ParameterJuMP.PAE, show_constant=true)
4040
JuMP._string_round(abs(a.v.constant)))
4141
end
4242
return ret
43-
end
43+
end

test/tests.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ function test_set_coefficient(args...)
236236
@test JuMP.dual(α) == 0.0
237237
@test parametrized_dual_objective_value(model) 0α
238238

239-
set_coefficient(cref, α, 1.0)
239+
JuMP.set_normalized_coefficient(cref, α, 1.0)
240240
JuMP.optimize!(model)
241241
@test JuMP.value(x) == -1.0
242242
@test JuMP.dual(cref) == -1.0
@@ -257,7 +257,7 @@ function test_change_coefficient(args...)
257257
@test JuMP.dual(α) == 1.0
258258
@test parametrized_dual_objective_value(model) 1α
259259

260-
ParameterJuMP.set_coefficient(cref, α, -2.0)
260+
ParameterJuMP.set_normalized_coefficient(cref, α, -2.0)
261261
JuMP.optimize!(model)
262262
@test JuMP.value(x) == -2.0
263263
@test JuMP.dual(cref) == 1.0
@@ -278,7 +278,7 @@ function test_set_coefficient_lazy(args...)
278278
@test JuMP.dual(α) == 0.0
279279
@test parametrized_dual_objective_value(model) 0α
280280

281-
set_coefficient(cref, α, 1.0)
281+
set_normalized_coefficient(cref, α, 1.0)
282282
JuMP.optimize!(model)
283283
@test JuMP.value(x) == -1.0
284284
@test JuMP.dual(cref) == -1.0
@@ -301,7 +301,7 @@ function test_set_coefficient_lazy2(args...)
301301
@test JuMP.dual(b) == -1.0
302302
@test parametrized_dual_objective_value(model) -b
303303

304-
set_coefficient(cref, α, 1.0)
304+
set_normalized_coefficient(cref, α, 1.0)
305305
JuMP.optimize!(model)
306306
@test JuMP.value(x) == -1.0
307307
@test JuMP.dual(cref) == -1.0

0 commit comments

Comments
 (0)