[Test] Fix csv test comparisons to work with Numpy 1.10

Drop support for Numpy 1.3 (which lacks the skip_header argument to genfromtxt).
This commit is contained in:
Ray Speth 2015-10-08 13:20:07 -04:00
parent 051b9d1f51
commit 7308491654
2 changed files with 4 additions and 9 deletions

View file

@ -94,7 +94,7 @@ OS X
and agree to the Xcode license agreement
* If you don't have numpy version >= 1.3, you can install a recent version with::
* If you don't have numpy version >= 1.4, you can install a recent version with::
sudo easy_install -U numpy
@ -437,7 +437,7 @@ Optional Programs
* Required to build the Cantera Python module, and to run significant portions
of the test suite.
* http://sourceforge.net/projects/numpy/
* Known to work with versions 1.7 and 1.8; Expected to work with version >= 1.3
* Known to work with versions 1.7-1.9; Expected to work with version >= 1.4
* `Cython <http://cython.org/>`_

View file

@ -312,7 +312,6 @@ def compareCsvFiles(env, file1, file2):
"""
try:
import numpy as np
hasSkipHeader = tuple(np.version.version.split('.')[:2]) >= ('1','4')
except ImportError:
print 'WARNING: skipping .csv diff because numpy is not installed'
return 0
@ -328,12 +327,8 @@ def compareCsvFiles(env, file1, file2):
break
try:
if hasSkipHeader:
data1 = np.genfromtxt(file1, skip_header=headerRows, delimiter=',')
data2 = np.genfromtxt(file2, skip_header=headerRows, delimiter=',')
else:
data1 = np.genfromtxt(file1, skiprows=headerRows, delimiter=',')
data2 = np.genfromtxt(file2, skiprows=headerRows, delimiter=',')
data1 = np.genfromtxt(file1, skip_header=headerRows, delimiter=',')
data2 = np.genfromtxt(file2, skip_header=headerRows, delimiter=',')
except (IOError, StopIteration) as e:
print e
return 1