Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #531

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Loading