Skip to content

Commit

Permalink
Make the call to next() in algorithm iteration loop explicit (#2069)
Browse files Browse the repository at this point in the history
---------

Signed-off-by: Margaret Duff <[email protected]>
  • Loading branch information
MargaretDuff authored Feb 11, 2025
1 parent ec1f3a6 commit 98860db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
- Bug fixes:
- Fix deprecation warning for rtol and atol in GD (#2056)
- Removed the deprecated usage of run method in test_SIRF.py (#2070)
- Enhancements:
- Made the call to next() in algorithm iteration loop explicit (#2069)




* 24.3.0
Expand Down
3 changes: 2 additions & 1 deletion Wrappers/Python/cil/optimisation/algorithms/Algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,9 @@ def run(self, iterations=None, callbacks: Optional[List[Callback]]=None, verbose
self.max_iteration = self.iteration + iterations
iters = (count(self.iteration) if np.isposinf(self.max_iteration)
else range(self.iteration, self.max_iteration))
for _ in zip(iters, self):
for _ in iters:
try:
self.__next__()
for callback in callbacks:
callback(self)
except StopIteration:
Expand Down

0 comments on commit 98860db

Please sign in to comment.