Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 3, 2025
1 parent 38c6e94 commit 7a46bdc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
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 7a46bdc

Please sign in to comment.