Tune: better formatting
This commit is contained in:
@@ -46,6 +46,7 @@ class LabelProgressBar:
|
||||
def set_prefix(self, prefix):
|
||||
self.prefix = prefix
|
||||
self.text_start = self.label.text
|
||||
self.label.text = self.text_start + "{0}: [{1}] {2: >3}%".format(prefix.ljust(17), ' '*self.length, 0)
|
||||
|
||||
def set_finished(self):
|
||||
self.old_percent = 0
|
||||
@@ -59,7 +60,7 @@ class LabelProgressBar:
|
||||
xformat = ','.join(map(str,map(int, x)))
|
||||
yformat = int(y)
|
||||
percent = int(round(percent * 100))
|
||||
msg = (self.prefix.ljust(10) + ": [{0}] {1: >3}% [{2} " + self.metric_name + "] ({3})").format(hashes + spaces, percent, yformat, xformat)
|
||||
msg = ("{0}: [{1}] {2: >3}% [{3} {4}] ({5})").format(self.prefix.ljust(17), hashes + spaces, percent, yformat, self.metric_name, xformat)
|
||||
if percent > self.old_percent:
|
||||
sleep(.01)
|
||||
self.label.text = self.text_start + msg
|
||||
|
@@ -26,6 +26,7 @@ IsaacScreen:
|
||||
id: out
|
||||
text: ''
|
||||
font_name: 'DroidSansMono'
|
||||
font_size: '12sp'
|
||||
text_size: self.width, self.height
|
||||
|
||||
|
||||
|
@@ -157,7 +157,7 @@ class Tuner:
|
||||
for b in best:
|
||||
try:
|
||||
perf += [performance(x, tools.benchmark(operation, profiles[b], tree))]
|
||||
except (sc.OperationNotSupported, sc.LaunchOutOfResources, sc.MemObjectAllocationFailure):
|
||||
except profile_execution_failure:
|
||||
pass
|
||||
predicted = profiles[best[argmax(perf)]]
|
||||
retune = not optimize.is_local_optimum(predicted, operation, x, context)
|
||||
|
@@ -45,6 +45,8 @@ class ProgressBar:
|
||||
|
||||
def set_prefix(self, prefix):
|
||||
self.prefix = prefix
|
||||
sys.stdout.write("{0}: [{1}] {2: >3}%".format(prefix.ljust(17), ' '*self.length, 0))
|
||||
sys.stdout.flush()
|
||||
|
||||
def set_finished(self):
|
||||
sys.stdout.write("\n")
|
||||
@@ -57,7 +59,7 @@ class ProgressBar:
|
||||
xformat = ','.join(map(str,map(int, x)))
|
||||
yformat = int(y)
|
||||
percentformat = int(round(percent * 100))
|
||||
sys.stdout.write(("\r" + self.prefix.ljust(10) + ": [{0}] {1: >3}% [{2} " + self.metric_name + "] ({3})").format(hashes + spaces, percentformat, yformat, xformat))
|
||||
sys.stdout.write(("\r{0}: [{1}] {2: >3}% [{3} {4}] ({5})").format(self.prefix.ljust(17), hashes + spaces, percentformat, yformat, self.metric_name, xformat))
|
||||
sys.stdout.flush()
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
Reference in New Issue
Block a user