Skip to content

Commit

Permalink
update to 1.0 (#61)
Browse files Browse the repository at this point in the history
* update to 1.0

* update julia versions
  • Loading branch information
mileslucas authored Jun 22, 2020
1 parent e5a6d32 commit 26f7557
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 30 deletions.
31 changes: 31 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

# Created by https://www.toptal.com/developers/gitignore/api/julia
# Edit at https://www.toptal.com/developers/gitignore?templates=julia

### Julia ###
# Files generated by invoking Julia with --code-coverage
*.jl.cov
*.jl.*.cov

# Files generated by invoking Julia with --track-allocation
*.jl.mem

# System-specific files and directories generated by the BinaryProvider and BinDeps packages
# They contain absolute paths specific to the host computer, and so should not be committed
deps/deps.jl
deps/build.log
deps/downloads/
deps/usr/
deps/src/

# Build artifacts for creating documentation generated by the Documenter package
docs/build/
docs/site/

# File generated by Pkg, the package manager, based on a corresponding Project.toml
# It records a fixed state of all packages used by the project. As such, it should not be
# committed for packages, but should be committed for applications that require a static
# environment.
Manifest.toml

# End of https://www.toptal.com/developers/gitignore/api/julia
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ os:
- linux
- osx
julia:
- 0.6
- 0.7
- 1.0
- 1
notifications:
email: false
sudo: false # use a docker worker
Expand Down
20 changes: 20 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name = "GLPKMathProgInterface"
uuid = "3c7084bd-78ad-589a-b5bb-dbd673274bea"
version = "0.5.0"

[deps]
GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MathProgBase = "fdba3010-5040-5b88-9595-932c9decdf73"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[compat]
GLPK = "0.6,0.7,0.8,0.9,0.10,0.11,0.12,0.13"
MathProgBase = "0.5,0.7,0.8"
julia = "1"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
4 changes: 0 additions & 4 deletions REQUIRE

This file was deleted.

5 changes: 2 additions & 3 deletions src/GLPKInterfaceBase.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
module GLPKInterfaceBase

using Compat
using Compat.SparseArrays
using Compat.LinearAlgebra
using SparseArrays
using LinearAlgebra
import GLPK

import MathProgBase
Expand Down
9 changes: 4 additions & 5 deletions src/GLPKInterfaceLP.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
module GLPKInterfaceLP

using Compat
using Compat.SparseArrays
using Compat.LinearAlgebra
using SparseArrays
using LinearAlgebra

import GLPK
import MathProgBase
Expand Down Expand Up @@ -52,7 +51,7 @@ function MPB.LinearQuadraticModel(s::GLPKSolverLP)
elseif s.method == :InteriorPoint
param = GLPK.InteriorParam()
if s.presolve
Compat.@warn("Ignored option: presolve")
@warn "Ignored option: presolve"
end
else
error("This is a bug")
Expand All @@ -64,7 +63,7 @@ function MPB.LinearQuadraticModel(s::GLPKSolverLP)
t = typeof(param).types[i]
setfield!(param, i, convert(t, v))
else
Compat.@warn("Ignored option: $(string(k))")
@warn "Ignored option: $(string(k))"
end
end
lpm = GLPKMathProgModelLP(GLPK.Prob(), s.method, param, false)
Expand Down
23 changes: 11 additions & 12 deletions src/GLPKInterfaceMIP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import GLPK
import MathProgBase
const MPB = MathProgBase
using ..GLPKInterfaceBase
using Compat
using Compat.SparseArrays
using Compat.LinearAlgebra
using SparseArrays
using LinearAlgebra

export GLPKSolverMIP, GLPKCallbackData

Expand Down Expand Up @@ -41,14 +40,14 @@ function Base.copy(m::GLPKMathProgModelMIP)
m2.param = deepcopy(m.param)
m2.smplxparam = deepcopy(m.smplxparam)

m.lazycb == nothing || @Compat.warn "Callbacks can't be copied, lazy callback ignored"
m.cutcb == nothing || @Compat.warn "Callbacks can't be copied, cut callback ignored"
m.heuristiccb == nothing || @Compat.warn "Callbacks can't be copied, heuristic callback ignored"
m.infocb == nothing || @Compat.warn "Callbacks can't be copied, info callback ignored"
m.lazycb == nothing || @warn "Callbacks can't be copied, lazy callback ignored"
m.cutcb == nothing || @warn "Callbacks can't be copied, cut callback ignored"
m.heuristiccb == nothing || @warn "Callbacks can't be copied, heuristic callback ignored"
m.infocb == nothing || @warn "Callbacks can't be copied, info callback ignored"

m2.objbound = m.objbound

m.cbdata == nothing || @Compat.warn "Callbacks can't be copied, callbackdata ignored"
m.cbdata == nothing || @warn "Callbacks can't be copied, callbackdata ignored"

m2.binaries = deepcopy(m.binaries)
m2.userlimit = m.userlimit
Expand Down Expand Up @@ -165,7 +164,7 @@ function MPB.LinearQuadraticModel(s::GLPKSolverMIP)

for (k,v) in s.opts
if k in [:cb_func, :cb_info]
Compat.@warn("ignored option: $(string(k)); use the MathProgBase callback interface instead")
@warn "ignored option: $(string(k)); use the MathProgBase callback interface instead"
continue
end
i = findfirst(x->x==k, fieldnames(typeof(lpm.param)))
Expand All @@ -177,7 +176,7 @@ function MPB.LinearQuadraticModel(s::GLPKSolverMIP)
t = typeof(lpm.smplxparam).types[s]
setfield!(lpm.smplxparam, s, convert(t, v))
else
Compat.@warn("Ignored option: $(string(k))")
@warn "Ignored option: $(string(k))"
continue
end
end
Expand Down Expand Up @@ -364,7 +363,7 @@ function MPB.cbaddsolution!(d::GLPKCallbackData)
u = MPB.getvarUB(d.model)
for i in 1:length(l)
if d.sol[i] < l[i] - 1e-6 || d.sol[i] > u[i] + 1e-6
Compat.@warn("Ignoring infeasible solution from heuristic callback")
@warn "Ignoring infeasible solution from heuristic callback"
return
end
end
Expand All @@ -374,7 +373,7 @@ function MPB.cbaddsolution!(d::GLPKCallbackData)
y = A*d.sol
for i in 1:length(lb)
if y[i] < lb[i] - 1e-6 || y[i] > ub[i] + 1e-6
Compat.@warn("Ignoring infeasible solution from heuristic callback")
@warn "Ignoring infeasible solution from heuristic callback"
return
end
end
Expand Down
3 changes: 1 addition & 2 deletions test/mathprog.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Compat.Pkg
const mathprogbase_test = joinpath(dirname(pathof(MathProgBase)), "..", "test")

@testset "MathProgBase tests" begin
mathprogbase_test = joinpath(Pkg.dir("MathProgBase"), "test")

include(joinpath(mathprogbase_test, "linprog.jl"))
linprogtest(GLPKSolverLP())
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using GLPKMathProgInterface, GLPK
using MathProgBase
using Compat.Test
using Test

include("params.jl")
include("setbounds.jl")
Expand Down
2 changes: 1 addition & 1 deletion test/setbounds.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using GLPKMathProgInterface, MathProgBase
using Compat.Test
using Test

@testset "Invalid bounds" begin
solver = GLPKSolverLP()
Expand Down

2 comments on commit 26f7557

@mlubin
Copy link
Member

@mlubin mlubin commented on 26f7557 Jun 22, 2020

Choose a reason for hiding this comment

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

@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/16758

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 the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.5.0 -m "<description of version>" 26f755770f8b70a81ade83cd1e6d85fa8c8254c9
git push origin v0.5.0

Please sign in to comment.