From bdb1fd5e614e714daf3fe86c55f4e6c4a073baee Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 17 Jun 2010 21:02:05 -0400 Subject: [PATCH] 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. --- hooke/driver/hemingway.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, -- 2.26.2