(
step_1.is_sub(step_1_0),
step_1_0.is_sub(step_1),
step_1_0.is_sub(step_1_0),
step_1_0.is_sub(step_2),
step_1_0.is_sub(step_3_0), )
(False, True, True, False, False)
/opt/hostedtoolcache/Python/3.11.4/x64/lib/python3.11/site-packages/fastcore/docscrape.py:225: UserWarning: Unknown section Attributes
else: warn(msg)
/opt/hostedtoolcache/Python/3.11.4/x64/lib/python3.11/site-packages/fastcore/docscrape.py:225: UserWarning: Unknown section Methods
else: warn(msg)
kstep (num:int, sub:Optional[int]=None, val:Optional[int]=1, desc:Optional[str]=None)
A dataclass to store step information.
Type | Default | Details | |
---|---|---|---|
num | int | The main number of the step. | |
sub | Optional | None | The sub number of the step, if it exists. |
val | Optional | 1 | The value of the step. |
desc | Optional | None | A description for the step. |
kuut (*args, **kwargs)
A progress bar class that extends tqdm and operates with kstep instances.
# create a list of steps
steps = [kstep(num=i, sub=i+1, val=i+2, desc=f"Step {i}") for i in range(10)]
# create a kuut instance
pbar = kuut(steps=steps, display=False)
# use the properties
(
pbar.pbar_total, # outputs: 65
pbar.step_nums, # outputs: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
pbar.num_main_steps # outputs: 10
)
(65, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 10)
steps = [
kstep(1, val=20, desc='download'),
kstep(2, sub=0, val=5, desc='load_timepoints'),
kstep(2, sub=1, val=5, desc='load_timepoints'),
kstep(2, sub=2, val=5, desc='load_timepoints'),
kstep(2, sub=3, val=5, desc='load_timepoints'),
kstep(2, sub=4, val=5, desc='load_timepoints'),
# kstep(2, val=25, desc='load_timepoints'),
kstep(3, sub=0, val=5, desc='library_fitlering'),
kstep(3, sub=1, val=5, desc='library_fitlering'),
kstep(3, sub=2, val=5, desc='library_fitlering'),
kstep(3, sub=3, val=5, desc='library_fitlering'),
kstep(3, sub=4, val=5, desc='library_fitlering'),
# kstep(3, val=25, desc='library_fitlering'),
kstep(4, val=5, desc='merge_data'),
kstep(5, sub=0, val=5, desc='filter_data'),
kstep(5, sub=1, val=5, desc='filter_data'),
kstep(5, sub=2, val=5, desc='filter_data'),
kstep(5, sub=3, val=5, desc='filter_data'),
kstep(5, sub=4, val=5, desc='filter_data'),
kstep(5, sub=5, val=5, desc='filter_data'),
# kstep(5, val=30, desc='filter_data'),
kstep(6, val=20, desc='embed'),
kstep(7, desc='save'),
]