Skip to content

Commit

Permalink
Fix CI, update pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
sbiquard committed Dec 10, 2024
1 parent 2086270 commit 2271534
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ 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
- id: check-yaml
- 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:
Expand Down
6 changes: 4 additions & 2 deletions src/furax/_base/indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/furax/landscapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
]

Expand Down

0 comments on commit 2271534

Please sign in to comment.