From 37ea0f32887efe3042720f6b41dbc9ab37bf931a Mon Sep 17 00:00:00 2001 From: nanli-emory Date: Fri, 3 May 2024 11:10:07 -0400 Subject: [PATCH] set RNG seed at top level of worker module --- histoqc/_worker.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/histoqc/_worker.py b/histoqc/_worker.py index 384987f..e62c635 100644 --- a/histoqc/_worker.py +++ b/histoqc/_worker.py @@ -1,7 +1,7 @@ """histoqc worker functions""" import os import shutil - +import numpy as np from histoqc.BaseImage import BaseImage from histoqc._pipeline import load_pipeline from histoqc._pipeline import setup_plotting_backend @@ -18,7 +18,9 @@ def worker_setup(c): def worker(idx, file_name, *, process_queue, config, outdir, log_manager, lock, shared_dict, num_files, force, seed): """pipeline worker function""" - + # set the seed + if seed is not None: + np.random.seed(seed) # --- output directory preparation -------------------------------- fname_outdir = os.path.join(outdir, os.path.basename(file_name)) if os.path.isdir(fname_outdir): # directory exists