diff --git a/Examples/Tests/embedded_boundary_removal_depth/analysis.py b/Examples/Tests/embedded_boundary_removal_depth/analysis.py index 7baac31a74d..db21ca8f2bd 100755 --- a/Examples/Tests/embedded_boundary_removal_depth/analysis.py +++ b/Examples/Tests/embedded_boundary_removal_depth/analysis.py @@ -21,6 +21,7 @@ test_name = os.path.split(os.getcwd())[1] checksumAPI.evaluate_checksum(test_name, filename, output_format="openpmd") + def get_avg_divE(ts, start_avg_iter, end_avg_iter, ar_size): avg_divE = np.zeros((ar_size, ar_size)) for iteration in tqdm.tqdm(ts.iterations[start_avg_iter:end_avg_iter]): @@ -44,6 +45,7 @@ def plot(array, vmax=1e-9): ax.set_ylabel("z (m)") ax.set_title("Averaged divE") + ts = OpenPMDTimeSeries("./diags/diag1/") ar_size = 32 @@ -56,10 +58,12 @@ def plot(array, vmax=1e-9): tolerance = 1e-9 + def check_tolerance(array, tolerance): assert np.all( array <= tolerance ), f"Test did not pass: one or more elements exceed the tolerance of {tolerance}." print("All elements of are within the tolerance.") + check_tolerance(divE_avg, tolerance)