Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frelon_peaksearch: allow to pass kwargs to process_map in process function #386

Merged
merged 7 commits into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading