Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#403)
Browse files Browse the repository at this point in the history
<!--pre-commit.ci start-->
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.8.6 →
v0.9.1](astral-sh/ruff-pre-commit@v0.8.6...v0.9.1)
<!--pre-commit.ci end-->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Jan 14, 2025
1 parent f3a7b11 commit 47331d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ repos:
# Python: Ruff linter & formatter
# https://docs.astral.sh/ruff/
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
rev: v0.9.1
hooks:
# Run the linter
- id: ruff
Expand Down
12 changes: 6 additions & 6 deletions src/amrex/extensions/MultiFab.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,15 +362,15 @@ def _process_index(self, index):
index[i] = slice(start, stop, index[i].step)
elif isinstance(index[i], tuple):
# The slice includes ghosts
assert (
len(index[i]) == 0
), "Indicator to include all ghost cells must be an empty tuple"
assert len(index[i]) == 0, (
"Indicator to include all ghost cells must be an empty tuple"
)
index[i] = slice(mins_with_ghost[i], maxs_with_ghost[i] + 1)
else:
ii = _handle_imaginary_negative_index(index[i], mins[i], maxs[i])
assert (
mins_with_ghost[i] <= ii and ii <= maxs_with_ghost[i]
), "Index out of range"
assert mins_with_ghost[i] <= ii and ii <= maxs_with_ghost[i], (
"Index out of range"
)
index[i] = slice(ii, ii + 1)

return index
Expand Down

0 comments on commit 47331d7

Please sign in to comment.