Skip to content

Conversation

blegat
Copy link
Member

@blegat blegat commented Apr 5, 2018

Closes #291

@codecov-io
Copy link

codecov-io commented Apr 5, 2018

Codecov Report

Merging #297 into master will increase coverage by <.01%.
The diff coverage is 96.72%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #297      +/-   ##
==========================================
+ Coverage   96.18%   96.19%   +<.01%     
==========================================
  Files          25       25              
  Lines        4192     4227      +35     
==========================================
+ Hits         4032     4066      +34     
- Misses        160      161       +1
Impacted Files Coverage Δ
src/MathOptInterface.jl 100% <ø> (ø) ⬆️
src/Utilities/universalfallback.jl 100% <100%> (ø) ⬆️
src/Utilities/model.jl 98.68% <100%> (+0.04%) ⬆️
src/Test/modellike.jl 100% <100%> (ø) ⬆️
src/Utilities/mockoptimizer.jl 95.51% <100%> (+0.64%) ⬆️
src/Utilities/cachingoptimizer.jl 88.71% <100%> (ø) ⬆️
src/Utilities/copy.jl 90.47% <88.88%> (-1.76%) ⬇️
src/attributes.jl 93.61% <0%> (+0.13%) ⬆️

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 5e3963d...f62a3ba. Read the comment docs.

@test MOI.supportsconstraint(dest, MOI.VectorAffineFunction{Float64}, MOI.Zeros)

copyresult = MOI.copy!(dest, src)
copyresult = MOI.copy!(dest, src; copynames=false)
Copy link
Member

Choose a reason for hiding this comment

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

the semicolon isn't needed at call sites, you can say MOI.copy!(dest, src, copynames=false)

function attachoptimizer!(m::CachingOptimizer)
@assert m.state == EmptyOptimizer
copy_result = MOI.copy!(m.optimizer, m.model_cache)
# We do not need to copy names are name-related operation are handled by `m.model_cache`
Copy link
Member

Choose a reason for hiding this comment

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

malformed sentence. maybe: "we do not need to copy names because name-related operations are handled by m.model_cache"

attribute_value_map(idxmap, f::MOI.AbstractFunction) = mapvariables(idxmap, f)
attribute_value_map(idxmap, attribute_value) = attribute_value
function defaultcopy!(dest::MOI.ModelLike, src::MOI.ModelLike)
function defaultcopy!(dest::MOI.ModelLike, src::MOI.ModelLike, copynames::Bool)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add a deprecation to not immediately break all solver interfaces that use defaultcopy!

@mlubin mlubin mentioned this pull request Apr 8, 2018
5 tasks
@assert m.state == EmptyOptimizer
copy_result = MOI.copy!(m.optimizer, m.model_cache)
# We do not need to copy names because name-related operations are handled by `m.model_cache`
copy_result = MOI.copy!(m.optimizer, m.model_cache; copynames=false)
Copy link
Member

Choose a reason for hiding this comment

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

Semicolon can be comma here also

attribute_value_map(idxmap, f::MOI.AbstractFunction) = mapvariables(idxmap, f)
attribute_value_map(idxmap, attribute_value) = attribute_value
function defaultcopy!(dest::MOI.ModelLike, src::MOI.ModelLike)
warn("defaultcopy!(dest, src) is deprecated, use defaultcopy!(dest, src, false) instead or defaultcopy!(dest, src, true) if you do not want to copy names.")
Copy link
Member

Choose a reason for hiding this comment

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

Are false and true swapped here? true is the default, and you use false if you do not want to copy names

Copy link
Member Author

Choose a reason for hiding this comment

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

Oups, indeed

@blegat blegat merged commit 5f33132 into master Apr 10, 2018
@blegat blegat deleted the bl/copynames branch April 21, 2018 08:22
@odow odow mentioned this pull request Aug 13, 2021
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.

3 participants