Skip to content

Conversation

anatoliy-kuznetsov
Copy link
Contributor

@anatoliy-kuznetsov anatoliy-kuznetsov commented Aug 11, 2025

Fixes

N/A

Summary/Motivation:

When running pyomo solve with the SCIP solver, the serialized results files don't show the number of nodes explored. The SCIPAMPL handler parses the number of nodes in the SCIP solver log and returns it from read_scip_log, but not in the solver results returned from _postsolve. Including it would make it easier to assess changes in tree size when benchmarking.

Changes proposed in this PR:

  • Report the node count in the SolverResults
  • Update tests to expect this field

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

Copy link

codecov bot commented Aug 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.21%. Comparing base (35b2802) to head (8961c0e).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3691      +/-   ##
==========================================
+ Coverage   89.19%   89.21%   +0.01%     
==========================================
  Files         892      892              
  Lines      103015   103215     +200     
==========================================
+ Hits        91888    92081     +193     
- Misses      11127    11134       +7     
Flag Coverage Δ
builders 26.73% <0.00%> (+<0.01%) ⬆️
default 85.77% <100.00%> (?)
expensive 34.08% <0.00%> (?)
linux 86.95% <100.00%> (-1.98%) ⬇️
linux_other 86.95% <100.00%> (+<0.01%) ⬆️
osx 83.20% <0.00%> (-0.05%) ⬇️
win 85.15% <100.00%> (+<0.01%) ⬆️
win_other 85.15% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@github-project-automation github-project-automation bot moved this from Todo to Reviewer Approved in Pyomo 6.9.4 Release Aug 12, 2025
@anatoliy-kuznetsov
Copy link
Contributor Author

squashed commits to have a better message and less clutter

Copy link
Contributor

@emma58 emma58 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have one naming suggestion, but otherwise this looks good.

@@ -255,6 +255,7 @@ def _postsolve(self):

results.solver.time = log_dict['solving_time']
results.solver.gap = log_dict['gap']
results.solver.nodes = log_dict['solving_nodes']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think results.solver.node_count might be a clearer name, but I don't have super strong feelings about it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion! I've made this change.

@mrmundt mrmundt merged commit 7deb912 into Pyomo:main Aug 25, 2025
35 checks passed
@github-project-automation github-project-automation bot moved this from Reviewer Approved to Done in Pyomo 6.9.4 Release Aug 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

6 participants