Skip to content

Commit

Permalink
Fix parallel_apply
Browse files Browse the repository at this point in the history
  • Loading branch information
vikineema committed Oct 15, 2024
1 parent e54dee6 commit 53b42a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Tools/deafrica_tools/datahandling.py
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ def parallel_apply(ds, dim, func, *args):
with ProcessPoolExecutor() as executor:

# Apply func in parallel
groups = [group for (i, group) in ds.groupby(dim)]
groups = [group.squeeze(dim=dim) for (i, group) in ds.groupby(dim)]
to_iterate = (groups, *(repeat(i, len(groups)) for i in args))
out_list = list(tqdm(executor.map(func, *to_iterate), total=len(groups)))

Expand Down

0 comments on commit 53b42a1

Please sign in to comment.