[Scipy-svn] r2033 - in trunk/Lib: ndimage/tests weave/examples
scipy-svn at scipy.org
scipy-svn at scipy.org
Fri Jun 30 16:53:00 EDT 2006
Author: oliphant
Date: 2006-06-30 15:52:56 -0500 (Fri, 30 Jun 2006)
New Revision: 2033
Modified:
trunk/Lib/ndimage/tests/test_ndimage.py
trunk/Lib/weave/examples/ramp.py
trunk/Lib/weave/examples/ramp2.py
Log:
Fix a few old-style usages.
Modified: trunk/Lib/ndimage/tests/test_ndimage.py
===================================================================
--- trunk/Lib/ndimage/tests/test_ndimage.py 2006-06-30 20:03:32 UTC (rev 2032)
+++ trunk/Lib/ndimage/tests/test_ndimage.py 2006-06-30 20:52:56 UTC (rev 2033)
@@ -1302,12 +1302,12 @@
for type in [numarray.float32, numarray.float64]:
a = numarray.zeros(shape, type)
a[0, 0] = 1.0
- a = dft.refft(a, shape[0], 0)
+ a = dft.rfft(a, shape[0], 0)
a = dft.fft(a, shape[1], 1)
a = ndimage.fourier_gaussian(a, [5.0, 2.5],
shape[0], 0)
a = dft.ifft(a, shape[1], 1)
- a = dft.irefft(a, shape[0], 0)
+ a = dft.irfft(a, shape[0], 0)
self.failUnless(diff(ndimage.sum(a), 1.0) < eps)
def test_fourier_gaussian_complex01(self):
@@ -1331,12 +1331,12 @@
for type in [numarray.float32, numarray.float64]:
a = numarray.zeros(shape, type)
a[0, 0] = 1.0
- a = dft.refft(a, shape[0], 0)
+ a = dft.rfft(a, shape[0], 0)
a = dft.fft(a, shape[1], 1)
a = ndimage.fourier_uniform(a, [5.0, 2.5],
shape[0], 0)
a = dft.ifft(a, shape[1], 1)
- a = dft.irefft(a, shape[0], 0)
+ a = dft.irfft(a, shape[0], 0)
self.failUnless(diff(ndimage.sum(a), 1.0) < eps)
def test_fourier_uniform_complex01(self):
@@ -1359,11 +1359,11 @@
for dtype in [numarray.float32, numarray.float64]:
true = numarray.arange(shape[0] * shape[1], dtype = dtype)
true.shape = shape
- a = dft.refft(true, shape[0], 0)
+ a = dft.rfft(true, shape[0], 0)
a = dft.fft(a, shape[1], 1)
a = ndimage.fourier_shift(a, [1, 1], shape[0], 0)
a = dft.ifft(a, shape[1], 1)
- a = dft.irefft(a, shape[0], 0)
+ a = dft.irfft(a, shape[0], 0)
error1 = diff(a[1:, 1:], true[:-1, :-1])
error2 = diff(a.imag, numarray.zeros(shape))
self.failUnless(error1 < 1e-10 and error2 < 1e-10)
@@ -1390,12 +1390,12 @@
for type in [numarray.float32, numarray.float64]:
a = numarray.zeros(shape, type)
a[0, 0] = 1.0
- a = dft.refft(a, shape[0], 0)
+ a = dft.rfft(a, shape[0], 0)
a = dft.fft(a, shape[1], 1)
a = ndimage.fourier_ellipsoid(a, [5.0, 2.5],
shape[0], 0)
a = dft.ifft(a, shape[1], 1)
- a = dft.irefft(a, shape[0], 0)
+ a = dft.irfft(a, shape[0], 0)
self.failUnless(diff(ndimage.sum(a), 1.0) < eps)
def test_fourier_ellipsoid_complex01(self):
Modified: trunk/Lib/weave/examples/ramp.py
===================================================================
--- trunk/Lib/weave/examples/ramp.py 2006-06-30 20:03:32 UTC (rev 2032)
+++ trunk/Lib/weave/examples/ramp.py 2006-06-30 20:52:56 UTC (rev 2033)
@@ -84,7 +84,7 @@
print 'python (seconds*ratio):', py_time
print 'arr[500]:', arr[500]
- arr1 = array([0]*N_array,Float64)
+ arr1 = array([0]*N_array,float)
# First call compiles function or loads from cache.
# I'm not including this in the timing.
Ramp_numeric1(arr1, 0.0, 1.0)
@@ -96,7 +96,7 @@
print 'compiled numeric1 (seconds, speed up):', c_time, py_time/ c_time
print 'arr[500]:', arr1[500]
- arr2 = array([0]*N_array,Float64)
+ arr2 = array([0]*N_array,float)
# First call compiles function or loads from cache.
# I'm not including this in the timing.
Ramp_numeric2(arr2, 0.0, 1.0)
Modified: trunk/Lib/weave/examples/ramp2.py
===================================================================
--- trunk/Lib/weave/examples/ramp2.py 2006-06-30 20:03:32 UTC (rev 2032)
+++ trunk/Lib/weave/examples/ramp2.py 2006-06-30 20:52:56 UTC (rev 2033)
@@ -19,7 +19,7 @@
mod = ext_tools.ext_module('ramp_ext')
# type declarations
- result = array([0],Float64)
+ result = array([0],float)
start,end = 0.,0.
code = """
const int size = Nresult[0];
@@ -51,7 +51,7 @@
except:
build_ramp_ext()
import ramp_ext
- arr = array([0]*10000,Float64)
+ arr = array([0]*10000,float)
for i in xrange(10000):
ramp_ext.Ramp(arr, 0.0, 1.0)
t2 = time.time()
More information about the Scipy-svn
mailing list