Skip to content

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Add deactivatePricer #973

wants to merge 6 commits into from

Conversation

Joao-Dionisio
Copy link
Member

@Joao-Dionisio Joao-Dionisio commented Apr 14, 2025

This is useful if one wants to go for the Price and Branch heuristic in the middle of pricing

Copy link

@Copilot Copilot AI left a 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
Copy link
Member

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?

Copy link
Member Author

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
Copy link
Member Author

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

@Joao-Dionisio Joao-Dionisio requested a review from mmghannam April 15, 2025 10:35
Copy link

codecov bot commented Apr 15, 2025

Codecov Report

Attention: Patch coverage is 56.25000% with 7 lines in your changes missing coverage. Please review.

Project coverage is 53.32%. Comparing base (1db095e) to head (b9f8b91).
Report is 75 commits behind head on master.

Files with missing lines Patch % Lines
src/pyscipopt/scip.pxi 56.25% 7 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants