Skip to content

[GUROBI] Change error message for non-existent constraint#102

Open
staadecker wants to merge 1 commit into
metab0t:masterfrom
staadecker:ms/fix
Open

[GUROBI] Change error message for non-existent constraint#102
staadecker wants to merge 1 commit into
metab0t:masterfrom
staadecker:ms/fix

Conversation

@staadecker

Copy link
Copy Markdown

This pull request fixes an issue where the following code

import pyoptinterface as poi
from pyoptinterface.gurobi import Model

m = Model()
x = m.add_variable()
constr = m.add_linear_constraint(x >= 1)
m.delete_constraint(constr)
m.get_constraint_attribute(constr, poi.ConstraintAttribute.Name)

outputs

RuntimeError: Variable does not exist

instead of

RuntimeError: Constraint does not exist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant