你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 15:10:13 +08:00
Fix Python API mixin modifying the input file
Move configuration involving the input and output files to before the run stage to allow mixins to change the file names if required
这个提交包含在:
@@ -106,7 +106,7 @@ class GprMaxBaseTest(RunOnlyRegressionTest):
|
||||
|
||||
model = parameter()
|
||||
sourcesdir = required
|
||||
executable = "time -p python -m gprMax --log-level 10 --hide-progress-bars"
|
||||
executable = "time -p python -m gprMax"
|
||||
|
||||
regression_checks = variable(typ.List[RegressionCheck], value=[])
|
||||
|
||||
@@ -159,16 +159,29 @@ class GprMaxBaseTest(RunOnlyRegressionTest):
|
||||
self.prerun_cmds.append(f"source {path_to_pyenv}")
|
||||
|
||||
@run_after("init")
|
||||
def set_file_paths(self):
|
||||
self.input_file = Path(f"{self.model}.in")
|
||||
self.output_file = Path(f"{self.model}.h5")
|
||||
|
||||
@run_before("run")
|
||||
def configure_test_run(self):
|
||||
"""Configure gprMax commandline arguments and plot outputs
|
||||
|
||||
Set the input and output files and add postrun commands to plot
|
||||
the outputs.
|
||||
"""
|
||||
self.input_file = f"{self.model}.in"
|
||||
self.output_file = f"{self.model}.h5"
|
||||
self.executable_opts = [self.input_file, "-o", self.output_file]
|
||||
self.keep_files = [self.input_file, self.output_file]
|
||||
input_file = str(self.input_file)
|
||||
output_file = str(self.output_file)
|
||||
|
||||
self.executable_opts += [
|
||||
input_file,
|
||||
"-o",
|
||||
output_file,
|
||||
"--log-level",
|
||||
"10",
|
||||
"--hide-progress-bars",
|
||||
]
|
||||
self.keep_files += [input_file, output_file]
|
||||
|
||||
"""
|
||||
if self.has_receiver_output:
|
||||
|
@@ -72,11 +72,10 @@ class SnapshotMixin(GprMaxMixin):
|
||||
|
||||
|
||||
class PythonApiMixin(GprMaxMixin):
|
||||
executable = "time -p python"
|
||||
|
||||
@run_after("setup")
|
||||
def set_python_input_file(self):
|
||||
"""Input files for API tests will be python files"""
|
||||
self.executable = "time -p python"
|
||||
self.input_file = self.input_file.with_suffix(".py")
|
||||
|
||||
|
||||
|
在新工单中引用
屏蔽一个用户