你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 23:14:03 +08:00
Improved joining of filenames and directory paths.
这个提交包含在:
@@ -68,9 +68,9 @@ class GeometryView:
|
|||||||
|
|
||||||
# Construct filename from user-supplied name and model run number
|
# Construct filename from user-supplied name and model run number
|
||||||
if numbermodelruns == 1:
|
if numbermodelruns == 1:
|
||||||
self.filename = G.inputdirectory + self.filename
|
self.filename = os.path.abspath(os.path.join(G.inputdirectory, self.filename))
|
||||||
else:
|
else:
|
||||||
self.filename = G.inputdirectory + self.filename + str(modelrun)
|
self.filename = os.path.abspath(os.path.join(G.inputdirectory, self.filename + str(modelrun)))
|
||||||
|
|
||||||
if self.type == 'n':
|
if self.type == 'n':
|
||||||
self.filename += '.vti'
|
self.filename += '.vti'
|
||||||
|
@@ -57,8 +57,8 @@ def main():
|
|||||||
parser.add_argument('--opt-taguchi', action='store_true', default=False, help='optimise parameters using the Taguchi optimisation method')
|
parser.add_argument('--opt-taguchi', action='store_true', default=False, help='optimise parameters using the Taguchi optimisation method')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
numbermodelruns = args.n
|
numbermodelruns = args.n
|
||||||
inputdirectory = os.path.dirname(os.path.abspath(args.inputfile)) + os.sep
|
inputdirectory = os.path.dirname(os.path.abspath(args.inputfile))
|
||||||
inputfile = inputdirectory + os.path.basename(args.inputfile)
|
inputfile = os.path.abspath(os.path.join(inputdirectory, os.path.basename(args.inputfile)))
|
||||||
|
|
||||||
# Create a separate namespace that users can access in any Python code blocks in the input file
|
# Create a separate namespace that users can access in any Python code blocks in the input file
|
||||||
usernamespace = {'c': c, 'e0': e0, 'm0': m0, 'z0': z0, 'number_model_runs': numbermodelruns, 'inputdirectory': inputdirectory}
|
usernamespace = {'c': c, 'e0': e0, 'm0': m0, 'z0': z0, 'number_model_runs': numbermodelruns, 'inputdirectory': inputdirectory}
|
||||||
|
@@ -85,7 +85,7 @@ class Snapshot:
|
|||||||
|
|
||||||
if not os.path.exists(snapshotdir):
|
if not os.path.exists(snapshotdir):
|
||||||
os.mkdir(snapshotdir)
|
os.mkdir(snapshotdir)
|
||||||
self.filename = os.path.join(snapshotdir, self.filename + '.vti')
|
self.filename = os.path.abspath(os.path.join(snapshotdir, self.filename + '.vti'))
|
||||||
|
|
||||||
# Calculate number of cells according to requested sampling
|
# Calculate number of cells according to requested sampling
|
||||||
self.vtk_xscells = round_value(self.xs / self.dx)
|
self.vtk_xscells = round_value(self.xs / self.dx)
|
||||||
|
在新工单中引用
屏蔽一个用户