-
Notifications
You must be signed in to change notification settings - Fork 270
API: addMatrixCons
supports ExprCons
#1036
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
(it will take a little bit for me to be able to look into this) |
@Zeroto521 can you edit your test so that |
Added comments to the test_catching_errors function in test_matrix_variable.py to clarify the purpose of each exception test case.
Added a test case to ensure addMatrixCons raises a ValueError when provided with an initial array of incorrect shape.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1036 +/- ##
==========================================
+ Coverage 54.13% 54.34% +0.21%
==========================================
Files 22 23 +1
Lines 5045 5255 +210
==========================================
+ Hits 2731 2856 +125
- Misses 2314 2399 +85 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR extends the addMatrixCons
method to accept both ExprCons
and MatrixExprCons
objects, providing more flexibility in constraint handling. The change allows scalar expression constraints to be passed to the matrix constraint function.
Key changes:
- Modified
addMatrixCons
to accept bothExprCons
andMatrixExprCons
types - Updated tests to reflect the new API behavior
- Updated documentation and changelog
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/pyscipopt/scip.pxi | Updated addMatrixCons method signature and implementation to handle both constraint types |
tests/test_matrix_variable.py | Modified test cases to verify new functionality and updated method calls |
CHANGELOG.md | Added entry documenting the API change |
Comments suppressed due to low confidence (1)
CHANGELOG.md:21
- The method name should be consistently capitalized. It should be 'addMatrixCons' not 'AddMatrixCons' to match the actual method name.
- AddMatrixCons also accepts ExprCons.
closes to #1034