Skip to content

Commit 9094d03

Browse files
authored
fix reporting nonconvergence as divergence for non-Cauchy termination (#754)
* fix reporting nonconvergence as divergence for non-Cauchy termination * fix test
1 parent 31b2f16 commit 9094d03

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

diffrax/_root_finder/_verychord.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def terminate(
162162
converged = _converged(factor, self.kappa)
163163
terminate = at_least_two & (small | diverged | converged)
164164
terminate_result = optx.RESULTS.where(
165-
at_least_two & jnp.invert(small) & (diverged | jnp.invert(converged)),
165+
at_least_two & jnp.invert(small) & diverged,
166166
optx.RESULTS.nonlinear_divergence,
167167
optx.RESULTS.successful,
168168
)

test/test_solver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def test_implicit_euler_adaptive():
5050
stepsize_controller=stepsize_controller,
5151
throw=False,
5252
)
53-
assert out1.result == diffrax.RESULTS.nonlinear_divergence
53+
assert out1.result == diffrax.RESULTS.nonlinear_max_steps_reached
5454
assert out2.result == diffrax.RESULTS.successful
5555

5656

0 commit comments

Comments
 (0)