Skip to content

Throw GetAttributeNotAllowed in AbstractBridge getter#2988

Open
blegat wants to merge 3 commits intomasterfrom
bl/cannot_unbridge_error
Open

Throw GetAttributeNotAllowed in AbstractBridge getter#2988
blegat wants to merge 3 commits intomasterfrom
bl/cannot_unbridge_error

Conversation

@blegat
Copy link
Copy Markdown
Member

@blegat blegat commented Apr 3, 2026

If the user sets cannot_unbridge = true in MOI.Bridges.runtests then it is allowed to not implement MOI.ConstraintSet and MOI.ConstraintFunction (since these are actually mostly useless to implement).
This was working for SetMapBridge thanks to

if err isa MOI.Bridges.MapNotInvertible
msg = _not_invertible_error_message(attr, err.message)
throw(MOI.GetAttributeNotAllowed(attr, msg))
end

but actually not for classical AbstractBridge because it was throwing an ArgumentError. This PR fixes this.

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.

1 participant