We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 643865c commit 1456e56Copy full SHA for 1456e56
pyomo/contrib/solver/base.py
@@ -499,15 +499,7 @@ def _solution_handler(
499
"""Method to handle the preferred action for the solution"""
500
symbol_map = SymbolMap()
501
symbol_map.default_labeler = NumericLabeler('x')
502
- try:
503
- model.solutions.add_symbol_map(symbol_map)
504
- except AttributeError:
505
- # Something wacky happens in IDAES due to the usage of ScalarBlock
506
- # instead of PyomoModel. This is an attempt to fix that.
507
- from pyomo.core.base.PyomoModel import ModelSolutions
508
-
509
- setattr(model, 'solutions', ModelSolutions(model))
510
+ model.solutions.add_symbol_map(symbol_map)
511
legacy_results._smap_id = id(symbol_map)
512
delete_legacy_soln = True
513
if load_solutions:
0 commit comments