From 24824220232af98c4aebefd9576402cccd906952 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Thu, 26 Jul 2012 20:49:10 +0000 Subject: [PATCH] Allow SCons test runner to continue past some csv parsing errors --- site_scons/buildutils.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/site_scons/buildutils.py b/site_scons/buildutils.py index 4f3373338..9249ddbc5 100644 --- a/site_scons/buildutils.py +++ b/site_scons/buildutils.py @@ -304,10 +304,15 @@ def compareCsvFiles(env, file1, file2): print e return 1 - relerror = (np.abs(data2-data1) / - (np.maximum(np.abs(data2), np.abs(data1)) + - env['test_csv_threshold'])) - maxerror = np.nanmax(relerror.flat) + try: + relerror = (np.abs(data2-data1) / + (np.maximum(np.abs(data2), np.abs(data1)) + + env['test_csv_threshold'])) + maxerror = np.nanmax(relerror.flat) + except ValueError as e: + print e + return 1 + tol = env['test_csv_tolerance'] if maxerror > tol: # Threshold based on printing 6 digits in the CSV file print ("Files differ. %i / %i elements above specified tolerance" %