Merge pull request #387 from Sai-Suraj-27/update_pre-commit-hooks

Added a new check that verifies `.toml` files in the repo, and updated `black` version.
这个提交包含在:
Craig Warren
2023-10-11 11:55:38 +01:00
提交者 GitHub
当前提交 6935dcfbbd
共有 4 个文件被更改,包括 10 次插入12 次删除

查看文件

@@ -7,8 +7,9 @@ repos:
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 23.7.0
- id: check-toml
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.9.1
hooks:
- id: black
args: ["--line-length", "120"] # Adjust the max line length value as needed.

查看文件

@@ -171,8 +171,8 @@ class ExcitationFile(UserObjectMulti):
# Interpolate waveform values
w.userfunc = interpolate.interp1d(waveformtime, singlewaveformvalues, **kwargs)
logger.info(self.grid_name(grid) +
f"User waveform {w.ID} created using {timestr} and, if "
logger.info(
self.grid_name(grid) + f"User waveform {w.ID} created using {timestr} and, if "
f"required, interpolation parameters (kind: {kwargs['kind']}, "
f"fill value: {kwargs['fill_value']})."
)
@@ -837,9 +837,7 @@ class Rx(UserObjectMulti):
def _do_rotate(self, grid):
"""Performs rotation."""
new_pt = (self.kwargs["p1"][0] + grid.dx,
self.kwargs["p1"][1] + grid.dy,
self.kwargs["p1"][2] + grid.dz)
new_pt = (self.kwargs["p1"][0] + grid.dx, self.kwargs["p1"][1] + grid.dy, self.kwargs["p1"][2] + grid.dz)
pts = np.array([self.kwargs["p1"], new_pt])
rot_pts = rotate_2point_object(pts, self.axis, self.angle, self.origin)
self.kwargs["p1"] = tuple(rot_pts[0, :])

查看文件

@@ -237,8 +237,7 @@ class PML:
kappamin = sum(cfs.kappa.min for cfs in self.CFS)
if kappamin < 1:
logger.exception(f"Sum of kappamin value(s) for PML is {kappamin} "
"and must be greater than one.")
logger.exception(f"Sum of kappamin value(s) for PML is {kappamin} " "and must be greater than one.")
raise ValueError
def initialise_field_arrays(self):