Skip to content

Commit

Permalink
deprecation fixes for julia 0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
mlubin committed Jul 29, 2016
1 parent a451e96 commit 7e57d0c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 0 additions & 2 deletions src/JuMP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ using Compat

import Compat: UTF8String, view

@compat import Base.show

function __init__()
ENABLE_NLP_RESOLVE[1] = false
end
Expand Down
1 change: 1 addition & 0 deletions src/operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ Base.promote_rule( ::Type{AffExpr}, ::Type{QuadExpr}) = QuadExpr
Base.promote_rule{R<:Real}(::Type{QuadExpr},::Type{R} ) = QuadExpr

_throw_transpose_error() = error("Transpose not currently implemented for JuMPArrays with arbitrary index sets.")
Base.transpose(x::AbstractJuMPScalar) = x
Base.transpose( x::JuMPArray) = _throw_transpose_error()
Base.ctranspose(x::JuMPArray) = _throw_transpose_error()

Expand Down
10 changes: 5 additions & 5 deletions test/model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ facts("[model] Test printing a model") do
# Test LP writer
writeLP(modA, modPath * "A.lp")
modALP = if VERSION >= v"0.5.0-dev+1866" # leading zero, base Julia PR #14377
ASCIIString[
String[
"Maximize",
"obj: 0.16666666666666666 VAR1 + 0.16666666666666666 VAR2 + 1 VAR3 + 1 VAR4",
"Subject To",
Expand All @@ -96,7 +96,7 @@ facts("[model] Test printing a model") do
"VAR2",
"End"]
else
ASCIIString[
String[
"Maximize",
"obj: .16666666666666666 VAR1 + .16666666666666666 VAR2 + 1 VAR3 + 1 VAR4",
"Subject To",
Expand Down Expand Up @@ -128,7 +128,7 @@ facts("[model] Test printing a model") do
# Test MPS writer
writeMPS(modA, modPath * "A.mps")
if VERSION >= v"0.5.0-dev+1866" # leading zero, base Julia PR #14377
modAMPS = ASCIIString[
modAMPS = String[
"NAME JuMPModel",
"ROWS",
" N OBJ",
Expand Down Expand Up @@ -172,7 +172,7 @@ facts("[model] Test printing a model") do
" UP BOUND VAR7 6",
"ENDATA"]
else
modAMPS = ASCIIString[
modAMPS = String[
"NAME JuMPModel",
"ROWS",
" N OBJ",
Expand Down Expand Up @@ -244,7 +244,7 @@ facts("[model] Quadratic MPS writer") do
#####################################################################
# Test MPS writer
writeMPS(modQ, modPath * "Q.mps")
modQMPS = ASCIIString[
modQMPS = String[
"NAME JuMPModel",
"ROWS",
" N OBJ",
Expand Down
2 changes: 1 addition & 1 deletion test/print.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function io_test(mode, obj, exp_str; repl=:both)
repl != :show && @fact sprint(print, obj) --> exp_str
repl != :print && @fact sprint(show, obj) --> exp_str
else
@fact sprint(writemime, "text/latex", obj) --> "\$\$ $exp_str \$\$"
@fact sprint(Compat.show, "text/latex", obj) --> "\$\$ $exp_str \$\$"
end
end

Expand Down

0 comments on commit 7e57d0c

Please sign in to comment.