From 42f0c08b9c2e442657c44c9ddd219debabe98871 Mon Sep 17 00:00:00 2001 From: Hao Lyu <20434183+IncubatorShokuhou@users.noreply.github.com> Date: Tue, 13 Oct 2020 14:45:44 +0800 Subject: [PATCH] Update parallelize.py use `.lower()` to convert possible "upper" keywords to "lower" --- parallelize.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/parallelize.py b/parallelize.py index 24b2cc3..7d5c89a 100644 --- a/parallelize.py +++ b/parallelize.py @@ -9,11 +9,11 @@ def get_per_cpu(seq,n_jobs= "half"): elif isinstance(n_jobs,float): n_jobs_in = int(n_jobs) elif isinstance(n_jobs,str): - if n_jobs == "all": + if n_jobs.lower() == "all": n_jobs_in = multiprocessing.cpu_count() - elif n_jobs == "half": + elif n_jobs.lower() == "half": n_jobs_in = int( multiprocessing.cpu_count() / 2 ) - elif n_jobs == "quarter": + elif n_jobs.lower() == "quarter": n_jobs_in = int( multiprocessing.cpu_count() / 4 ) else: try: