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

set_parameter -> set_optimizer_attribute #2150

Merged
merged 6 commits into from
Feb 4, 2020
Merged

set_parameter -> set_optimizer_attribute #2150

merged 6 commits into from
Feb 4, 2020

Conversation

odow
Copy link
Member

@odow odow commented Feb 3, 2020

Closes #2149

@codecov
Copy link

codecov bot commented Feb 3, 2020

Codecov Report

Merging #2150 into master will decrease coverage by 0.63%.
The diff coverage is 8.69%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2150      +/-   ##
==========================================
- Coverage   91.75%   91.12%   -0.64%     
==========================================
  Files          42       42              
  Lines        4075     4112      +37     
==========================================
+ Hits         3739     3747       +8     
- Misses        336      365      +29
Impacted Files Coverage Δ
src/JuMP.jl 73% <0%> (-7.4%) ⬇️
src/optimizer_interface.jl 81.81% <100%> (ø) ⬆️
src/utils.jl 52.63% <0%> (-6.2%) ⬇️
src/parse_nlp.jl 90.38% <0%> (-4.62%) ⬇️
src/quad_expr.jl 92.81% <0%> (-1.23%) ⬇️
src/macros.jl 92.61% <0%> (-0.77%) ⬇️
src/aff_expr.jl 87.85% <0%> (-0.64%) ⬇️
src/mutable_arithmetics.jl 91.93% <0%> (+1.61%) ⬆️

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 12b1d98...ee18055. Read the comment docs.

@blegat
Copy link
Member

blegat commented Feb 4, 2020

Looking forward, we would have set_optimizer_attribute, set_model_attribute, set_variable_attribute and set_constraint_attribute.
I may be redundant that we specify both in the function name and in the signature the different of attribute type.
Why not have a single set_attribute function with 4 different methods ?

@odow
Copy link
Member Author

odow commented Feb 4, 2020

Why not have a single set_attribute function with 4 different methods ?

People can always just do MOI.set(model, attr, index, value), which is actually less characters.

The reason for making optimizer_attribute special is so that it lines up with optimizer_with_attributes and because passing a string is fundamentally different.

For non-optimizer attributes, we either have things like set_start_value, or, for the more obscure ones, people should use MOI.set and know what they are doing.

@odow
Copy link
Member Author

odow commented Feb 4, 2020

Not sure what went wrong with coverage, because all of the lines I added got hit.

@odow odow merged commit c404d33 into master Feb 4, 2020
@odow odow deleted the od/parameter branch February 4, 2020 19:59
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.

Rename set_parameter to set_attributes
3 participants