Skip to content

Commit

Permalink
fixes display bug where columns are mislabeled
Browse files Browse the repository at this point in the history
  • Loading branch information
Niru Maheswaranathan committed Dec 26, 2015
1 parent 6f53a38 commit 348f5b7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions proxalgs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def minimize(self, theta_init, max_iter=50, callback=None, disp=0, tau=(10., 2.,
self.metadata['Primal resid'].append(primal_resid)
self.metadata['Dual resid'].append(dual_resid)
self.metadata['Time (s)'].append(time.time() - tstart)
self.metadata['Momentum'].append(rho)
self.metadata['rho'].append(rho)

# invoke the callback function with the current parameters and
# history
Expand Down Expand Up @@ -263,14 +263,16 @@ def update_display(self, iteration, disp_level, col_width=12): # pragma: no cove
data = valmap(last, self.metadata)

# choose what keys to use
keys = ['Time (s)', 'Primal resid', 'Dual resid', 'Momentum']
keys = ['Time (s)', 'Primal resid', 'Dual resid', 'rho']

# initial update. print out table headers
if iteration == 1:
print(tableprint.header(keys, column_width=col_width))

# print data
print(tableprint.row(data.values(), column_width=col_width, format_spec='4g'))
print(tableprint.row([data[k] for k in keys],
column_width=col_width,
format_spec='4g'))

if iteration == -1:
print(tableprint.hr(len(keys), column_width=col_width) + '\n')
Expand Down

0 comments on commit 348f5b7

Please sign in to comment.