Skip to content

Commit

Permalink
fix: mypy errors with numpy 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfikl committed Dec 10, 2024
1 parent fe994c4 commit 56c86dc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/burgers-ssweno-periodic-numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ def burgers_rhs(

fssw[0] = fssw[-1]

return -(fssw[1:] - fssw[:-1]) / dx
return -(fssw[1:] - fssw[:-1]) / dx # type: ignore[operator]


# }}}
Expand Down
2 changes: 1 addition & 1 deletion src/pyshocks/timestepping.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def step(
"""
if tfinal is None:
# NOTE: can't set this to jnp.inf because we have a debug check for it
tfinal = jnp.finfo(u0.dtype).max # type: ignore[no-untyped-call]
tfinal = float(jnp.finfo(u0.dtype).max) # type: ignore[no-untyped-call]

m = 0
t = jnp.array(tstart, dtype=u0.dtype)
Expand Down
2 changes: 1 addition & 1 deletion src/pyshocks/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def satisfied(

_, error = self._history
if atol is None:
atol = 1.0e2 * jnp.finfo(error.dtype).eps # type: ignore[no-untyped-call]
atol = 1.0e2 * float(jnp.finfo(error.dtype).eps) # type: ignore[no-untyped-call]

return bool(self.estimated_order >= (order - slack) or jnp.max(error) < atol)

Expand Down

0 comments on commit 56c86dc

Please sign in to comment.