Skip to content

Commit

Permalink
Fix MOI tests and tag new version (#109)
Browse files Browse the repository at this point in the history
* Support MOI.SolverVersion attribute

* Fix MOI tests

* Bump version

* Bump Julia compat requirement

* Build on julia 1.6 (LTS)

* Fix version number
  • Loading branch information
mtanneau authored Dec 15, 2021
1 parent 7c14ae9 commit 309d35d
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.6'
- '1'
- 'nightly'
os:
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Tulip"
uuid = "6dd1b50a-3aae-11e9-10b5-ef983d2400fa"
authors = ["Mathieu Tanneau <[email protected]>"]
version = "0.8.0"
version = "0.9.0"

[deps]
CodecBzip2 = "523fee87-0ab8-5b00-afb7-3ecf72e48cfd"
Expand All @@ -28,4 +28,4 @@ LinearOperators = "2.0"
MathOptInterface = "0.10"
QPSReader = "0.2"
TimerOutputs = "0.5.6"
julia = "1.3"
julia = "1.6"
12 changes: 9 additions & 3 deletions src/Interfaces/MOI/attributes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const SUPPORTED_OPTIMIZER_ATTR = Union{
MOI.NumberOfThreads,
MOI.RawOptimizerAttribute,
MOI.SolverName,
MOI.SolverVersion,
MOI.Silent,
MOI.TimeLimitSec,
}
Expand Down Expand Up @@ -32,6 +33,11 @@ end
#
MOI.get(::Optimizer, ::MOI.SolverName) = "Tulip"

#
# SolverVersion
#
MOI.get(::Optimizer, ::MOI.SolverVersion) = string(Tulip.version())

#
# Silent
#
Expand Down Expand Up @@ -139,7 +145,7 @@ function MOI.set(m::Optimizer, ::MOI.ObjectiveSense, s::MOI.OptimizationSense)
else
error("Objetive sense not supported: $s")
end

return nothing
end

Expand Down Expand Up @@ -231,10 +237,10 @@ end
# TODO: use inner query
function MOI.get(m::Optimizer, attr::MOI.DualStatus)
attr.result_index == 1 || return MOI.NO_SOLUTION

if isnothing(m.inner.solution)
return MOI.NO_SOLUTION
else
MOISolutionStatus(m.inner.solution.dual_status)
end
end
end
2 changes: 1 addition & 1 deletion src/Tulip.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using SparseArrays

using TimerOutputs

version() = v"0.8.0"
version() = v"0.9.0"

include("utils.jl")

Expand Down
16 changes: 15 additions & 1 deletion test/Interfaces/MOI_wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ const OPTIMIZER = TLP.Optimizer()

MOI.set(OPTIMIZER, MOI.Silent(), true)

const CONFIG = MOIT.Config(Float64, atol=1e-6, rtol=1e-6, exclude=Any[MOI.ConstraintBasisStatus, MOI.VariableBasisStatus])
const CONFIG = MOIT.Config(Float64, atol=1e-6, rtol=1e-6,
exclude=Any[
MOI.ConstraintBasisStatus,
MOI.VariableBasisStatus,
]
)

@testset "Direct optimizer" begin

Expand All @@ -33,6 +38,9 @@ const CONFIG = MOIT.Config(Float64, atol=1e-6, rtol=1e-6, exclude=Any[MOI.Constr
"test_variable_VariableName",
# requires get quadratic objective
"test_objective_get_ObjectiveFunction_ScalarAffineFunction",
# Tulip not compliant with MOI convention for primal/dual infeasible models
# See expected behavior at https://jump.dev/MathOptInterface.jl/dev/background/infeasibility_certificates/
"test_unbounded",
]
)

Expand Down Expand Up @@ -73,6 +81,9 @@ end
"test_variable_VariableName",
# requires get quadratic objective
"test_objective_get_ObjectiveFunction_ScalarAffineFunction",
# Tulip not compliant with MOI convention for primal/dual infeasible models
# See expected behavior at https://jump.dev/MathOptInterface.jl/dev/background/infeasibility_certificates/
"test_unbounded",
],
)
end
Expand Down Expand Up @@ -111,5 +122,8 @@ MOIU.@model(ModelData,
# should be NO_SOLUTION or INFEASIBLE_POINT
"test_conic_NormInfinityCone_INFEASIBLE",
"test_conic_NormOneCone_INFEASIBLE",
# Tulip not compliant with MOI convention for primal/dual infeasible models
# See expected behavior at https://jump.dev/MathOptInterface.jl/dev/background/infeasibility_certificates/
"test_unbounded",
])
end

2 comments on commit 309d35d

@mtanneau
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator register()

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

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.9.0 -m "<description of version>" 309d35de9c2ddd7d0fc22972538f102e6bd46618
git push origin v0.9.0

Please sign in to comment.