你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-08 07:24:19 +08:00
Tidied up file opening method.
这个提交包含在:
@@ -410,7 +410,7 @@ class GeometryObjects:
|
||||
"""
|
||||
|
||||
# Write the geometry objects to a HDF5 file
|
||||
fdata = h5py.File(self.filename_hdf5, 'w')
|
||||
with h5py.File(self.filename_hdf5, 'w') as fdata:
|
||||
fdata.attrs['gprMax'] = __version__
|
||||
fdata.attrs['Title'] = G.title
|
||||
fdata.attrs['dx_dy_dz'] = (G.dx, G.dy, G.dz)
|
||||
@@ -434,7 +434,7 @@ class GeometryObjects:
|
||||
|
||||
# Write materials list to a text file
|
||||
# This includes all materials in range whether used in volume or not
|
||||
fmaterials = open(self.filename_materials, 'w')
|
||||
with open(self.filename_materials, 'w') as fmaterials:
|
||||
for numID in range(minmat, maxmat + 1):
|
||||
for material in G.materials:
|
||||
if material.numID == numID:
|
||||
|
在新工单中引用
屏蔽一个用户