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

Fix getting ForwardOutVariablePrimal with JuMP v0.22 #154

Merged
merged 1 commit into from
Nov 13, 2021
Merged

Conversation

blegat
Copy link
Member

@blegat blegat commented Nov 13, 2021

Follows @odow suggestion in 12/1 10:30-12:30

Closes #152

@codecov
Copy link

codecov bot commented Nov 13, 2021

Codecov Report

Merging #154 (c9d0fbc) into master (32434d8) will decrease coverage by 1.04%.
The diff coverage is 28.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #154      +/-   ##
==========================================
- Coverage   86.08%   85.03%   -1.05%     
==========================================
  Files           7        7              
  Lines         769      782      +13     
==========================================
+ Hits          662      665       +3     
- Misses        107      117      +10     
Impacted Files Coverage Δ
src/jump_moi_overloads.jl 57.44% <28.57%> (-5.52%) ⬇️

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 32434d8...c9d0fbc. Read the comment docs.

@blegat blegat merged commit 788c8b2 into master Nov 13, 2021
moi_func = MOI.get(JuMP.backend(model), attr, JuMP.index(con_ref))
return JuMP.jump_function(model, moi_func)
end

# FIXME Workaround for https://github.com/jump-dev/JuMP.jl/issues/2797
function _moi_get_result(model::MOI.ModelLike, args...)
Copy link
Member

Choose a reason for hiding this comment

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

Why'd you add _moi_get_result?

Copy link
Member Author

Choose a reason for hiding this comment

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

I wanted to call it from line 39 but I forgot. It seems best to do it to keep a consistent behavior. A solution is still needed so the status shouldn't be OPTIMIZE_NOT_CALLED.

@blegat blegat mentioned this pull request Nov 13, 2021
@odow odow deleted the bl/outvarprimal branch November 13, 2021 23:59
@odow
Copy link
Member

odow commented Nov 14, 2021

So this wasn't quite the fix I suggested. It now allows. you to get ForwardOutVariablePrimal if the model was modified. I suggested instead that setting ForwardInConstraint would skip the is_model_dirty flag.

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.

Allow setting and getting without optimize in between
2 participants