Skip to content

Commit 8ab8e3b

Browse files
committed
commented lines only needed for printing bounds
1 parent 084157d commit 8ab8e3b

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

pynumdiff/tests/test_diff_methods.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from ..smooth_finite_difference import * # mediandiff, meandiff, gaussiandiff, friedrichsdiff, butterdiff, splinediff
1010
from ..finite_difference import first_order, second_order
1111
# Function aliases for testing cases where parameters change the behavior in a big way
12-
iterated_first_order = lambda *args, **kwargs: first_order(*args, **kwargs)
12+
def iterated_first_order(*args, **kwargs): return first_order(*args, **kwargs)
1313

1414
dt = 0.1
1515
t = np.arange(0, 3, dt) # sample locations
@@ -106,10 +106,11 @@ def test_diff_method(diff_method_and_params, test_func_and_deriv, request): # re
106106
# check x_hat and x_hat_noisy are close to x and that dxdt_hat and dxdt_hat_noisy are close to dxdt
107107
#print("]\n[", end="")
108108
for j,(a,b) in enumerate([(x,x_hat), (dxdt,dxdt_hat), (x,x_hat_noisy), (dxdt,dxdt_hat_noisy)]):
109-
l2_error = np.linalg.norm(a - b)
110-
linf_error = np.max(np.abs(a - b))
109+
# l2_error = np.linalg.norm(a - b)
110+
# linf_error = np.max(np.abs(a - b))
111+
# print(f"({l2_error}, {linf_error})", end=", ")
112+
# print(f"({int(np.ceil(np.log10(l2_error))) if l2_error> 0 else -25}, {int(np.ceil(np.log10(linf_error))) if linf_error > 0 else -25})", end=", ")
111113

112-
#print(f"({int(np.ceil(np.log10(l2_error))) if l2_error> 0 else -25}, {int(np.ceil(np.log10(linf_error))) if linf_error > 0 else -25})", end=", ")
113114
log_l2_bound, log_linf_bound = error_bounds[diff_method][i][j]
114115
assert np.linalg.norm(a - b) < 10**log_l2_bound
115116
assert np.max(np.abs(a - b)) < 10**log_linf_bound

0 commit comments

Comments
 (0)