Skip to content

Commit

Permalink
Merge branch 'main' into bsm2_P_metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusHolly committed Sep 19, 2024
2 parents 08473d6 + e93578f commit 63408ac
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions watertap/core/plugins/solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,13 @@ def __init__(self, **kwds):

self._value_cache = pyo.ComponentMap()

def __getattr__(self, attr):
# if not available here, ask the base_solver
try:
return getattr(pyo.SolverFactory(self._base_solver), attr)
except AttributeError:
raise

def restore_initial_values(self, blk):
for var in blk.component_data_objects(pyo.Var, descend_into=True):
var.set_value(self._value_cache[var], skip_validation=True)
Expand Down

0 comments on commit 63408ac

Please sign in to comment.