From 9ededd5a45e2bf501e1c0aa9275c2ce4f54e9888 Mon Sep 17 00:00:00 2001 From: Max Zwiessele Date: Thu, 14 May 2015 14:04:59 +0100 Subject: [PATCH] [opt messages] show DDdHHhMMmSSsMS --- GPy/core/verbose_optimization.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/GPy/core/verbose_optimization.py b/GPy/core/verbose_optimization.py index 0b1a5596..08c5e2dd 100644 --- a/GPy/core/verbose_optimization.py +++ b/GPy/core/verbose_optimization.py @@ -84,18 +84,20 @@ class VerboseOptimization(object): def print_out(self, seconds): if seconds<60: - self.timestring = "{:0>5.2f}".format(seconds) + ms = (seconds%1)*100 + self.timestring = "{s:0>2d}s{ms:0>2d}".format(s=int(seconds), ms=int(ms)) else: m, s = divmod(seconds, 60) if m>59: h, m = divmod(m, 60) if h>23: d, h = divmod(h, 24) - self.timestring = '{d:0>2d}/{h:0>2d}:{m:0>2d}'.format(m=int(m), h=int(h), d=int(d)) + self.timestring = '{d:0>2d}d{h:0>2d}h{m:0>2d}'.format(m=int(m), h=int(h), d=int(d)) else: - self.timestring = '{h:0>2d}:{m:0>2d}:{s:0>2d}'.format(m=int(m), s=int(s), h=int(h)) + self.timestring = '{h:0>2d}h{m:0>2d}m{s:0>2d}'.format(m=int(m), s=int(s), h=int(h)) else: - self.timestring = '{m:0>2d}:{s:0>5.2f}'.format(m=int(m), s=s) + ms = (seconds%1)*100 + self.timestring = '{m:0>2d}m{s:0>2d}s{ms:0>2d}'.format(m=int(m), s=int(s), ms=int(ms)) if self.ipython_notebook: names_vals = [['optimizer', "{:s}".format(self.opt_name)], ['runtime', "{:>s}".format(self.timestring)],