forked from enviPath/enviPy
[Fix] Update plotting imports and thread handling in Pepper class (#382)
- plt.subplot does not work reliably with async/ threads. - Bug in thread run that would fail with env set (string to number) Reviewed-on: enviPath/enviPy#382 Co-authored-by: Tobias O <tobias.olenyi@envipath.com> Co-committed-by: Tobias O <tobias.olenyi@envipath.com>
This commit is contained in:
@ -187,8 +187,9 @@ class Pepper:
|
||||
groups = [group for group in dataset.group_by("structure_id")]
|
||||
|
||||
# Unless explicitly set compute everything serial
|
||||
if os.environ.get("N_PEPPER_THREADS", 1) > 1:
|
||||
results = Parallel(n_jobs=os.environ["N_PEPPER_THREADS"])(
|
||||
n_threads = int(os.environ.get("N_PEPPER_THREADS", 1))
|
||||
if n_threads > 1:
|
||||
results = Parallel(n_jobs=n_threads)(
|
||||
delayed(compute_bayes_per_group)(group[1])
|
||||
for group in dataset.group_by("structure_id")
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user