updated the pre-commit-config.yaml file by updating the versions of black and pre-commit-hooks.

这个提交包含在:
Sai-Suraj-27
2023-07-26 19:58:57 +05:30
父节点 038f21ce2c
当前提交 21388e6346
共有 5 个文件被更改,包括 10 次插入10 次删除

查看文件

@@ -1,14 +1,14 @@
# See https://pre-commit.com for more information # See https://pre-commit.com for more information
repos: repos:
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.0.0 rev: v3.3.0
hooks: hooks:
- id: trailing-whitespace - id: trailing-whitespace
- id: end-of-file-fixer - id: end-of-file-fixer
- id: check-yaml - id: check-yaml
- id: check-added-large-files - id: check-added-large-files
- repo: https://github.com/psf/black - repo: https://github.com/psf/black
rev: 23.3.0 rev: 23.7.0
hooks: hooks:
- id: black - id: black
args: ["--line-length", "120"] # Adjust the max line length value as needed. args: ["--line-length", "120"] # Adjust the max line length value as needed.

查看文件

@@ -223,7 +223,7 @@ update_electric_dispersive_A = {
// component arrays. // component arrays.
$CUDA_IDX $CUDA_IDX
// Convert the linear index to subscripts for 3D field arrays // Convert the linear index to subscripts for 3D field arrays
int x = i / ($NY_FIELDS * $NZ_FIELDS); int x = i / ($NY_FIELDS * $NZ_FIELDS);
int y = (i % ($NY_FIELDS * $NZ_FIELDS)) / $NZ_FIELDS; int y = (i % ($NY_FIELDS * $NZ_FIELDS)) / $NZ_FIELDS;
@@ -335,7 +335,7 @@ update_electric_dispersive_B = {
// component arrays. // component arrays.
$CUDA_IDX $CUDA_IDX
// Convert the linear index to subscripts for 3D field arrays // Convert the linear index to subscripts for 3D field arrays
int x = i / ($NY_FIELDS * $NZ_FIELDS); int x = i / ($NY_FIELDS * $NZ_FIELDS);
int y = (i % ($NY_FIELDS * $NZ_FIELDS)) / $NZ_FIELDS; int y = (i % ($NY_FIELDS * $NZ_FIELDS)) / $NZ_FIELDS;

查看文件

@@ -24,7 +24,7 @@ from gprMax.waveforms import Waveform
def hertzian_dipole_fs(iterations, dt, dxdydz, rx): def hertzian_dipole_fs(iterations, dt, dxdydz, rx):
"""Analytical solution of a z-directed Hertzian dipole in free space with a """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). (http://dx.doi.org/10.1016/0021-9991(83)90103-1).
Args: Args:

查看文件

@@ -7,12 +7,12 @@ from . import slice
def convert_meshes(meshes, discretization, parallel=True): def convert_meshes(meshes, discretization, parallel=True):
scale, shift, shape = slice.calculate_scale_shift(meshes, discretization) scale, shift, shape = slice.calculate_scale_shift(meshes, discretization)
vol = np.zeros(shape[::-1], dtype=np.int8) 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): for mesh_ind, org_mesh in enumerate(meshes):
slice.scale_and_shift_mesh(org_mesh, scale, shift) slice.scale_and_shift_mesh(org_mesh, scale, shift)
cur_vol = slice.mesh_to_plane(org_mesh, shape, parallel) 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 return vol, scale, shift

查看文件

@@ -16,10 +16,10 @@ if __name__ == "__main__":
description="Allows the user to convert a STL files to voxelized mesh.", description="Allows the user to convert a STL files to voxelized mesh.",
usage="cd gprMax; python -m toolboxes.STLtoVoxel.stltovoxel stlfilename -matindex -dxdydz", 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( 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() args = parser.parse_args()
if os.path.isdir(args.stlfiles): if os.path.isdir(args.stlfiles):
@@ -52,4 +52,4 @@ if __name__ == "__main__":
# for i, file in enumerate(files): # for i, file in enumerate(files):
# name = os.path.splitext(os.path.basename(file))[0] # name = os.path.splitext(os.path.basename(file))[0]
# f.write(f"#material: {i + 1} 0 1 0 {name}" + "\n") # f.write(f"#material: {i + 1} 0 1 0 {name}" + "\n")
# logger.info(f"Written materials file: {filename_mats}") # logger.info(f"Written materials file: {filename_mats}")