你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 23:14:03 +08:00
Added a checkessential argument to check_cmd_names function so it can be switched on or off.
这个提交包含在:
@@ -122,11 +122,12 @@ def write_processed_file(inputfile, modelrun, numbermodelruns, processedlines):
|
|||||||
print('Written input commands, after processing any Python code and include commands, to file: {}\n'.format(processedfile))
|
print('Written input commands, after processing any Python code and include commands, to file: {}\n'.format(processedfile))
|
||||||
|
|
||||||
|
|
||||||
def check_cmd_names(processedlines):
|
def check_cmd_names(processedlines, checkessential=True):
|
||||||
"""Checks the validity of commands, i.e. are they gprMax commands, and that all essential commands are present.
|
"""Checks the validity of commands, i.e. are they gprMax commands, and that all essential commands are present.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
processedlines (list): Input commands after Python processing.
|
processedlines (list): Input commands after Python processing.
|
||||||
|
checkessential (boolean): Perform check to see that all essential commands are present.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
singlecmds (dict): Commands that can only occur once in the model.
|
singlecmds (dict): Commands that can only occur once in the model.
|
||||||
@@ -178,9 +179,10 @@ def check_cmd_names(processedlines):
|
|||||||
geometry.append(processedlines[lindex].strip(' \t\n'))
|
geometry.append(processedlines[lindex].strip(' \t\n'))
|
||||||
|
|
||||||
lindex += 1
|
lindex += 1
|
||||||
|
|
||||||
if (countessentialcmds < len(essentialcmds)):
|
if checkessential:
|
||||||
raise CmdInputError('Your input file is missing essential gprMax commands required to run a model. Essential commands are: ' + ', '.join(essentialcmds))
|
if (countessentialcmds < len(essentialcmds)):
|
||||||
|
raise CmdInputError('Your input file is missing essential gprMax commands required to run a model. Essential commands are: ' + ', '.join(essentialcmds))
|
||||||
|
|
||||||
return singlecmds, multiplecmds, geometry
|
return singlecmds, multiplecmds, geometry
|
||||||
|
|
||||||
|
在新工单中引用
屏蔽一个用户