你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 15:10:13 +08:00
converted a few print() calls to command() calls. Should be identical in behavior.
这个提交包含在:
@@ -59,12 +59,16 @@ def command(cmd, *parameters):
|
|||||||
try:
|
try:
|
||||||
s = '#{}: {}'.format(cmd, " ".join(parameters))
|
s = '#{}: {}'.format(cmd, " ".join(parameters))
|
||||||
except TypeError as e:
|
except TypeError as e:
|
||||||
|
# append info about cmd and parameters to the exception:
|
||||||
if not e.args: e.args=('', )
|
if not e.args: e.args=('', )
|
||||||
e.args = e.args + ("Creating cmd = #%s with parameters %s failed" % (cmd, parameters),)
|
additional_info = "Creating cmd = #{} with parameters {} failed".format(cmd, parameters)
|
||||||
|
e.args = e.args + (additional_info,)
|
||||||
raise e
|
raise e
|
||||||
|
# and now we can print it:
|
||||||
print(s)
|
print(s)
|
||||||
return s
|
return s
|
||||||
|
|
||||||
|
|
||||||
def domain(x, y, z):
|
def domain(x, y, z):
|
||||||
"""Prints the gprMax #domain command.
|
"""Prints the gprMax #domain command.
|
||||||
|
|
||||||
@@ -76,8 +80,8 @@ def domain(x, y, z):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
domain = Coordinate(x, y, z)
|
domain = Coordinate(x, y, z)
|
||||||
print('#domain: {}'.format(domain))
|
command('domain', domain)
|
||||||
|
|
||||||
return domain
|
return domain
|
||||||
|
|
||||||
|
|
||||||
@@ -92,7 +96,7 @@ def dx_dy_dz(x, y, z):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
dx_dy_dz = Coordinate(x, y, z)
|
dx_dy_dz = Coordinate(x, y, z)
|
||||||
print('#dx_dy_dz: {}'.format(dx_dy_dz))
|
command('dx_dy_dz', dx_dy_dz)
|
||||||
|
|
||||||
return dx_dy_dz
|
return dx_dy_dz
|
||||||
|
|
||||||
@@ -106,8 +110,8 @@ def time_window(time_window):
|
|||||||
Returns:
|
Returns:
|
||||||
time_window (float): Duration of simulation.
|
time_window (float): Duration of simulation.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
print('#time_window: {:g}'.format(time_window))
|
command('time_window', time_window)
|
||||||
|
|
||||||
return time_window
|
return time_window
|
||||||
|
|
||||||
|
在新工单中引用
屏蔽一个用户