Reformatted some code in 3 more files to make it more cleaner, and better.

这个提交包含在:
Sai Suraj
2023-04-16 00:46:37 +05:30
父节点 d9175e8a5e
当前提交 a347b12c9e
共有 3 个文件被更改,包括 15 次插入16 次删除

查看文件

@@ -277,10 +277,7 @@ class Comments():
"""
# Comments for Paraview macro
comments = {}
comments['gprMax_version'] = __version__
comments['dx_dy_dz'] = self.dx_dy_dz_comment()
comments = {'gprMax_version': __version__, 'dx_dy_dz': self.dx_dy_dz_comment()}
comments['nx_ny_nz'] = self.nx_ny_nz_comment()
# Write the name and numeric ID for each material

查看文件

@@ -178,14 +178,15 @@ def write_processed_file(processedlines):
for item in processedlines:
f.write(f'{item}')
logger.info(f'Written input commands, after processing any Python code and ' +
f'include commands, to file: {processedfile}\n')
logger.info(
f'Written input commands, after processing any Python code and include commands, to file: {processedfile}\n'
)
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.
Args:
processedlines: list of input commands after Python processing.
checkessential: boolean to check for essential commands or not.

查看文件

@@ -249,12 +249,13 @@ def process_materials(G):
z += 3
# Construct information on material properties for printing table
materialtext = []
materialtext.append(str(material.numID))
materialtext.append(material.ID[:50] if len(material.ID) > 50 else material.ID)
materialtext.append(material.type)
materialtext.append(f'{material.er:g}')
materialtext.append(f'{material.se:g}')
materialtext = [
str(material.numID),
material.ID[:50] if len(material.ID) > 50 else material.ID,
material.type,
f'{material.er:g}',
f'{material.se:g}',
]
if config.get_model_config().materials['maxpoles'] > 0:
if 'debye' in material.type:
materialtext.append('\n'.join('{:g}'.format(deltaer) for deltaer in material.deltaer))
@@ -274,9 +275,9 @@ def process_materials(G):
else:
materialtext.extend(['', '', '', '', ''])
materialtext.append(f'{material.mr:g}')
materialtext.append(f'{material.sm:g}')
materialtext.append(material.averagable)
materialtext.extend(
(f'{material.mr:g}', f'{material.sm:g}', material.averagable)
)
materialsdata.append(materialtext)
return materialsdata