Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#219)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/asottile/pyupgrade: v3.19.0 → v3.19.1](asottile/pyupgrade@v3.19.0...v3.19.1)
- [github.com/astral-sh/ruff-pre-commit: v0.8.2 → v0.9.7](astral-sh/ruff-pre-commit@v0.8.2...v0.9.7)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Feb 24, 2025
1 parent fb63ea6 commit 22ac93b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
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

0 comments on commit 22ac93b

Please sign in to comment.