From: W. Trevor King Date: Sun, 18 Nov 2012 22:51:34 +0000 (-0500) Subject: FFT_tools: add spaces after commas (PEP8) except tuple assignment X-Git-Tag: 0.4~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0a8ee14acca74db56157dddc134a1ae2cac3db34;p=FFT-tools.git FFT_tools: add spaces after commas (PEP8) except tuple assignment --- diff --git a/FFT_tools.py b/FFT_tools.py index 7eb06a7..13fd5a0 100644 --- a/FFT_tools.py +++ b/FFT_tools.py @@ -73,12 +73,12 @@ def _test_rfft(xs, Xs): # X[k] = SUM x[m] exp (-j 2pi km /n) # m=0 # (see http://www.tramy.us/numpybook.pdf) - j = _numpy.complex(0,1) + j = _numpy.complex(0, 1) n = len(xs) Xa = [] for k in range(n): Xa.append(sum([x * _numpy.exp(-j * 2 * _numpy.pi * k * m / n) - for x,m in zip(xs,range(n))])) + for x,m in zip(xs, range(n))])) if k < len(Xs): if (Xs[k] - Xa[k]) / _numpy.abs(Xa[k]) >= 1e-6: raise ValueError( @@ -99,7 +99,7 @@ def _test_rfft(xs, Xs): def _test_rfft_suite(): print('Test numpy rfft definition') - xs = [1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1] + xs = [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1] _test_rfft(xs, _numpy.fft.rfft(xs)) @@ -173,7 +173,7 @@ def _test_unitary_rfft_parsevals(xs, freq, freqs, Xs): def _test_unitary_rfft_parsevals_suite(): print("Test unitary rfft on Parseval's theorem") - xs = [1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1] + xs = [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1] dt = _numpy.pi freqs,Xs = unitary_rfft(xs, 1.0 / dt) _test_unitary_rfft_parsevals(xs, 1.0 / dt, freqs, Xs) @@ -201,7 +201,7 @@ def _test_unitary_rfft_rect( #_test_unitary_rfft_parsevals(x, samp_freq, freq_axis, X) # remove the phase due to our time shift - j = _numpy.complex(0.0,1.0) # sqrt(-1) + j = _numpy.complex(0.0, 1.0) # sqrt(-1) for i in range(len(freq_axis)): f = freq_axis[i] inverse_phase_shift = _numpy.exp(j * 2.0 * _numpy.pi * time_shift * f) @@ -255,7 +255,7 @@ def _test_unitary_rfft_gaussian( #_test_unitary_rfft_parsevals(x, samp_freq, freq_axis, X) # remove the phase due to our time shift - j = _numpy.complex(0.0,1.0) # sqrt(-1) + j = _numpy.complex(0.0, 1.0) # sqrt(-1) for i in range(len(freq_axis)): f = freq_axis[i] inverse_phase_shift = _numpy.exp(j * 2.0 * _numpy.pi * time_shift * f) @@ -465,7 +465,7 @@ def _gaussian2(area, mean, std, t): def _test_unitary_power_spectrum_gaussian( - area=2.5, mean=5, std=1, samp_freq=10.24 ,samples=512): + area=2.5, mean=5, std=1, samp_freq=10.24, samples=512): x = _numpy.zeros((samples,), dtype=_numpy.float) mean = _numpy.float(mean) for i in range(samples):