Callback metric values might not just be integers - allow floats

pull/1177/head
Paul "LeoNerd" Evans 2016-10-19 13:53:55 +01:00
parent 7d2cf7e960
commit b21b9dbc37
1 changed files with 2 additions and 2 deletions

View File

@ -98,9 +98,9 @@ class CallbackMetric(BaseMetric):
value = self.callback()
if self.is_scalar():
return ["%s %d" % (self.name, value)]
return ["%s %.12g" % (self.name, value)]
return ["%s%s %d" % (self.name, self._render_key(k), value[k])
return ["%s%s %.12g" % (self.name, self._render_key(k), value[k])
for k in sorted(value.keys())]