diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7a8cbc8..f7828d3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,13 +7,13 @@ repos: - --all - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.1 + rev: v0.8.2 hooks: - id: ruff-format - id: ruff - repo: https://github.com/pre-commit/pre-commit-hooks - rev: 'v4.6.0' + rev: 'v5.0.0' hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -21,7 +21,7 @@ repos: - id: check-merge-conflict - repo: https://github.com/pre-commit/mirrors-mypy - rev: 'v1.11.1' + rev: 'v1.13.0' hooks: - id: mypy additional_dependencies: diff --git a/src/furax/_base/indices.py b/src/furax/_base/indices.py index 88eef59..7e47c75 100644 --- a/src/furax/_base/indices.py +++ b/src/furax/_base/indices.py @@ -59,7 +59,7 @@ def __init__( self._check_indices(indices) self.indices = indices if all( - isinstance(_, (int, slice, EllipsisType)) or isinstance(_, Array) and _.dtype == bool + isinstance(_, int | slice | EllipsisType) or isinstance(_, Array) and _.dtype == bool for _ in indices ): unique_indices = True @@ -90,7 +90,9 @@ def reduce(self) -> AbstractLinearOperator: @staticmethod def _check_indices( - indices: tuple[int | slice | Bool[Array, '...'] | Integer[Array, '...'] | EllipsisType, ...] + indices: tuple[ + int | slice | Bool[Array, '...'] | Integer[Array, '...'] | EllipsisType, ... + ], ) -> None: ellipsis_count = sum(index is Ellipsis for index in indices) if ellipsis_count > 1: diff --git a/src/furax/landscapes.py b/src/furax/landscapes.py index d9c81e8..efa8da9 100644 --- a/src/furax/landscapes.py +++ b/src/furax/landscapes.py @@ -37,7 +37,7 @@ ScalarType = Union[jnp.bool_, NumberType] DTypeLike = Union[ str, # like 'float32', 'int32' - type[Union[bool, int, float, complex, ScalarType, np.bool_, np.number]], # type: ignore[type-arg] # noqa: E501 + type[Union[bool, int, float, complex, ScalarType, np.bool_, np.number]], # noqa: E501 np.dtype, # type: ignore[type-arg] ]