From ab1e9ca3e0fd5bf21fe263117d99f6b2dd6a1062 Mon Sep 17 00:00:00 2001 From: carleton Date: Mon, 10 Feb 2020 14:34:17 -0700 Subject: [PATCH] drop compat for julia v0.6 support --- Project.toml | 8 +++++--- REQUIRE | 7 ------- src/Pajarito.jl | 31 ++++--------------------------- test/REQUIRE | 3 --- test/runtests.jl | 20 +++++--------------- 5 files changed, 14 insertions(+), 55 deletions(-) delete mode 100644 REQUIRE delete mode 100644 test/REQUIRE diff --git a/Project.toml b/Project.toml index a686af7..d1f8d47 100644 --- a/Project.toml +++ b/Project.toml @@ -4,13 +4,14 @@ repo = "https://github.com/JuliaOpt/Pajarito.jl.git" version = "0.6.2" [deps] -Compat = "34da2185-b29b-5c13-b0c7-acf172513d20" ConicBenchmarkUtilities = "e95a7839-07fb-532d-9a0e-071766bb5168" JuMP = "4076af6c-e467-56ae-b986-b466b2749572" +LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MathProgBase = "fdba3010-5040-5b88-9595-932c9decdf73" +Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" +SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" [compat] -Compat = "~1.0, ~2.0" ConicBenchmarkUtilities = "~0.3.1" ECOS = "≥ 0.9.1" GLPKMathProgInterface = "≥ 0.4.0" @@ -24,6 +25,7 @@ ECOS = "e2685f51-7e38-5353-a97d-a921fd2c8199" GLPKMathProgInterface = "3c7084bd-78ad-589a-b5bb-dbd673274bea" Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" SCS = "c946c3f1-0d1f-5ce8-9dea-7daa1f7e2d13" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["GLPKMathProgInterface", "SCS", "ECOS", "Logging"] +test = ["Test", "GLPKMathProgInterface", "SCS", "ECOS", "Logging"] diff --git a/REQUIRE b/REQUIRE deleted file mode 100644 index dcc9e19..0000000 --- a/REQUIRE +++ /dev/null @@ -1,7 +0,0 @@ -julia 0.6 - -MathProgBase 0.5 0.8- -JuMP 0.15 0.19- -ConicBenchmarkUtilities 0.3.1 - -Compat 1.0 \ No newline at end of file diff --git a/src/Pajarito.jl b/src/Pajarito.jl index c3ac81c..a6ec2bd 100644 --- a/src/Pajarito.jl +++ b/src/Pajarito.jl @@ -11,38 +11,15 @@ of mixed-integer linear (or second-order cone) programming problems that approximate the original MICP, until convergence. =========================================================# -__precompile__() - - module Pajarito import MathProgBase -using Compat.Printf -using Compat.SparseArrays -using Compat.LinearAlgebra - -import Compat: undef -import Compat: @warn -import Compat: stdout -import Compat: stderr -import Compat: findall -import Compat: hasmethod -import Compat: rmul! -import Compat: norm +using Printf +using SparseArrays +using LinearAlgebra -# Needed for only for Julia v0.6 compatability -if VERSION < v"0.7.0-" - eigen! = eigfact! -end - -if VERSION > v"0.7.0-" - # this is required because findall return type changed in v0.7 - function SparseArrays.findnz(A::AbstractMatrix) - I = findall(!iszero, A) - return (getindex.(I, 1), getindex.(I, 2), A[I]) - end -end +using ConicBenchmarkUtilities # to bring in SparseArrays.findnz impl include("conic_dual_solver.jl") include("solver.jl") diff --git a/test/REQUIRE b/test/REQUIRE deleted file mode 100644 index 7ea4a7e..0000000 --- a/test/REQUIRE +++ /dev/null @@ -1,3 +0,0 @@ -GLPKMathProgInterface 0.4 -ECOS 0.9.1 -SCS 0.4 diff --git a/test/runtests.jl b/test/runtests.jl index a6e729c..c91c62e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -9,23 +9,13 @@ using MathProgBase import ConicBenchmarkUtilities using Pajarito -using Compat.Test -using Compat.Printf +using Test +using Printf -import Compat: stdout -import Compat: stderr +using Logging +disable_logging(Logging.Error) - -if VERSION < v"0.7.0-" - jump_path = Pkg.dir("JuMP") -end - -if VERSION > v"0.7.0-" - using Logging - disable_logging(Logging.Error) - - jump_path = joinpath(dirname(pathof(JuMP)), "..") -end +jump_path = joinpath(dirname(pathof(JuMP)), "..") # Tests absolute tolerance and Pajarito printing level TOL = 1e-3