1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-09-03 03:42:35 +01:00

fw/output: better classifiers format for metrics

Use a dict-like string representation for classifiers, rather than the
default OrderedDict one, which is a lot more verbose and difficult to
read.
This commit is contained in:
Sergei Trofimov
2019-01-10 09:53:55 +00:00
committed by Marc Bonnici
parent 4c6636eb72
commit ed95755af5
2 changed files with 12 additions and 2 deletions

View File

@@ -626,3 +626,13 @@ def resolve_unique_domain_cpus(name, target):
if domain_cpus[0] not in unique_cpus:
unique_cpus.append(domain_cpus[0])
return unique_cpus
def format_ordered_dict(od):
"""
Provide a string representation of ordered dict that is similar to the
regular dict representation, as that is more concise and easier to read
than the default __str__ for OrderedDict.
"""
return '{{{}}}'.format(', '.join('{}={}'.format(k, v)
for k, v in od.items()))