xhatspecific_spoke: wire scenario_dict and all_nodenames (#586)#707
Merged
Conversation
xhatspecific_spoke in cfg_vanilla took `scenario_dict` and `all_nodenames` parameters but dropped both before constructing the spoke dict, so callers got "missing data" errors at runtime: * `all_nodenames` was not forwarded to _Xhat_Eval_spoke_foundation (sibling spokes like xhatshuffle_spoke already forward it). * `scenario_dict` should populate opt_kwargs.options.xhat_specific_options.xhat_scenario_dict, which the XhatSpecificInnerBound bounder reads at startup. Nothing was setting that key, so the bounder hit a KeyError before it could try a candidate. Fix: - Forward all_nodenames through to _Xhat_Eval_spoke_foundation. - Populate xhat_specific_options with xhat_scenario_dict (from the argument) and xhat_solver_options (mirroring xhatlooper_spoke's pattern of reusing iterk_solver_options). Also fix the only known caller, examples/aircond/aircond_cylinders.py: when `--solver-options` is passed alongside `--xhatspecific`, the override loop reached into `xhat_looper_options` (which xhatspecific does not have) instead of `xhat_specific_options`. Post-factory-fix this would still KeyError; rename to the correct key. Fixes Pyomo#586 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #707 +/- ##
==========================================
- Coverage 71.42% 71.42% -0.01%
==========================================
Files 154 154
Lines 19462 19463 +1
==========================================
Hits 13901 13901
- Misses 5561 5562 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
xhatspecific_spokeinmpisppy/utils/cfg_vanilla.pydeclaredscenario_dictandall_nodenamesparameters but discarded both before building the spoke dict, so callers got runtime errors (theXhatSpecificInnerBoundbounder readsopt.options['xhat_specific_options']['xhat_scenario_dict']at startup, and nothing was setting it).all_nodenamesto_Xhat_Eval_spoke_foundation(matchingxhatshuffle_spoke).opt_kwargs.options.xhat_specific_optionswithxhat_scenario_dict(from the argument) andxhat_solver_options(reusingiterk_solver_options, matchingxhatlooper_spoke's pattern).examples/aircond/aircond_cylinders.py: when--solver-optionswas passed alongside--xhatspecific, the override loop reached intoxhat_looper_options(which xhatspecific does not have) instead ofxhat_specific_options. Post-factory-fix that line would stillKeyError; renamed to the correct key.Test plan
ruff check .clean on changed filespython -c "from mpisppy.utils import cfg_vanilla"imports cleanlyxhatspecific_spoke; aircond example exercises it indirectly)🤖 Generated with Claude Code