From d29107a248130bbb68ecac58d6720d716529141c Mon Sep 17 00:00:00 2001 From: Jarrod Millman Date: Tue, 2 Sep 2008 20:32:38 +0000 Subject: reindenting prior to release --- doc/numpybook/comparison/ctypes/filter.py | 3 --- doc/numpybook/comparison/ctypes/interface.py | 7 ++----- doc/numpybook/comparison/pyrex/setup.py | 4 ++-- doc/numpybook/comparison/timing.py | 18 ++++++++---------- doc/numpybook/comparison/weave/filter.py | 11 +++++------ doc/numpybook/comparison/weave/inline.py | 10 +++++----- 6 files changed, 22 insertions(+), 31 deletions(-) (limited to 'doc/numpybook/comparison') diff --git a/doc/numpybook/comparison/ctypes/filter.py b/doc/numpybook/comparison/ctypes/filter.py index e92aa5eab..1b322aca3 100644 --- a/doc/numpybook/comparison/ctypes/filter.py +++ b/doc/numpybook/comparison/ctypes/filter.py @@ -21,6 +21,3 @@ def filter2d(a): b = N.zeros_like(a) lib.dfilter2d(a, b, a.ctypes.strides, a.ctypes.shape) return b - - - diff --git a/doc/numpybook/comparison/ctypes/interface.py b/doc/numpybook/comparison/ctypes/interface.py index 06c12aef3..e237f8ded 100644 --- a/doc/numpybook/comparison/ctypes/interface.py +++ b/doc/numpybook/comparison/ctypes/interface.py @@ -27,7 +27,7 @@ lib.dfilter2d.argtypes = [N.ctypeslib.ndpointer(float, ndim=2, flags='aligned, contiguous,'\ 'writeable'), ctypes.POINTER(N.ctypeslib.c_intp), - ctypes.POINTER(N.ctypeslib.c_intp)] + ctypes.POINTER(N.ctypeslib.c_intp)] def select(dtype): if dtype.char in ['?bBhHf']: @@ -49,12 +49,9 @@ def add(a, b): c = N.empty_like(a) func(a,b,c,a.size) return c - + def filter2d(a): a = N.require(a, float, ['ALIGNED']) b = N.zeros_like(a) lib.dfilter2d(a, b, a.ctypes.strides, a.ctypes.shape) return b - - - diff --git a/doc/numpybook/comparison/pyrex/setup.py b/doc/numpybook/comparison/pyrex/setup.py index 64cf12bc8..695639d9e 100644 --- a/doc/numpybook/comparison/pyrex/setup.py +++ b/doc/numpybook/comparison/pyrex/setup.py @@ -16,8 +16,8 @@ pyx_ext = Extension('add', include_dirs = [numpy.get_include()]) pyx_ext2 = Extension('blur', - ['blur.pyx'], - include_dirs = [numpy.get_include()]) + ['blur.pyx'], + include_dirs = [numpy.get_include()]) # Call the routine which does the real work diff --git a/doc/numpybook/comparison/timing.py b/doc/numpybook/comparison/timing.py index 14841d7cb..92f6a50d2 100644 --- a/doc/numpybook/comparison/timing.py +++ b/doc/numpybook/comparison/timing.py @@ -51,13 +51,11 @@ import sys path = sys.path for kind in ['f2py']:#['ctypes', 'pyrex', 'weave', 'f2py']: - res[kind] = [] - sys.path = ['/Users/oliphant/numpybook/%s' % (kind,)] + path - print sys.path - for n in N: - print "%s - %d" % (kind, n) - t = timeit.Timer(eval('%s_run'%kind), eval('%s_pre %% (%d,%d)'%(kind,n,n))) - mytime = min(t.repeat(3,100)) - res[kind].append(mytime) - - + res[kind] = [] + sys.path = ['/Users/oliphant/numpybook/%s' % (kind,)] + path + print sys.path + for n in N: + print "%s - %d" % (kind, n) + t = timeit.Timer(eval('%s_run'%kind), eval('%s_pre %% (%d,%d)'%(kind,n,n))) + mytime = min(t.repeat(3,100)) + res[kind].append(mytime) diff --git a/doc/numpybook/comparison/weave/filter.py b/doc/numpybook/comparison/weave/filter.py index b2fdb277e..6fc16c79f 100644 --- a/doc/numpybook/comparison/weave/filter.py +++ b/doc/numpybook/comparison/weave/filter.py @@ -8,11 +8,11 @@ def filter(a): for(i=1;i