Ran pre-commit run --all-files to modify all the files correctly.

这个提交包含在:
Sai-Suraj-27
2023-09-08 16:06:59 +05:30
父节点 caa566702c
当前提交 caa9ed88ae
共有 17 个文件被更改,包括 155 次插入157 次删除

查看文件

@@ -24,6 +24,7 @@ import numpy as np
logger = logging.getLogger(__name__)
def diff_output_files(filename1, filename2):
"""Calculates differences between two output files.
@@ -56,7 +57,7 @@ def diff_output_files(filename1, filename2):
f"Type of floating point number in test model ({file1[path + outputs1[0]].dtype}) "
f"does not match type in reference solution ({file2[path + outputs2[0]].dtype})\n"
)
# Arrays for storing time
time1 = np.zeros((file1.attrs["Iterations"]), dtype=floattype1)
time1 = np.linspace(0, (file1.attrs["Iterations"] - 1), num=file1.attrs["Iterations"])

查看文件

@@ -50,8 +50,9 @@ fig, ax = plt.subplots(
)
for x, model in enumerate(testmodels):
time, datadiffs = diff_output_files(fn.parent.joinpath(basename + "_ref.h5"),
fn.parent.joinpath(basename + str(x + 1) + ".h5"))
time, datadiffs = diff_output_files(
fn.parent.joinpath(basename + "_ref.h5"), fn.parent.joinpath(basename + str(x + 1) + ".h5")
)
# Print maximum error value
start = 210

查看文件

@@ -56,7 +56,7 @@ for x, PMLID in enumerate(PMLIDs):
fig, ax = plt.subplots(figsize=(20, 10), facecolor="w", edgecolor="w")
ax.remove()
fig.suptitle(f"{PMLID}")
outputs = ["Ex", "Ey", "Ez", "Hx", "Hy", "Hz"]
for i, output in enumerate(outputs):
if i < 3:
@@ -74,9 +74,7 @@ for x, PMLID in enumerate(PMLIDs):
ax.set_ylabel(f"{output} error [dB]")
# Save a PDF/PNG of the figure
fig.savefig(basename + "_diffs_" + PMLID + ".pdf", dpi=None, format='pdf', bbox_inches='tight', pad_inches=0.1)
fig.savefig(basename + "_diffs_" + PMLID + ".pdf", dpi=None, format="pdf", bbox_inches="tight", pad_inches=0.1)
# fig.savefig(basename + "_diffs_" + PMLID + ".png", dpi=150, format='png', bbox_inches='tight', pad_inches=0.1)
plt.show()

查看文件

@@ -138,7 +138,7 @@ for i, model in enumerate(testmodels):
f"({float_or_doubletest}) does not "
f"match type in reference solution ({float_or_doubleref})\n"
)
# Arrays for storing time
timeref = np.zeros((fileref.attrs["Iterations"]), dtype=float_or_doubleref)
timeref = (