Skip to content

Commit

Permalink
Update parallelize.py
Browse files Browse the repository at this point in the history
use `.lower()` to convert possible "upper" keywords to "lower"
  • Loading branch information
IncubatorShokuhou authored Oct 13, 2020
1 parent d0ee6e4 commit 42f0c08
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions parallelize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 42f0c08

Please sign in to comment.