Skip to content

Commit

Permalink
Fixed errors from new pyright
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-kidger committed Apr 14, 2024
1 parent 25531dc commit b146089
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions equinox/_ad.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,9 +566,11 @@ def f(x, y):
# Skip jaxpr tracing for efficiency.
closure_converted = _TrivialClosureConvert(fn, in_dynamic_struct, in_static)
else:
fn = cast(Callable[_P, _T], fn)
closed_jaxpr, out_dynamic_struct, out_static = filter_make_jaxpr(fn)(
*args, **kwargs
) # pyright: ignore
*args, # pyright: ignore
**kwargs,
)
jaxpr = closed_jaxpr.jaxpr
consts = closed_jaxpr.consts
out_dynamic_struct = jtu.tree_flatten(out_dynamic_struct)
Expand Down
2 changes: 1 addition & 1 deletion equinox/internal/_omega.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def at(self):


if TYPE_CHECKING:
ω: Any
ω: Any = ...
else:
ω =

Expand Down
2 changes: 1 addition & 1 deletion equinox/nn/_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# https://github.com/microsoft/pyright/issues/3450
def all_sequences(
x: Union[Sequence[Any], Sequence[_T]],
) -> "te.StrictTypeGuard[Sequence[_T]]":
) -> "te.TypeIs[Sequence[_T]]":
...

else:
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,5 @@ order-by-type = false
[tool.pyright]
reportIncompatibleMethodOverride = true
reportIncompatibleVariableOverride = false # Incompatible with eqx.AbstractVar
reportFunctionMemberAccess = false
include = ["equinox", "tests"]

0 comments on commit b146089

Please sign in to comment.