Skip to content

Commit 86ca2ce

Browse files
authored
Merge pull request #171 from kuramogura/patch-3
[career] Correct if collections in solve_model
2 parents 2abf38b + f1d2294 commit 86ca2ce

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lectures/career.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,9 @@ def solve_model(cw,
300300
print(f"Error at iteration {i} is {error}.")
301301
v = v_new
302302
303-
if i == max_iter:
304-
print("Failed to converge!")
305-
306-
if verbose and i < max_iter:
303+
if i == max_iter and error > tol:
304+
print("Failed to converge!"
305+
elif verbose:
307306
print(f"\nConverged in {i} iterations.")
308307
309308
return v_new

0 commit comments

Comments
 (0)