diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5f86a0f8..ac55e67f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/src/amrex/extensions/MultiFab.py b/src/amrex/extensions/MultiFab.py index 11ce9de1..76e0dbe5 100644 --- a/src/amrex/extensions/MultiFab.py +++ b/src/amrex/extensions/MultiFab.py @@ -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