Skip to content

Commit

Permalink
Accommodate new np.solve broadcasting rules in NumPy 2.0
Browse files Browse the repository at this point in the history
Fixes #15.
  • Loading branch information
schmrlng committed Oct 10, 2024
1 parent 16b8d15 commit 3df209c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hj_reachability/finite_differences/upwind_first.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def _diff_coefficients(k: Optional[int] = None, stencil: Optional[Array] = None)
f"{(k, stencil.shape[-1] - 1)}.")
return np.linalg.solve(
np.diff(poly.polyvander(stencil, k), axis=-2)[..., 1:].swapaxes(-1, -2),
np.eye(k)[(np.newaxis,) * (stencil.ndim - 1) + (0,)])
np.eye(k)[(np.newaxis,) * (stencil.ndim - 1) + (0, ..., np.newaxis)])[..., 0]


def _substencil_coefficients(k: int) -> Array:
Expand Down

0 comments on commit 3df209c

Please sign in to comment.