Skip to content

Commit

Permalink
frelon_peaksearch: allow to pass kwargs to process_map in `proces…
Browse files Browse the repository at this point in the history
…s` function (#386)

---------

Co-authored-by: noordhee <[email protected]>
  • Loading branch information
abmajith and noordhee authored Jan 22, 2025
1 parent 5538a77 commit 507440e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ImageD11/frelon_peaksearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def guess_bg(ds, scan_number=0, start=0, step=9, n=None):
PKCOL = [getattr(ImageD11.cImageD11, p) for p in PKSAVE]


def process(ds, worker_args, ncpu=None):
def process(ds, worker_args, ncpu=None, **process_map_kwargs):
"""
Runs over the first scan in a dataset in parallel
Expand All @@ -382,8 +382,9 @@ def process(ds, worker_args, ncpu=None):
n_frames = omega.shape[0]

args = [(hname, frames_dset, i, omega[i], worker_args) for i in range(n_frames)]


all_peaks = process_map(pps, args, chunksize=1, max_workers=nthreads)
all_peaks = process_map(pps, args, chunksize=1, max_workers=nthreads, **process_map_kwargs)

# make a dict to hold our results in
cf_2d_dict = {}
Expand Down

0 comments on commit 507440e

Please sign in to comment.