-
Notifications
You must be signed in to change notification settings - Fork 271
Fixed bug when accessing matrix variable attributes #970
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
Ideally, if there is no column to the variable for example if the variable is deleted already or no LP created yet. |
@DominikKamp would it make sense to add a precondition to the method, even though it takes in |
Maybe you meant to check the upper bounds of the columns after optimizing but you might need to disable presolving before. |
Returning |
The precondition can be that the variable is in the LP. |
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 addresses a bug related to accessing matrix variable attributes. The changes include:
- Adding a new test function (test_MatrixVariable_attributes) to verify multiple matrix variable attributes.
- Adjusting the changelog to reflect the bug fix.
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
tests/test_matrix_variable.py | Introduces tests to verify methods for matrix variable attributes. |
CHANGELOG.md | Updates the changelog with the bug fix description. |
Files not reviewed (1)
- src/pyscipopt/scip.pxi: Language not supported
Comments suppressed due to low confidence (1)
tests/test_matrix_variable.py:303
- The test for getCol is commented out, leaving its behavior untested; consider adding a TODO or reference to the bug tracking issue (#969) to clarify why this test is disabled and outline plans for future validation.
#assert x.getCol().tolist()# == [[5, 6], [2, 8]]
Ah no, I didn't mean to check the upper bounds of the columns, the rhs of the check was there from copy-pasting. I just wanted to access the method. I think the error is explicit enough. |
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.
Looks good, thanks @Joao-Dionisio!
Fix #969
There's still a bug with
getCol
, but that one is also a bug in the normal variables. I'm thinking it may just be about adding an assertion.@DominikKamp do you know when
SCIPvarGetCol
returns NULL?