Improved syntax

这个提交包含在:
Craig Warren
2023-09-04 21:15:39 +01:00
父节点 fa87b6c57a
当前提交 31d39e67f5

查看文件

@@ -75,7 +75,7 @@ for i, model in enumerate(testmodels):
# Run model
file = basepath / model / model
gprMax.run(inputfile=file.with_suffix(".in"), gpu=None)
gprMax.run(inputfile=file.with_suffix(".in"), gpu=None, opencl=None)
# Special case for analytical comparison
if model == "hertzian_dipole_fs_analytical":
@@ -111,6 +111,7 @@ for i, model in enumerate(testmodels):
dataref = hertzian_dipole_fs(
filetest.attrs["Iterations"], filetest.attrs["dt"], filetest.attrs["dx_dy_dz"], rxposrelative
)
filetest.close()
else:
# Get output for model and reference files
@@ -129,15 +130,15 @@ for i, model in enumerate(testmodels):
raise ValueError
# Check that type of float used to store fields matches
if filetest[path + outputstest[0]].dtype != fileref[path + outputsref[0]].dtype:
logger.warning(
f"Type of floating point number in test model "
f"({filetest[path + outputstest[0]].dtype}) does not "
f"match type in reference solution ({fileref[path + outputsref[0]].dtype})\n"
)
float_or_doubleref = fileref[path + outputsref[0]].dtype
float_or_doubletest = filetest[path + outputstest[0]].dtype
if float_or_doubleref != float_or_doubletest:
logger.warning(
f"Type of floating point number in test model "
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 = (
@@ -161,7 +162,7 @@ for i, model in enumerate(testmodels):
raise ValueError
fileref.close()
filetest.close()
filetest.close()
# Diffs
datadiffs = np.zeros(datatest.shape, dtype=np.float64)