llvm.org GIT mirror lnt / b565629
[LNT] Python 3 support: Remove implicit tuple parameter unpacking on lambdas Summary: Lambda changes split out and updated from D67535. Applies the `2to3 -f tuple_params` fixes, tweaks the variable naming, and updates the affected tuples to be named tuples. Reviewers: cmatthews, thopre, kristof.beyls Reviewed By: thopre Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67582 git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@371947 91177308-0d34-0410-b5e6-96231b3b80d8 Hubert Tong a month ago
2 changed file(s) with 12 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
11 Report functionality centered around individual runs.
22 """
33
4 from collections import namedtuple
45 import time
56 import lnt.server.reporting.analysis
67 import lnt.server.ui.app
122123 if not bucket or bucket_name == 'Unchanged Test' or not show_perf:
123124 return bucket
124125 else:
125 return sorted(bucket, key=lambda (_, cr, __): -abs(cr.pct_delta))
126 return sorted(
127 bucket,
128 key=lambda bucket_entry: -abs(bucket_entry.cr.pct_delta))
126129
127130 def prioritize_buckets(test_results):
128131 prioritized = [(priority, field, bucket_name,
211214 return data
212215
213216
217 BucketEntry = namedtuple('BucketEntry', ['name', 'cr', 'test_id'])
214218 def _get_changes_by_type(ts, run_a, run_b, metric_fields, test_names,
215219 num_comparison_runs, sri):
216220 comparison_results = {}
248252 else:
249253 bucket = unchanged_tests
250254
251 bucket.append((name, cr, test_id))
255 bucket.append(BucketEntry(name, cr, test_id))
252256
253257 results_by_type.append(
254258 (field, (('New Failures', new_failures, False),
798798 show_highlight = not options['hide_highlight']
799799
800800 # Load the graph parameters.
801 GraphParameter = namedtuple('GraphParameter',
802 ['machine', 'test', 'field', 'field_index'])
801803 graph_parameters = []
802804 for name, value in request.args.items():
803805 # Plots to graph are passed as::
826828 field = ts.sample_fields[field_index]
827829 except NoResultFound:
828830 return abort(404)
829 graph_parameters.append((machine, test, field, field_index))
831 graph_parameters.append(GraphParameter(machine, test, field, field_index))
830832
831833 # Order the plots by machine name, test name and then field.
832 graph_parameters.sort(key=lambda (m, t, f, _): (m.name, t.name, f.name, _))
834 graph_parameters.sort(key=lambda graph_parameter:
835 (graph_parameter.machine.name, graph_parameter.test.name,
836 graph_parameter.field.name, graph_parameter.field_index))
833837
834838 # Extract requested mean trend.
835839 mean_parameter = None