You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During instantiation of a constraint-class, all types of constraints are added (e.g. constraints.py l. 30). This means that when utils.py (e.g. l 296) checks for hasattr(constraint, "sum_equals") it will always get a "True".
Solutions (?): Make a factory-class for constraints that only add attributes based on input from user or change the checks for sum_constraint in utils.py (?)
Finally, we should likely add some tests to ensure that "old" constraints are still working
The text was updated successfully, but these errors were encountered:
If there are no sum constraints, constraint.sum_equal is an empty list, right? So could we "just" change if hasattr(res.constraints, "sum_equals"): to if len(res.constraints)>0: in the lines 276 and 296? They are the only places in the repo where "sum_equals" is used.
But we absolutely need tests. It seems like the problem is localized to expected_minimum(), which might explain why tests didn't catch it.
As title says.
During instantiation of a constraint-class, all types of constraints are added (e.g. constraints.py l. 30). This means that when utils.py (e.g. l 296) checks for hasattr(constraint, "sum_equals") it will always get a "True".
Solutions (?): Make a factory-class for constraints that only add attributes based on input from user or change the checks for sum_constraint in utils.py (?)
Finally, we should likely add some tests to ensure that "old" constraints are still working
The text was updated successfully, but these errors were encountered: