Skip to content

Commit bff0750

Browse files
committed
Refactor import statement formatting and improve readability in run_parallel function
1 parent ff0f3cb commit bff0750

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/flowerpower/utils/misc.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,8 @@ def to_pyarrow_table(*args, **kwargs):
266266

267267
if importlib.util.find_spec("joblib"):
268268
from joblib import Parallel, delayed
269-
from rich.progress import Progress, BarColumn, TextColumn, TimeElapsedColumn
270-
269+
from rich.progress import (BarColumn, Progress, TextColumn,
270+
TimeElapsedColumn)
271271

272272
def run_parallel(
273273
func: callable,
@@ -365,7 +365,9 @@ def run_parallel(
365365
TimeElapsedColumn(),
366366
transient=True,
367367
) as progress:
368-
task = progress.add_task("Running in parallel...", total=len(param_combinations))
368+
task = progress.add_task(
369+
"Running in parallel...", total=len(param_combinations)
370+
)
369371

370372
def wrapper(idx, param_tuple):
371373
res = func(
@@ -381,7 +383,6 @@ def wrapper(idx, param_tuple):
381383
progress.update(task, advance=1)
382384
return idx, res
383385

384-
385386
for idx, result in Parallel(**parallel_kwargs)(
386387
delayed(wrapper)(i, param_tuple)
387388
for i, param_tuple in enumerate(param_combinations)

0 commit comments

Comments
 (0)