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 #219

Merged
merged 2 commits into from
Feb 24, 2025
Merged
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 @@ -28,11 +28,11 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.0
rev: v3.19.1
hooks:
- id: pyupgrade
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.2
rev: v0.9.7
hooks:
- id: ruff
types_or: [ python, pyi, jupyter ]
Expand Down
4 changes: 2 additions & 2 deletions src/pydrex/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def extract_h5part(
strains[t] = f[f"{k}/CPO_{n_grains * 10 + 1}"][particle_id - 1]
vals = np.empty(n_grains * 10)
for n in range(len(vals)):
vals[n] = f[f"{k}/CPO_{n+1}"][particle_id - 1]
vals[n] = f[f"{k}/CPO_{n + 1}"][particle_id - 1]

orientations[t] = np.array(
[
Expand Down Expand Up @@ -456,7 +456,7 @@ def parse_config(path):

# Use provided name or set randomized default.
toml["name"] = toml.get(
"name", f"pydrex.{np.random.default_rng().integers(1,1e10)}"
"name", f"pydrex.{np.random.default_rng().integers(1, 1e10)}"
)

toml["parameters"] = _parse_config_params(toml)
Expand Down
2 changes: 1 addition & 1 deletion src/pydrex/visualisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@


def default_tick_formatter(x, pos):
return f"{x/1e3:.1f}"
return f"{x / 1e3:.1f}"


def polefigures(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_corner_flow_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def test_steady4(self, outdir, seed, ncpus):
_log.debug("Total walltime: %s", perf_counter() - _begin)

if outdir is not None:
labels.append(rf"$z_{{f}}$ = {z_exit/1e3:.1f} km")
labels.append(rf"$z_{{f}}$ = {z_exit / 1e3:.1f} km")
angles.append(misorient_angles)
indices.append(misorient_indices)
paths.append(positions)
Expand Down
6 changes: 3 additions & 3 deletions tests/test_diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,9 @@ def test_textures_increasing_ortho(self, seed):
M_vals[i] = _diagnostics.misorientation_index(
orientations, _geo.LatticeSystem.orthorhombic
)
assert np.all(
np.diff(M_vals) >= 0
), f"M-index values {M_vals} are not increasing"
assert np.all(np.diff(M_vals) >= 0), (
f"M-index values {M_vals} are not increasing"
)

def test_texture_girdle_ortho(self, seed):
"""Test M-index for girdled texture."""
Expand Down