Skip to content

Commit

Permalink
Merge pull request #531 from ubermag/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
lang-m authored Feb 3, 2025
2 parents a2289db + 1d7d3af commit 9115e5c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ exclude: 'dev'

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-merge-conflict # checks for files that contain merge conflict strings
- id: check-toml # checks toml files for parseable syntax
- id: debug-statements # checks for debugger imports and py37+ `breakpoint()` calls in python source

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.4
rev: v0.9.3
hooks:
# Run the linter.
- id: ruff
Expand Down
8 changes: 4 additions & 4 deletions discretisedfield/io/ovf.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ def _to_ovf(
# Desc: File generated by Field class
# meshunit: {self.mesh.region.units[0]}
# meshtype: rectangular
# xbase: {self.mesh.region.pmin[0] + self.mesh.cell[0]/2}
# ybase: {self.mesh.region.pmin[1] + self.mesh.cell[1]/2}
# zbase: {self.mesh.region.pmin[2] + self.mesh.cell[2]/2}
# xbase: {self.mesh.region.pmin[0] + self.mesh.cell[0] / 2}
# ybase: {self.mesh.region.pmin[1] + self.mesh.cell[1] / 2}
# zbase: {self.mesh.region.pmin[2] + self.mesh.cell[2] / 2}
# xnodes: {self.mesh.n[0]}
# ynodes: {self.mesh.n[1]}
# znodes: {self.mesh.n[2]}
Expand Down Expand Up @@ -172,7 +172,7 @@ def _from_ovf(cls, filename):
# >>> READ DATA <<<
if mode == "binary":
# OVF2 uses little-endian and OVF1 uses big-endian
format = f'{"<" if ovf_v2 else ">"}{"d" if nbytes == 8 else "f"}'
format = f"{'<' if ovf_v2 else '>'}{'d' if nbytes == 8 else 'f'}"

test_value = struct.unpack(format, f.read(nbytes))[0]
check = {4: 1234567.0, 8: 123456789012345.0}
Expand Down
2 changes: 1 addition & 1 deletion discretisedfield/plotting/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,5 @@ def _pyvista_save_to_file(filename, plotter):
else:
raise ValueError(
f"{extension} extension is not supported. The supported formats are"
f" {', '.join(screenshot+graphic)}."
f" {', '.join(screenshot + graphic)}."
)
12 changes: 6 additions & 6 deletions discretisedfield/tests/test_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ def test_pyvista_valid_filename_extensions_screenshot(extension):

try:
plot_util._pyvista_save_to_file(filename, plotter)
assert os.path.exists(
filename
), f"File with extension {extension} was not created."
assert os.path.exists(filename), (
f"File with extension {extension} was not created."
)
finally:
os.remove(filename)

Expand All @@ -56,8 +56,8 @@ def test_pyvista_valid_filename_extensions_save_graphic(extension):

try:
plot_util._pyvista_save_to_file(filename, plotter)
assert os.path.exists(
filename
), f"File with extension {extension} was not created."
assert os.path.exists(filename), (
f"File with extension {extension} was not created."
)
finally:
os.remove(filename)

0 comments on commit 9115e5c

Please sign in to comment.