Skip to content

Commit

Permalink
remove the need for Compat (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
ccoffrin authored Feb 10, 2020
1 parent 369d777 commit 094eddc
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 30 deletions.
7 changes: 4 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ repo = "https://github.com/JuliaOpt/MathProgBase.jl.git"
version = "0.7.8"

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

[compat]
Compat = "~0, ~1, ~2"
julia = "1"

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

[targets]
test = ["GLPKMathProgInterface", "ECOS", "Ipopt"]
test = ["Test", "GLPKMathProgInterface", "ECOS", "Ipopt"]
3 changes: 1 addition & 2 deletions src/HighLevelInterface/HighLevelInterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ module HighLevelInterface

using ..SolverInterface
using ..MathProgBase
using Compat

function warn_no_inf(T)
if !(isinf(typemin(T)) && isinf(typemax(T)))
@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.")
@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.")
end
end

Expand Down
4 changes: 2 additions & 2 deletions src/HighLevelInterface/linprog.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ function solvelp(m)
try
attrs[:infeasibilityray] = getinfeasibilityray(m)
catch
Compat.@warn("Problem is infeasible, but infeasibility ray (\"Farkas proof\") is unavailable; check that the proper solver options are set.")
@warn("Problem is infeasible, but infeasibility ray (\"Farkas proof\") is unavailable; check that the proper solver options are set.")
end
return LinprogSolution(stat, nothing, [], attrs)
elseif stat == :Unbounded
attrs = Dict()
try
attrs[:unboundedray] = getunboundedray(m)
catch
Compat.@warn("Problem is unbounded, but unbounded ray is unavailable; check that the proper solver options are set.")
@warn("Problem is unbounded, but unbounded ray is unavailable; check that the proper solver options are set.")
end
return LinprogSolution(stat, nothing, [], attrs)
else
Expand Down
5 changes: 2 additions & 3 deletions src/SolverInterface/SolverInterface.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
module SolverInterface

using Base.Meta
using Compat
using Compat.SparseArrays
using Compat.LinearAlgebra
using SparseArrays
using LinearAlgebra

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

Expand Down
4 changes: 2 additions & 2 deletions src/SolverInterface/conic_to_lpqp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ function getreducedcosts(wrap::ConicToLPQPBridge)
redcost[varidx] -= conedual[i]
end
if wrap.sense == :Max
Compat.rmul!(redcost, -1.0)
rmul!(redcost, -1.0)
end
return redcost
end
Expand All @@ -272,7 +272,7 @@ function getconstrduals(wrap::ConicToLPQPBridge)
constrduals[i-offset] -= conedual[i]
end
if wrap.sense == :Max
Compat.rmul!(constrduals, -1.0)
rmul!(constrduals, -1.0)
end
return constrduals
end
Expand Down
3 changes: 0 additions & 3 deletions test/REQUIRE

This file was deleted.

6 changes: 3 additions & 3 deletions test/conicinterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# Test the MathProgBase.jl interface for a provided conic solver.
#############################################################################

using Compat.Test
using Compat.LinearAlgebra
using Compat.SparseArrays
using Test
using LinearAlgebra
using SparseArrays
using MathProgBase

function coniclineartest(solver::MathProgBase.AbstractMathProgSolver;duals=false, tol=1e-6)
Expand Down
6 changes: 3 additions & 3 deletions test/linprog.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Compat.Test
using Compat.LinearAlgebra
using Compat.SparseArrays
using Test
using LinearAlgebra
using SparseArrays
using MathProgBase

function linprogtest(solver; objtol = 1e-7, primaltol = 1e-6)
Expand Down
5 changes: 2 additions & 3 deletions test/linproginterface.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Compat.Test
using Compat.LinearAlgebra
#using MathProgBase
using Test
using LinearAlgebra
using MathProgBase.SolverInterface

function linprogsolvertest(solver::AbstractMathProgSolver, eps = Base.rtoldefault(Float64))
Expand Down
4 changes: 2 additions & 2 deletions test/mixintprog.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Compat.Test
using Compat.LinearAlgebra
using Test
using LinearAlgebra
using MathProgBase

function mixintprogtest(solver)
Expand Down
3 changes: 1 addition & 2 deletions test/nlp.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using MathProgBase
using Compat
using Compat.Test
using Test

# Here the type represents the complete instance, but it
# could also store instance data.
Expand Down
4 changes: 2 additions & 2 deletions test/quadprog.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Compat.Test
using Compat.LinearAlgebra
using Test
using LinearAlgebra
using MathProgBase

function quadprogtest(solver)
Expand Down

2 comments on commit 094eddc

@ccoffrin
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register() v0.7.8

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/9509

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.8 -m "<description of version>" 094eddc51ee960e8a5f260a411f90053d2830d71
git push origin v0.7.8

Please sign in to comment.