Skip to content

Commit

Permalink
Update to JuMP v1 (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
nignatiadis authored May 4, 2022
1 parent 463d79d commit f6d3a95
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: julia

julia:
- 1.1
- 1
- 1.6
- 1.7

os:
- linux
Expand Down
8 changes: 4 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name = "LinearFractional"
uuid = "31851ddc-f9b7-5097-a470-69ef907d7682"
version = "0.7.4"
version = "0.7.5"

[deps]
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"

[compat]
JuMP = "^0.21"
JuMP = "^1"
MacroTools = "^0.5"
MathOptInterface = "^0.9"
julia = "^1"
MathOptInterface = "^1"
julia = "^1.6"

[extras]
Cbc = "9961bab8-2fa3-5c5a-9d89-47fab24efd76"
Expand Down
7 changes: 2 additions & 5 deletions src/LinearFractional.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ import JuMP: @constraint,
linear_terms,
index,
Containers,
variable_type,
ScalarVariable,
add_variable,
constant,
Expand Down Expand Up @@ -98,10 +97,10 @@ mutable struct LinearFractionalModel <: AbstractModel
end

function LinearFractionalModel(optimizer;
bridge_constraints::Bool=true, kwargs...)
add_bridges::Bool=true, kwargs...)
model = LinearFractionalModel(; kwargs...)
JuMP.set_optimizer(model.model, optimizer,
bridge_constraints=bridge_constraints)
add_bridges=add_bridges)
return model
end

Expand Down Expand Up @@ -161,7 +160,6 @@ Base.copy(v::LinearFractionalVariableRef, new_model::LinearFractionalModel) = Li
Base.:(==)(v::LinearFractionalVariableRef, w::LinearFractionalVariableRef) = v.model === w.model && (v.vref == w.vref)
Base.broadcastable(v::LinearFractionalVariableRef) = Ref(v)
JuMP.isequal_canonical(v::LinearFractionalVariableRef, w::LinearFractionalVariableRef) = v == w
JuMP.variable_type(::LinearFractionalModel) = LinearFractionalVariableRef
function JuMP.add_variable(m::LinearFractionalModel, v::JuMP.AbstractVariable, name::String="")

inner_vref = JuMP.add_variable(m.model, v, name)
Expand Down Expand Up @@ -255,7 +253,6 @@ function transform_constraint(model::LinearFractionalModel, constraint_ref::Cons
JuMP.set_normalized_coefficient(constraint_ref, model.t, -α)
end

JuMP.constraint_type(::LinearFractionalModel) = ConstraintRef
function JuMP.add_constraint(model::LinearFractionalModel, c::JuMP.AbstractConstraint,
name::String="")
cref = JuMP.add_constraint(model.model, c, name)
Expand Down

5 comments on commit f6d3a95

@ianfiske
Copy link
Collaborator

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.

Error while trying to register: Changing package repo URL not allowed, please submit a pull request with the URL change to the target registry and retry.

@ianfiske
Copy link
Collaborator

Choose a reason for hiding this comment

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

Opened JuliaRegistries/General#59672 to fix URL-change. Will try the re-release after this is merged.

@ianfiske
Copy link
Collaborator

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/59696

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.7.5 -m "<description of version>" f6d3a95583310e22b54351a2615fc5495683be26
git push origin v0.7.5

Please sign in to comment.