[PATCH] D64066: Add geomean column earlier to dataout as Series in compare.py.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 2 04:06:30 PDT 2019


fhahn created this revision.
fhahn added reviewers: anemet, MatzeB, cmatthews, serge-sans-paille.
Herald added a project: LLVM.

This fixes the following error when using --all.

Traceback (most recent call last):

  File "test-suite/utils/compare.py", line 374, in <module>
    print_result(data, limit_output, shorten_names, config.show_diff, sortkey)
  File "test-suite/utils/compare.py", line 227, in print_result
    dataout = add_geomean_row(d, dataout)
  File "test-suite/utils/compare.py", line 139, in add_geomean_row
    relative = values1 / values0
  File "pyvenv/lib/python2.7/site-packages/pandas/core/ops.py", line 1583, in wrapper
    result = safe_na_op(lvalues, rvalues)
  File "pyvenv/lib/python2.7/site-packages/pandas/core/ops.py", line 1533, in safe_na_op
    lambda x: op(x, rvalues))
  File "pandas/_libs/algos.pyx", line 690, in pandas._libs.algos.arrmap
  File "pyvenv/lib/python2.7/site-packages/pandas/core/ops.py", line 1533, in <lambda>
    lambda x: op(x, rvalues))

TypeError: ufunc 'true_divide' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''


Repository:
  rT test-suite

https://reviews.llvm.org/D64066

Files:
  utils/compare.py


Index: utils/compare.py
===================================================================
--- utils/compare.py
+++ utils/compare.py
@@ -141,8 +141,8 @@
 
     gm_row = {c: '' for c in dataout.columns}
     gm_row['diff'] = gm_diff
-    gm_row['Program'] = 'Geomean difference'
-    return dataout.append(gm_row, ignore_index=True)
+    series = pd.Series(gm_row, name='Geomean difference')
+    return dataout.append(series)
 
 def filter_failed(data, key='Exec'):
     return data.loc[data[key] == "pass"]
@@ -220,12 +220,12 @@
         # Take 15 topmost elements
         dataout = dataout.head(15)
 
+    if show_diff_column:
+      dataout = add_geomean_row(d, dataout)
+
     # Turn index into a column so we can format it...
     dataout.insert(0, 'Program', dataout.index)
 
-    if show_diff_column:
-        dataout = add_geomean_row(d, dataout)
-
     formatters = dict()
     formatters['diff'] = format_diff
     if shorten_names:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64066.207510.patch
Type: text/x-patch
Size: 945 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190702/688be6ac/attachment.bin>


More information about the llvm-commits mailing list