From: W. Trevor King Date: Fri, 18 Jun 2010 01:02:05 +0000 (-0400) Subject: Use numpy.loadtxt instead of newer numpy.genfromtxt in Hemingway driver. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bdb1fd5e614e714daf3fe86c55f4e6c4a073baee;p=hooke.git Use numpy.loadtxt instead of newer numpy.genfromtxt in Hemingway driver. From http://docs.scipy.org/doc/numpy/user/basics.io.genfromtxt.html "In particular, genfromtxt is able to take missing data into account, when other faster and simpler functions like loadtxt cannot" We prefer loadtxt because: * It's faster and we don't need to handle missing data. * It's older (genfromtxt added in Numpy in 2009/01/19, released in v1.3.0), so it's more likely to be in the user's stock Numpy installation. --- diff --git a/hooke/driver/hemingway.py b/hooke/driver/hemingway.py index 7fecbb0..8cd5f5e 100644 --- a/hooke/driver/hemingway.py +++ b/hooke/driver/hemingway.py @@ -53,7 +53,7 @@ class HemingwayDriver (Driver): fields = line.split(':', 1) if len(fields) == 2: file_info[fields[0]] = fields[1] - data = numpy.genfromtxt(f, dtype=numpy.float) + data = numpy.loadtxt(f, dtype=numpy.float) ret = curve.Data( shape=data.shape, dtype=data.dtype,