Skip to content

Commit 1456e56

Browse files
committed
Remove extra solutions logic, per commit to @andrewlee94's IDAES branch
1 parent 643865c commit 1456e56

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

pyomo/contrib/solver/base.py

+1-9
Original file line numberDiff line numberDiff line change
@@ -499,15 +499,7 @@ def _solution_handler(
499499
"""Method to handle the preferred action for the solution"""
500500
symbol_map = SymbolMap()
501501
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)
502+
model.solutions.add_symbol_map(symbol_map)
511503
legacy_results._smap_id = id(symbol_map)
512504
delete_legacy_soln = True
513505
if load_solutions:

0 commit comments

Comments
 (0)