Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add constraint by name #1701

Merged
merged 11 commits into from Dec 22, 2018
Merged

Add constraint by name #1701

merged 11 commits into from Dec 22, 2018

Conversation

blegat
Copy link
Member

@blegat blegat commented Dec 21, 2018

Closes #1184

@blegat blegat changed the title Bl/constraint by name Add constraint by name Dec 21, 2018
"""
set_name(v::ConstraintRef, s::AbstractString)

Set a constraint's name.
Copy link
Member

Choose a reason for hiding this comment

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

Name attribute

name::String)::Union{ConstraintRef, Nothing}

Returns the reference of the constraint with name attribute `name` or `Nothing`
if no constraint have this name attribute. Throws an error if several
Copy link
Member

Choose a reason for hiding this comment

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

typo: have -> has

@mlubin mlubin assigned odow and unassigned odow Dec 21, 2018
@mlubin mlubin requested a review from odow December 21, 2018 13:14
@mlubin
Copy link
Member

mlubin commented Dec 21, 2018

@odow Could you check that the text of how we refer to name attributes is consistent with the rest of the documentation?


Returns the reference of the constraint with name attribute `name` or `Nothing`
if no constraint have this name attribute. Throws an error if several
constraints have `name` as name attribute.
Copy link
Member

Choose a reason for hiding this comment

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

as their name attribute.

MOI.AbstactFunction}},
S::Type{<:MOI.AbstractSet})::Union{ConstraintRef, Nothing}

Same as method above except that it throws an error if the constraint is not an
Copy link
Member

Choose a reason for hiding this comment

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

Similar to the method above, except that

S::Type{<:MOI.AbstractSet})::Union{ConstraintRef, Nothing}

Same as method above except that it throws an error if the constraint is not an
`F`-in-`S` contraint where `F` is either the JuMP or MOI type of the function
Copy link
Member

Choose a reason for hiding this comment

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

of the function,

Same as method above except that it throws an error if the constraint is not an
`F`-in-`S` contraint where `F` is either the JuMP or MOI type of the function
and `S` is either the JuMP or MOI type of the set. This method is recommended
if you know the typeof the function and set as its returned type can be
Copy link
Member

Choose a reason for hiding this comment

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

the type of the

and set since its returned type

`F`-in-`S` contraint where `F` is either the JuMP or MOI type of the function
and `S` is either the JuMP or MOI type of the set. This method is recommended
if you know the typeof the function and set as its returned type can be
inferred while for the method above, the exact return type of the constraint
Copy link
Member

Choose a reason for hiding this comment

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

inferred. For the method above (i.e. without F and S), the exact

name(::JuMP.ConstraintRef{Model, <:JuMP.MOI.ConstraintIndex})
set_name(::JuMP.ConstraintRef{Model, <:JuMP.MOI.ConstraintIndex}, ::String)
```
.
Copy link
Member

Choose a reason for hiding this comment

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

Delete this

@codecov
Copy link

codecov bot commented Dec 21, 2018

Codecov Report

Merging #1701 into master will increase coverage by 0.02%.
The diff coverage is 76.92%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1701      +/-   ##
==========================================
+ Coverage   68.52%   68.55%   +0.02%     
==========================================
  Files          30       30              
  Lines        3867     3880      +13     
==========================================
+ Hits         2650     2660      +10     
- Misses       1217     1220       +3
Impacted Files Coverage Δ
src/variables.jl 82.28% <ø> (ø) ⬆️
src/aff_expr.jl 71.17% <0%> (-0.65%) ⬇️
src/quad_expr.jl 70.09% <0%> (-0.67%) ⬇️
src/constraints.jl 71.42% <90.9%> (+2.93%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b78da67...92eff61. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 21, 2018

Codecov Report

Merging #1701 into master will increase coverage by 0.06%.
The diff coverage is 76.92%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1701      +/-   ##
==========================================
+ Coverage   68.52%   68.59%   +0.06%     
==========================================
  Files          30       30              
  Lines        3867     3885      +18     
==========================================
+ Hits         2650     2665      +15     
- Misses       1217     1220       +3
Impacted Files Coverage Δ
src/variables.jl 82.28% <ø> (ø) ⬆️
src/aff_expr.jl 71.17% <0%> (-0.65%) ⬇️
src/quad_expr.jl 70.09% <0%> (-0.67%) ⬇️
src/constraints.jl 71.42% <90.9%> (+2.93%) ⬆️
src/objective.jl 95.23% <0%> (+1.48%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b78da67...3b1ebd2. Read the comment docs.

@mlubin mlubin merged commit a6a9c6e into master Dec 22, 2018
@mlubin mlubin deleted the bl/constraint_by_name branch December 22, 2018 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants