Skip to content

Commit

Permalink
Fixed W292 and E128
Browse files Browse the repository at this point in the history
  • Loading branch information
“JoeJ” committed Jan 16, 2024
1 parent f07e370 commit fa2698c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pyfpt/analytics/edgeworth_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ def hermite_poly4(y):
# "physicist's Hermite polynomials" used by SciPy
def hermite_poly6(y):
hermite_poly6 = y**6 - 15*y**4 + 45*y**2 - 15
return hermite_poly6
return hermite_poly6
2 changes: 1 addition & 1 deletion tests/test_edgeworth_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ def V_ddif(phi):

# We need the following to execute the tests when we run the file in python
if __name__ == '__main__':
unittest.main()
unittest.main()
16 changes: 8 additions & 8 deletions tests/test_importance_sampling_cython.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def expected_mean_FPT(x, x_r, x_end):

ts, ws =\
importance_sampling_simulations_1dim(x_in, x_r, x_end, 0, t_f, dt,
bias_amp, num_runs, drift_func,
diffusion_func)
bias_amp, num_runs,
drift_func, diffusion_func)
# The ws should all be 1
self.assertTrue(all(np.array(ws) == 1))
# There is also an analytical expectation for the mean.
Expand All @@ -52,8 +52,8 @@ def expected_mean_FPT(x, x_r, x_end):
x_end = -2
ts, ws =\
importance_sampling_simulations_1dim(x_in, x_r, x_end, 0, t_f, dt,
bias_amp, num_runs, drift_func,
diffusion_func)
bias_amp, num_runs,
drift_func, diffusion_func)
# The ws should all be 1
self.assertTrue(all(np.array(ws) == 1))
# There is also an analytical expectation for the mean.
Expand All @@ -67,8 +67,8 @@ def expected_mean_FPT(x, x_r, x_end):
num_runs = 10**1
ts, ws =\
importance_sampling_simulations_1dim(x_in, x_r, x_end, 0, t_f, dt,
bias_amp, num_runs, drift_func,
diffusion_func)
bias_amp, num_runs,
drift_func, diffusion_func)
# All of these simulations should take the classical amount of time
expectation = np.abs(np.diff((x_in, x_end))/drift_amp)
differance = np.abs((expectation-ts))
Expand All @@ -88,8 +88,8 @@ def expected_mean_FPT(x, x_r, x_end):
bias_amp = 1.0
ts, ws =\
importance_sampling_simulations_1dim(x_in, x_r, x_end, 0, t_f, dt,
bias_amp, num_runs, drift_func,
diffusion_func)
bias_amp, num_runs,
drift_func, diffusion_func)
# The mean of the sample distrbution should be a few std from the
# target mean.
expectation_mean = np.abs(np.diff((x_in, x_end))/drift_amp)
Expand Down

0 comments on commit fa2698c

Please sign in to comment.