Skip to content

constraint.problem is not always being reset in _remove_constraints of Model #271

@axelvonkamp

Description

@axelvonkamp

In _remove_constraints there is a branch when the number of constraints to be removed is > 350 (line 1578 in interface.py). When this is the case the constraints are removed but their problem attribute is not being set to None (as is being done in the else branch). This leads to an error when a list of more than 350 constraints is being added, then removed, and then being added again.
Adding a simple loop

for c in constraints:
    c.problem = None

to the if branch will resolve this bug.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions