Skip to content

Commit fbdba0d

Browse files
committed
Fix bug where quality < 0
1 parent 4567661 commit fbdba0d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/classy_blocks/optimize/iteration.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ def converged(self) -> bool:
121121
report("Iteration limit hit, stopping optimization.")
122122
return True
123123

124+
if self.iterations[-1].final_quality < TOL:
125+
print("Nothing left to optimize.")
126+
return True
127+
124128
if len(self.iterations) < 2:
125129
# Can't decide without data
126130
return False
@@ -129,8 +133,4 @@ def converged(self) -> bool:
129133
print("Tolerance reached, stopping optimization.")
130134
return True
131135

132-
if self.iterations[-1].final_quality < TOL:
133-
print("Nothing left to optimize.")
134-
return True
135-
136136
return False

0 commit comments

Comments
 (0)