Skip to content

Commit

Permalink
Add timing information to legacy results wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmundt committed Feb 1, 2024
1 parent 462457b commit a0ad77e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pyomo/contrib/solver/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,10 @@ def _solution_handler(
legacy_soln.variable['Rc'] = val

legacy_results.solution.insert(legacy_soln)
# Timing info was not originally on the legacy results, but we want
# to make it accessible to folks who are utilizing the backwards
# compatible version.
legacy_results.timing_info = results.timing_info
if delete_legacy_soln:
legacy_results.solution.delete(0)
return legacy_results
Expand Down
1 change: 1 addition & 0 deletions pyomo/contrib/solver/ipopt.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ def solve(self, model, **kwds):
results.timing_info.wall_time = (
end_timestamp - start_timestamp
).total_seconds()
results.timing_info.timer = timer
return results

def _parse_ipopt_output(self, stream: io.StringIO):
Expand Down

0 comments on commit a0ad77e

Please sign in to comment.