From 21388e634639c87a0c3aa53fd1e087fbd6f49409 Mon Sep 17 00:00:00 2001 From: Sai-Suraj-27 Date: Wed, 26 Jul 2023 19:58:57 +0530 Subject: [PATCH] updated the pre-commit-config.yaml file by updating the versions of black and pre-commit-hooks. --- .pre-commit-config.yaml | 4 ++-- gprMax/cuda_opencl/knl_fields_updates.py | 4 ++-- testing/analytical_solutions.py | 2 +- toolboxes/STLtoVoxel/convert.py | 4 ++-- toolboxes/STLtoVoxel/stltovoxel.py | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 43e4d52d..9ed28854 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,14 +1,14 @@ # See https://pre-commit.com for more information repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.0.0 + rev: v3.3.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml - id: check-added-large-files - repo: https://github.com/psf/black - rev: 23.3.0 + rev: 23.7.0 hooks: - id: black args: ["--line-length", "120"] # Adjust the max line length value as needed. diff --git a/gprMax/cuda_opencl/knl_fields_updates.py b/gprMax/cuda_opencl/knl_fields_updates.py index 91fc8293..8b0a7836 100644 --- a/gprMax/cuda_opencl/knl_fields_updates.py +++ b/gprMax/cuda_opencl/knl_fields_updates.py @@ -223,7 +223,7 @@ update_electric_dispersive_A = { // component arrays. $CUDA_IDX - + // Convert the linear index to subscripts for 3D field arrays int x = i / ($NY_FIELDS * $NZ_FIELDS); int y = (i % ($NY_FIELDS * $NZ_FIELDS)) / $NZ_FIELDS; @@ -335,7 +335,7 @@ update_electric_dispersive_B = { // component arrays. $CUDA_IDX - + // Convert the linear index to subscripts for 3D field arrays int x = i / ($NY_FIELDS * $NZ_FIELDS); int y = (i % ($NY_FIELDS * $NZ_FIELDS)) / $NZ_FIELDS; diff --git a/testing/analytical_solutions.py b/testing/analytical_solutions.py index 425e8f01..76656dd0 100644 --- a/testing/analytical_solutions.py +++ b/testing/analytical_solutions.py @@ -24,7 +24,7 @@ from gprMax.waveforms import Waveform def hertzian_dipole_fs(iterations, dt, dxdydz, rx): """Analytical solution of a z-directed Hertzian dipole in free space with a - current waveform of the form of the first derivative of a Gaussian + current waveform of the form of the first derivative of a Gaussian (http://dx.doi.org/10.1016/0021-9991(83)90103-1). Args: diff --git a/toolboxes/STLtoVoxel/convert.py b/toolboxes/STLtoVoxel/convert.py index ef4f6274..dfe02736 100644 --- a/toolboxes/STLtoVoxel/convert.py +++ b/toolboxes/STLtoVoxel/convert.py @@ -7,12 +7,12 @@ from . import slice def convert_meshes(meshes, discretization, parallel=True): scale, shift, shape = slice.calculate_scale_shift(meshes, discretization) vol = np.zeros(shape[::-1], dtype=np.int8) - vol.fill(-1) # Fill array with -1 to indicate background in gprMax + vol.fill(-1) # Fill array with -1 to indicate background in gprMax for mesh_ind, org_mesh in enumerate(meshes): slice.scale_and_shift_mesh(org_mesh, scale, shift) cur_vol = slice.mesh_to_plane(org_mesh, shape, parallel) - vol[cur_vol] = mesh_ind # Removed plus 1 to work with gprMax material indexing + vol[cur_vol] = mesh_ind # Removed plus 1 to work with gprMax material indexing return vol, scale, shift diff --git a/toolboxes/STLtoVoxel/stltovoxel.py b/toolboxes/STLtoVoxel/stltovoxel.py index 5a2ae39c..258eb970 100644 --- a/toolboxes/STLtoVoxel/stltovoxel.py +++ b/toolboxes/STLtoVoxel/stltovoxel.py @@ -16,10 +16,10 @@ if __name__ == "__main__": description="Allows the user to convert a STL files to voxelized mesh.", usage="cd gprMax; python -m toolboxes.STLtoVoxel.stltovoxel stlfilename -matindex -dxdydz", ) - parser.add_argument("stlfiles", help="can be the filename of a single STL file, or the path to folder containing multiple STL files") parser.add_argument( - "-dxdydz", type=float, required=True, help="discretisation to use in voxelisation process" + "stlfiles", help="can be the filename of a single STL file, or the path to folder containing multiple STL files" ) + parser.add_argument("-dxdydz", type=float, required=True, help="discretisation to use in voxelisation process") args = parser.parse_args() if os.path.isdir(args.stlfiles): @@ -52,4 +52,4 @@ if __name__ == "__main__": # for i, file in enumerate(files): # name = os.path.splitext(os.path.basename(file))[0] # f.write(f"#material: {i + 1} 0 1 0 {name}" + "\n") - # logger.info(f"Written materials file: {filename_mats}") \ No newline at end of file + # logger.info(f"Written materials file: {filename_mats}")