Repository navigation
Conversation
Reject constraint expressions without a comparison and empty constraints on models without variables. Avoid querying invalid CBC row matrix data after the last variable is removed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #364. Reject expressions with no comparison and empty constraints when the model has no variables with a clear InvalidLinExpr error, rather than passing invalid input or returning a broken CBC constraint. Existing empty constraints remain supported when the model has variables. Avoid querying invalid CBC row-matrix data if the last variable is subsequently removed.
Regression tests cover the original reproduction, zero-variable empty constraints, and inspection and removal of an empty constraint after removing the last variable.
Local validation: 596 passed, 34 skipped (full suite with doctests and warnings as errors). Black and Flake8 passed on the changed package files. In paired local benchmarks, ordinary row insertion showed no clear slowdown; inserting 50,000 empty rows took about 7 ms longer in the median.