Fix bug in linear regressions on linear version numbers

Chris Matthews chris.matthews at apple.com
Fri Aug 9 15:46:39 PDT 2013


Fix a bug (which I introduced) in handling of linear regressions on linear version numbers.  This resolves the “unsupported operand type(s) for -: ‘tuple’ and ‘tuple’” server error when rendering linear regressions.

--- a/lnt/server/ui/views.py
+++ b/lnt/server/ui/views.py
@@ -547,10 +547,11 @@ def v4_graph():
             dates = [data_date[1] for data_date in datapoints]
 
             metadata = {"label":point_label}
-            # on simple revisions use rev number for x else start from
-            # 0
+            
+            # When we can, map x-axis to revisions, but when that is too hard
+            # use the position of the sample instead.
             rev_x = convert_revision(point_label)
-            x = rev_x if len(rev_x)==1 else pos
+            x = rev_x[0] if len(rev_x)==1 else pos
 
             values = [v*normalize_by for v in data]
             min_index,min_value = min(enumerate(values))


Chris Matthews
chris.matthews at apple.com


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130809/d7ef8e8e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linear_fix.patch
Type: application/octet-stream
Size: 801 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130809/d7ef8e8e/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130809/d7ef8e8e/attachment-0001.html>


More information about the llvm-commits mailing list