PySDM_examples.utils.progbar_controller

 1from PySDM_examples.utils.widgets import FloatProgress, display
 2
 3
 4class ProgBarController:
 5    def __init__(self, description=""):
 6        self.progress = FloatProgress(
 7            value=0.0, min=0.0, max=1.0, description=description
 8        )
 9        self.panic = False
10
11    def __enter__(self):
12        self.set_percent(0)
13        display(self.progress)
14
15    def __exit__(self, *_):
16        pass
17
18    def set_percent(self, value):
19        self.progress.value = value
class ProgBarController:
 5class ProgBarController:
 6    def __init__(self, description=""):
 7        self.progress = FloatProgress(
 8            value=0.0, min=0.0, max=1.0, description=description
 9        )
10        self.panic = False
11
12    def __enter__(self):
13        self.set_percent(0)
14        display(self.progress)
15
16    def __exit__(self, *_):
17        pass
18
19    def set_percent(self, value):
20        self.progress.value = value
ProgBarController(description='')
 6    def __init__(self, description=""):
 7        self.progress = FloatProgress(
 8            value=0.0, min=0.0, max=1.0, description=description
 9        )
10        self.panic = False
progress
panic
def set_percent(self, value):
19    def set_percent(self, value):
20        self.progress.value = value