Made changes to the reformatted code as per the suggestions given.

这个提交包含在:
Sai Suraj
2023-04-18 02:06:25 +05:30
父节点 4015c51bd7
当前提交 72c85b29d6
共有 7 个文件被更改,包括 58 次插入87 次删除

查看文件

@@ -178,8 +178,8 @@ 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 ' +
f'code and include commands, to file: {processedfile}\n')
def check_cmd_names(processedlines, checkessential=True):

查看文件

@@ -55,7 +55,7 @@ def process_singlecmds(singlecmds):
if singlecmds[cmd] is not None:
tmp = tuple(int(x) for x in singlecmds[cmd].split())
if len(tmp) != 1:
logger.exception(f'{cmd} requires exactly one parameter to specify '
logger.exception(f'{cmd} requires exactly one parameter to specify ' +
f'the number of CPU OpenMP threads to use')
raise ValueError
@@ -94,7 +94,7 @@ def process_singlecmds(singlecmds):
if singlecmds[cmd] is not None:
tmp = singlecmds[cmd].split()
if len(tmp) != 1:
logger.exception(f'{cmd} requires exactly one parameter to specify the '
logger.exception(f'{cmd} requires exactly one parameter to specify the ' +
f'time window. Either in seconds or number of iterations.')
raise ValueError
tmp = tmp[0].lower()

查看文件

@@ -884,27 +884,19 @@ class OpenCLUpdates:
knl_electric_name = getattr(knl_pml_updates_electric, knl_name)
knl_magnetic_name = getattr(knl_pml_updates_magnetic, knl_name)
pml.update_electric_dev = self.elwise(
self.ctx,
knl_electric_name['args_opencl'].substitute(
{'REAL': config.sim_config.dtypes['C_float_or_double']}
),
knl_electric_name['func'].substitute(subs),
f'pml_updates_electric_{knl_name}',
preamble=self.knl_common,
options=config.sim_config.devices['compiler_opts'],
)
pml.update_electric_dev = self.elwise(self.ctx,
knl_electric_name['args_opencl'].substitute({'REAL': config.sim_config.dtypes['C_float_or_double']}),
knl_electric_name['func'].substitute(subs),
'pml_updates_electric_' + knl_name,
preamble=self.knl_common,
options=config.sim_config.devices['compiler_opts'])
pml.update_magnetic_dev = self.elwise(
self.ctx,
knl_magnetic_name['args_opencl'].substitute(
{'REAL': config.sim_config.dtypes['C_float_or_double']}
),
knl_magnetic_name['func'].substitute(subs),
f'pml_updates_magnetic_{knl_name}',
preamble=self.knl_common,
options=config.sim_config.devices['compiler_opts'],
)
pml.update_magnetic_dev = self.elwise(self.ctx,
knl_magnetic_name['args_opencl'].substitute({'REAL': config.sim_config.dtypes['C_float_or_double']}),
knl_magnetic_name['func'].substitute(subs),
'pml_updates_magnetic_' + knl_name,
preamble=self.knl_common,
options=config.sim_config.devices['compiler_opts'])
def _set_rx_knl(self):
"""Receivers - initialises arrays on compute device, prepares kernel and