Skip to content

Commit 094eddc

Browse files
authored
remove the need for Compat (#239)
1 parent 369d777 commit 094eddc

File tree

12 files changed

+24
-30
lines changed

12 files changed

+24
-30
lines changed

Project.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@ repo = "https://github.com/JuliaOpt/MathProgBase.jl.git"
44
version = "0.7.8"
55

66
[deps]
7-
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
7+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
8+
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
89

910
[compat]
10-
Compat = "~0, ~1, ~2"
1111
julia = "1"
1212

1313
[extras]
14+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1415
ECOS = "e2685f51-7e38-5353-a97d-a921fd2c8199"
1516
GLPKMathProgInterface = "3c7084bd-78ad-589a-b5bb-dbd673274bea"
1617
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"
1718

1819
[targets]
19-
test = ["GLPKMathProgInterface", "ECOS", "Ipopt"]
20+
test = ["Test", "GLPKMathProgInterface", "ECOS", "Ipopt"]

src/HighLevelInterface/HighLevelInterface.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ module HighLevelInterface
22

33
using ..SolverInterface
44
using ..MathProgBase
5-
using Compat
65

76
function warn_no_inf(T)
87
if !(isinf(typemin(T)) && isinf(typemax(T)))
9-
@Compat.warn("Element type $T does not have an infinite value. Note that this may artifically introduce ranged (two-sided) constraints. To avoid this, consider casting the problem data to Float64.")
8+
@warn("Element type $T does not have an infinite value. Note that this may artifically introduce ranged (two-sided) constraints. To avoid this, consider casting the problem data to Float64.")
109
end
1110
end
1211

src/HighLevelInterface/linprog.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ function solvelp(m)
8686
try
8787
attrs[:infeasibilityray] = getinfeasibilityray(m)
8888
catch
89-
Compat.@warn("Problem is infeasible, but infeasibility ray (\"Farkas proof\") is unavailable; check that the proper solver options are set.")
89+
@warn("Problem is infeasible, but infeasibility ray (\"Farkas proof\") is unavailable; check that the proper solver options are set.")
9090
end
9191
return LinprogSolution(stat, nothing, [], attrs)
9292
elseif stat == :Unbounded
9393
attrs = Dict()
9494
try
9595
attrs[:unboundedray] = getunboundedray(m)
9696
catch
97-
Compat.@warn("Problem is unbounded, but unbounded ray is unavailable; check that the proper solver options are set.")
97+
@warn("Problem is unbounded, but unbounded ray is unavailable; check that the proper solver options are set.")
9898
end
9999
return LinprogSolution(stat, nothing, [], attrs)
100100
else

src/SolverInterface/SolverInterface.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
module SolverInterface
22

33
using Base.Meta
4-
using Compat
5-
using Compat.SparseArrays
6-
using Compat.LinearAlgebra
4+
using SparseArrays
5+
using LinearAlgebra
76

87
const methods_by_tag = Dict{Symbol,Vector{Symbol}}()
98

src/SolverInterface/conic_to_lpqp.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ function getreducedcosts(wrap::ConicToLPQPBridge)
259259
redcost[varidx] -= conedual[i]
260260
end
261261
if wrap.sense == :Max
262-
Compat.rmul!(redcost, -1.0)
262+
rmul!(redcost, -1.0)
263263
end
264264
return redcost
265265
end
@@ -272,7 +272,7 @@ function getconstrduals(wrap::ConicToLPQPBridge)
272272
constrduals[i-offset] -= conedual[i]
273273
end
274274
if wrap.sense == :Max
275-
Compat.rmul!(constrduals, -1.0)
275+
rmul!(constrduals, -1.0)
276276
end
277277
return constrduals
278278
end

test/REQUIRE

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/conicinterface.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
# Test the MathProgBase.jl interface for a provided conic solver.
66
#############################################################################
77

8-
using Compat.Test
9-
using Compat.LinearAlgebra
10-
using Compat.SparseArrays
8+
using Test
9+
using LinearAlgebra
10+
using SparseArrays
1111
using MathProgBase
1212

1313
function coniclineartest(solver::MathProgBase.AbstractMathProgSolver;duals=false, tol=1e-6)

test/linprog.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
using Compat.Test
2-
using Compat.LinearAlgebra
3-
using Compat.SparseArrays
1+
using Test
2+
using LinearAlgebra
3+
using SparseArrays
44
using MathProgBase
55

66
function linprogtest(solver; objtol = 1e-7, primaltol = 1e-6)

test/linproginterface.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
using Compat.Test
2-
using Compat.LinearAlgebra
3-
#using MathProgBase
1+
using Test
2+
using LinearAlgebra
43
using MathProgBase.SolverInterface
54

65
function linprogsolvertest(solver::AbstractMathProgSolver, eps = Base.rtoldefault(Float64))

test/mixintprog.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using Compat.Test
2-
using Compat.LinearAlgebra
1+
using Test
2+
using LinearAlgebra
33
using MathProgBase
44

55
function mixintprogtest(solver)

test/nlp.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using MathProgBase
2-
using Compat
3-
using Compat.Test
2+
using Test
43

54
# Here the type represents the complete instance, but it
65
# could also store instance data.

test/quadprog.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using Compat.Test
2-
using Compat.LinearAlgebra
1+
using Test
2+
using LinearAlgebra
33
using MathProgBase
44

55
function quadprogtest(solver)

0 commit comments

Comments
 (0)