Added a pre-commit config file and reformatted all the files accordingly by using it.

这个提交包含在:
Sai-Suraj-27
2023-06-26 16:09:39 +05:30
父节点 c71e87e34f
当前提交 f9dd7f2420
共有 155 个文件被更改,包括 11383 次插入8802 次删除

查看文件

@@ -20,30 +20,37 @@ import logging
import humanize
from gprMax.utilities.host_info import (detect_cuda_gpus, detect_opencl,
get_host_info, print_cuda_info,
print_opencl_info)
from gprMax.utilities.host_info import (
detect_cuda_gpus,
detect_opencl,
get_host_info,
print_cuda_info,
print_opencl_info,
)
from gprMax.utilities.utilities import get_terminal_width
logging.basicConfig(format='%(message)s', level=logging.INFO)
logging.basicConfig(format="%(message)s", level=logging.INFO)
# Host machine info.
hostinfo = get_host_info()
hyperthreadingstr = f", {hostinfo['logicalcores']} cores with Hyper-Threading" if hostinfo['hyperthreading'] else ''
hostname = (f"\n=== {hostinfo['hostname']}")
hyperthreadingstr = f", {hostinfo['logicalcores']} cores with Hyper-Threading" if hostinfo["hyperthreading"] else ""
hostname = f"\n=== {hostinfo['hostname']}"
logging.info(f"{hostname} {'=' * (get_terminal_width() - len(hostname) - 1)}")
logging.info(f"\n{'Mfr/model:':<12} {hostinfo['machineID']}")
logging.info(f"{'CPU:':<12} {hostinfo['sockets']} x {hostinfo['cpuID']} " +
f"({hostinfo['physicalcores']} cores{hyperthreadingstr})")
logging.info(
f"{'CPU:':<12} {hostinfo['sockets']} x {hostinfo['cpuID']} "
+ f"({hostinfo['physicalcores']} cores{hyperthreadingstr})"
)
logging.info(f"{'RAM:':<12} {humanize.naturalsize(hostinfo['ram'], True)}")
logging.info(f"{'OS/Version:':<12} {hostinfo['osversion']}")
# OpenMP
logging.info("\n\n=== OpenMP capabilities (gprMax will not use Hyper-Threading " +
"as there is no performance advantage)\n")
logging.info(
"\n\n=== OpenMP capabilities (gprMax will not use Hyper-Threading " + "as there is no performance advantage)\n"
)
logging.info(f"{'OpenMP threads: '} {hostinfo['physicalcores']}")
# CUDA
# CUDA
logging.info("\n\n=== CUDA capabilities\n")
gpus = detect_cuda_gpus()
if gpus: