Skip to content

Commit

Permalink
Accept n_jobs=-1 for parallel computation (#96 #102)
Browse files Browse the repository at this point in the history
Closes #96
  • Loading branch information
jpweytjens authored and J535D165 committed Jun 9, 2019
1 parent 87a5f4a commit f3fbf37
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions recordlinkage/base.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import warnings
from abc import ABCMeta, abstractmethod

from joblib import Parallel, delayed
from joblib import Parallel, delayed, cpu_count

import numpy as np

Expand Down Expand Up @@ -538,7 +538,10 @@ def __init__(self, features=[], n_jobs=1, indexing_type='label',
self.add(features)

# public
self.n_jobs = n_jobs
if n_jobs == -1:
self.n_jobs = cpu_count()
else:
self.n_jobs = n_jobs
self.indexing_type = indexing_type # label of position
self.features = []

Expand Down

0 comments on commit f3fbf37

Please sign in to comment.