Skip to content

Commit

Permalink
Fix for rios v2.0 in how the progress bar is called.
Browse files Browse the repository at this point in the history
  • Loading branch information
petebunting committed Jun 13, 2024
1 parent a7d0eb7 commit e7b2296
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python/rsgislib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,7 @@ class TQDMProgressBar:

def __init__(self):
self.lprogress = 0
self.pbar = None

def setTotalSteps(self, steps: int):
import tqdm
Expand All @@ -711,13 +712,16 @@ def setTotalSteps(self, steps: int):
self.lprogress = 0

def setProgress(self, progress: int):
if self.pbar is None:
self.setTotalSteps(steps=100)
step = progress - self.lprogress
self.pbar.update(step)
self.lprogress = progress

def reset(self):
self.pbar.close()
import tqdm
if self.pbar is not None:
self.pbar.close()

if is_notebook():
import tqdm.notebook
Expand Down

0 comments on commit e7b2296

Please sign in to comment.