Skip to content

Commit

Permalink
Update Ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
NeilGirdhar committed Feb 18, 2024
1 parent 80b760a commit e26a749
Show file tree
Hide file tree
Showing 6 changed files with 177 additions and 171 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.1
rev: v0.2.2
hooks:
- id: ruff

Expand Down
338 changes: 169 additions & 169 deletions poetry.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions tests/test_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ def test_tapped_key(capsys: CaptureFixture[str],
console: Console) -> None:
with enable_custom_prng():
k = key(123)

@jit
def f(x: KeyArray) -> KeyArray:
return tapped_print_generic(x)
Expand Down
3 changes: 3 additions & 0 deletions tjax/_src/dataclasses/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def field(*, static: bool = False, default: T, init: bool = ...,
metadata: Mapping[str, Any] | None = ..., kw_only: bool = ...) -> T:
...


@overload
def field(*, static: bool = False, default_factory: Callable[[], T], init: bool = ...,
repr: bool = ..., # noqa: A002
Expand All @@ -29,6 +30,7 @@ def field(*, static: bool = False, default_factory: Callable[[], T], init: bool
metadata: Mapping[str, Any] | None = ..., kw_only: bool = ...) -> T:
...


@overload
def field(*, static: bool = False, init: bool = ...,
repr: bool = ..., # noqa: A002
Expand All @@ -37,6 +39,7 @@ def field(*, static: bool = False, init: bool = ...,
metadata: Mapping[str, Any] | None = ..., kw_only: bool = ...) -> Any:
...


def field(*, static: bool = False, default: Any = MISSING,
default_factory: Any = MISSING, init: bool = True,
repr: bool = True, # noqa: A002
Expand Down
2 changes: 1 addition & 1 deletion tjax/_src/math_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def divide_nonnegative(dividend: RealNumeric, divisor: RealNumeric) -> JaxRealAr
Returns: The quotient assuming that the dividend and divisor are nonnegative, and infinite
whenever the divisor equals zero.
"""
return divide_where(dividend, divisor, where=divisor > 0.0, otherwise=jnp.inf) # noqa: PLR2004
return divide_where(dividend, divisor, where=divisor > 0.0, otherwise=jnp.inf)


def zero_tangent_like(value: Array) -> NumpyRealArray:
Expand Down
2 changes: 2 additions & 0 deletions tjax/_src/tree_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@


T = TypeVar('T')


def tree_map_with_path(structure: Any,
transform: Callable[[T, tuple[str, ...]], T]
) -> Any:
Expand Down

0 comments on commit e26a749

Please sign in to comment.