@@ -49,7 +49,7 @@ def step(t):
4949 r"""
5050 Step Function [ u(t) ].
5151
52- Simple implimentation of numpy.heaviside function to provide standard
52+ Simple implementation of numpy.heaviside function to provide standard
5353 step-function as specified to be zero at :math:`x < 0`, and one at
5454 :math:`x \geq 0`.
5555
@@ -75,7 +75,7 @@ def funcrms(func, T):
7575 Root-Mean-Square (RMS) Evaluator for Callable Functions.
7676
7777 Integral-based RMS calculator, evaluates the RMS value
78- of a repetative signal (f) given the signal's specific
78+ of a repetitive signal (f) given the signal's specific
7979 period (T)
8080
8181 Parameters
@@ -89,8 +89,7 @@ def funcrms(func, T):
8989 -------
9090 RMS: The RMS value of the function (f) over the interval ( 0, T )
9191 """
92- fn = lambda x : func (x ) ** 2
93- integral , _ = integrate (fn , 0 , T )
92+ integral , _ = integrate (lambda x : func (x ) ** 2 , 0 , T )
9493 return _np .sqrt (1 / T * integral )
9594
9695
@@ -140,7 +139,7 @@ def gausdist(x, mu=0, sigma=1):
140139 Returns
141140 -------
142141 F: numpy.ndarray
143- Computed distribution of the gausian function at the
142+ Computed distribution of the gaussian function at the
144143 points specified by (array) x
145144 """
146145 # Define Integrand
@@ -149,15 +148,15 @@ def integrand(sq):
149148
150149 try :
151150 lx = len (x ) # Find length of Input
152- except :
151+ except TypeError :
153152 lx = 1 # Length 1
154153 x = [x ] # Pack into list
155154 F = _np .zeros (lx , dtype = _np .float64 )
156155 for i in range (lx ):
157156 x_tmp = x [i ]
158157 # Evaluate X (altered by mu and sigma)
159158 X = (x_tmp - mu ) / sigma
160- integral = integrate (integrand , _np .NINF , X ) # Integrate
159+ integral = integrate (integrand , - _np .inf , X ) # Integrate
161160 result = 1 / _np .sqrt (2 * _np .pi ) * integral [0 ] # Evaluate Result
162161 F [i ] = result
163162 # Return only the 0-th value if there's only 1 value available
@@ -197,7 +196,7 @@ def probdensity(func, x, x0=0, scale=True):
197196 sumx = _np .array ([])
198197 try :
199198 lx = len (x ) # Find length of Input
200- except :
199+ except TypeError :
201200 lx = 1 # Length 1
202201 x = [x ] # Pack into list
203202 # Recursively Find Probability Density
@@ -210,7 +209,7 @@ def probdensity(func, x, x0=0, scale=True):
210209 if scale :
211210 mx = sumx .max ()
212211 sumx /= mx
213- elif scale != False :
212+ elif not scale :
214213 sumx /= scale
215214 return sumx
216215
@@ -220,7 +219,7 @@ def rfft(arr, dt=0.01, absolute=True, resample=True):
220219 """
221220 RFFT Function.
222221
223- This function is designed to evaluat the real FFT
222+ This function is designed to evaluate the real FFT
224223 of a input signal in the form of an array or list.
225224
226225 Parameters
@@ -252,13 +251,13 @@ def rfft(arr, dt=0.01, absolute=True, resample=True):
252251 # Evaluate the Downsampling Ratio
253252 dn = int (dt * len (arr ))
254253 # Downsample to remove unnecessary points
255- fixedfft = filter .dnsample (fourier , dn )
256- return ( fixedfft )
254+ fixed_fft = filter .dnsample (fourier , dn )
255+ return fixed_fft
257256 elif not resample :
258- return ( fourier )
257+ return fourier
259258 else :
260259 # Condition Resample Value
261260 resample = int (resample )
262261 # Downsample to remove unnecessary points
263- fixedfft = filter .dnsample (fourier , resample )
264- return fixedfft
262+ fixed_fft = filter .dnsample (fourier , resample )
263+ return fixed_fft
0 commit comments