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

Implement ConstraintFunction/ConstraintSet for VariablesContainer #1635

Merged
merged 5 commits into from
Oct 23, 2021

Conversation

blegat
Copy link
Member

@blegat blegat commented Oct 13, 2021

Needed for jump-dev/NLopt.jl#177
Since VariablesContainer is not a ModelLike, we need to reimplement the errors for setting function and sets of incorrect type. I thought we might as well defined proper error types instead of copy-pasting ArgumentError or creating helper functions.

@blegat blegat requested a review from odow October 19, 2021 17:38
@blegat
Copy link
Member Author

blegat commented Oct 22, 2021

@odow What do you think of merging this and cutting a v0.10.4 release so that we can update JuMP to MA v0.3 ?

Copy link
Member

@odow odow left a comment

Choose a reason for hiding this comment

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

LGTM. Agree on releasing 0.10.4

@@ -208,11 +211,11 @@ function test_errors_ConstraintSet_NotAllowed()
MOI.set(model, MOI.ConstraintSet(), ci, MOI.EqualTo(1.0))
)
@test_throws(
ArgumentError,
MOI.SetTypeMismatch{MOI.EqualTo{Float64},MOI.EqualTo{Int}},
Copy link
Member

Choose a reason for hiding this comment

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

Is this going to break solver tests?

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 don't expect many solver to throw the ArgumentError. They should rely on the fallback.

@blegat blegat merged commit e2cd0a9 into master Oct 23, 2021
@blegat blegat deleted the bl/varcont_setget branch October 23, 2021 11:06
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.

2 participants