Skip to content

Commit 98860db

Browse files
authored
Make the call to next() in algorithm iteration loop explicit (#2069)
--------- Signed-off-by: Margaret Duff <[email protected]>
1 parent ec1f3a6 commit 98860db

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
- Bug fixes:
33
- Fix deprecation warning for rtol and atol in GD (#2056)
44
- Removed the deprecated usage of run method in test_SIRF.py (#2070)
5+
- Enhancements:
6+
- Made the call to next() in algorithm iteration loop explicit (#2069)
7+
8+
59

610

711
* 24.3.0

Wrappers/Python/cil/optimisation/algorithms/Algorithm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,9 @@ def run(self, iterations=None, callbacks: Optional[List[Callback]]=None, verbose
276276
self.max_iteration = self.iteration + iterations
277277
iters = (count(self.iteration) if np.isposinf(self.max_iteration)
278278
else range(self.iteration, self.max_iteration))
279-
for _ in zip(iters, self):
279+
for _ in iters:
280280
try:
281+
self.__next__()
281282
for callback in callbacks:
282283
callback(self)
283284
except StopIteration:

0 commit comments

Comments
 (0)