-
Notifications
You must be signed in to change notification settings - Fork 265
Add deactivatePricer #973
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
base: master
Are you sure you want to change the base?
Add deactivatePricer #973
Conversation
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.
Copilot reviewed 2 out of 4 changed files in this pull request and generated no comments.
Files not reviewed (2)
- src/pyscipopt/scip.pxd: Language not supported
- src/pyscipopt/scip.pxi: Language not supported
Comments suppressed due to low confidence (2)
tests/test_pricer.py:72
- Confirm that passing 'self' as a parameter to deactivatePricer matches its expected signature. If the pricer instance should be passed instead, update the argument accordingly.
self.model.deactivatePricer(self)
tests/test_pricer.py:236
- Consider adding an assertion directly verifying that the pricer deactivation is in effect after s.optimize(), enhancing the test coverage for the new functionality.
s.optimize()
@@ -124,6 +128,7 @@ def test_cuttingstock(): | |||
pricer.data['rollLength'] = rollLength | |||
pricer.data['patterns'] = patterns | |||
pricer.data['redcosts'] = [] | |||
pricer.data["deactivate"] = False |
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.
You could deactivate the price directly here instead of holding the data. Would that cause an issue?
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.
I wanted to test deactivating the pricer inside the pricer. Deactivating it before it doing anything feels a bit of a lame test
@@ -7593,6 +7593,7 @@ cdef class Model: | |||
PY_SCIP_CALL(SCIPactivatePricer(self._scip, scip_pricer)) | |||
pricer.model = <Model>weakref.proxy(self) | |||
Py_INCREF(pricer) | |||
pricer._name = name |
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.
How do you feel about this, @mmghannam? Having a protected attribute in the pricer class
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #973 +/- ##
==========================================
+ Coverage 52.54% 53.32% +0.78%
==========================================
Files 20 22 +2
Lines 4345 4960 +615
==========================================
+ Hits 2283 2645 +362
- Misses 2062 2315 +253 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This is useful if one wants to go for the Price and Branch heuristic in the middle of pricing