Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 17, 2024
1 parent dd684a6 commit e27d29e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Examples/Tests/embedded_boundary_removal_depth/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import tqdm
from openpmd_viewer import OpenPMDTimeSeries

#yt.funcs.mylog.setLevel(0)
# yt.funcs.mylog.setLevel(0)
sys.path.insert(1, "../../../../warpx/Regression/Checksum/")
import checksumAPI

Expand All @@ -23,6 +23,7 @@
checksumAPI.evaluate_checksum(test_name, filename, output_format="openpmd")
print(os.getcwd())


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]):
Expand All @@ -46,6 +47,7 @@ def plot(array, vmax=1e-9):
ax.set_ylabel("z (m)")
ax.set_title("Averaged divE")


ts = OpenPMDTimeSeries("./diags/diag1/")

ar_size = 32
Expand All @@ -58,10 +60,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)

0 comments on commit e27d29e

Please sign in to comment.