1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-31 10:11:17 +00:00

docs/dev_info/processing_output: Fix formatting

This commit is contained in:
Marc Bonnici 2018-12-18 11:33:37 +00:00
parent b93beb3f1f
commit ea5ea90bb6

View File

@ -152,10 +152,6 @@ For the purposes of this report, they will be used to augment the metric's name.
scores[workload][name][freq] = metric scores[workload][name][freq] = metric
rows = []
for workload in sorted(scores.keys()):
wldata = scores[workload]
Once the metrics have been sorted, generate the report showing the delta Once the metrics have been sorted, generate the report showing the delta
between the two configurations (indicated by the "frequency" classifier) and between the two configurations (indicated by the "frequency" classifier) and
highlight any unexpected deltas (based on the ``lower_is_better`` attribute of highlight any unexpected deltas (based on the ``lower_is_better`` attribute of
@ -165,23 +161,27 @@ statically significant deltas.)
.. code-block:: python .. code-block:: python
for name in sorted(wldata.keys()): rows = []
min_score = wldata[name]['min'].value for workload in sorted(scores.keys()):
max_score = wldata[name]['max'].value wldata = scores[workload]
delta = max_score - min_score
units = wldata[name]['min'].units or ''
lib = wldata[name]['min'].lower_is_better
warn = '' for name in sorted(wldata.keys()):
if (lib and delta > 0) or (not lib and delta < 0): min_score = wldata[name]['min'].value
warn = '!!!' max_score = wldata[name]['max'].value
delta = max_score - min_score
units = wldata[name]['min'].units or ''
lib = wldata[name]['min'].lower_is_better
rows.append([workload, name, warn = ''
'{:.3f}'.format(min_score), '{:.3f}'.format(max_score), if (lib and delta > 0) or (not lib and delta < 0):
'{:.3f}'.format(delta), units, warn]) warn = '!!!'
# separate workloads with a blank row rows.append([workload, name,
rows.append(['', '', '', '', '', '', '']) '{:.3f}'.format(min_score), '{:.3f}'.format(max_score),
'{:.3f}'.format(delta), units, warn])
# separate workloads with a blank row
rows.append(['', '', '', '', '', '', ''])
write_table(rows, sys.stdout, align='<<>>><<', write_table(rows, sys.stdout, align='<<>>><<',
@ -276,23 +276,23 @@ Below is the complete example code, and a report it generated for a sample run.
for workload in sorted(scores.keys()): for workload in sorted(scores.keys()):
wldata = scores[workload] wldata = scores[workload]
for name in sorted(wldata.keys()): for name in sorted(wldata.keys()):
min_score = wldata[name]['min'].value min_score = wldata[name]['min'].value
max_score = wldata[name]['max'].value max_score = wldata[name]['max'].value
delta = max_score - min_score delta = max_score - min_score
units = wldata[name]['min'].units or '' units = wldata[name]['min'].units or ''
lib = wldata[name]['min'].lower_is_better lib = wldata[name]['min'].lower_is_better
warn = '' warn = ''
if (lib and delta > 0) or (not lib and delta < 0): if (lib and delta > 0) or (not lib and delta < 0):
warn = '!!!' warn = '!!!'
rows.append([workload, name, rows.append([workload, name,
'{:.3f}'.format(min_score), '{:.3f}'.format(max_score), '{:.3f}'.format(min_score), '{:.3f}'.format(max_score),
'{:.3f}'.format(delta), units, warn]) '{:.3f}'.format(delta), units, warn])
# separate workloads with a blank row # separate workloads with a blank row
rows.append(['', '', '', '', '', '', '']) rows.append(['', '', '', '', '', '', ''])
write_table(rows, sys.stdout, align='<<>>><<', write_table(rows, sys.stdout, align='<<>>><<',